代码拉取完成,页面将自动刷新
---
# Copyright 2016 PingCAP, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# See the License for the specific language governing permissions and
# limitations under the License.
# The playbook of TiDB
- name: check config locally
hosts: localhost
tags:
- always
roles:
- check_config_static
- name: gather all facts, and check dest
hosts: all
tags:
- always
roles:
- check_config_dynamic
- name: TiDB cluster
hosts: tidb_servers
tags:
- tidb
tasks:
- name: stop TiDB by supervise
shell: cd {{ deploy_dir }}/scripts && ./stop_{{ item }}.sh
when: process_supervision == 'supervise'
with_items:
- tidb
- name: stop TiDB by systemd
systemd: name=tidb-{{ tidb_port }}.service state=stopped
become: true
when: process_supervision == 'systemd'
- name: wait until the TiDB port is down
wait_for:
host: "{{ ansible_host }}"
port: "{{ tidb_port }}"
state: stopped
msg: "the TiDB port {{ tidb_port }} is not down"
- name: pump cluster
hosts: pump_servers
tags:
- pump
tasks:
- name: stop pump by supervise
shell: cd {{ deploy_dir }}/scripts && ./stop_{{ item }}.sh
with_items:
- pump
when:
- enable_binlog|default(false)
- process_supervision == 'supervise'
- name: stop pump by systemd
systemd: name=pump-{{ pump_port }}.service state=stopped
become: true
when:
- enable_binlog|default(false)
- process_supervision == 'systemd'
- name: wait until the pump port is down
wait_for:
host: "{{ ansible_host }}"
port: "{{ pump_port }}"
state: stopped
msg: "the pump port {{ pump_port }} is not down"
when: enable_binlog|default(false)
- name: clean pump data
file: path={{ pump_data_dir }} state=absent
when: enable_binlog|default(false)
- name: TiKV cluster
hosts: tikv_servers
tasks:
- name: stop TiKV by supervise
shell: cd {{ deploy_dir }}/scripts && ./stop_{{ item }}.sh
when: process_supervision == 'supervise'
with_items:
- tikv
- name: stop TiKV by systemd
systemd: name=tikv-{{ tikv_port }}.service state=stopped
become: true
when: process_supervision == 'systemd'
- name: wait until the TiKV port is down
wait_for:
host: "{{ ansible_host }}"
port: "{{ tikv_port }}"
state: stopped
msg: "the TiKV port {{ tikv_port }} is not down"
- name: clean TiKV data
file: path={{ tikv_data_dir }} state=absent
- name: create new TiKV data dir
file: path={{ tikv_data_dir }} state=directory mode=0755
- name: clean TiKV wal data
file: path={{ wal_dir }} state=absent
when: wal_dir is defined
- name: create new TiKV wal data dir
file: path={{ wal_dir }} state=directory mode=0755
when: wal_dir is defined
- name: clean TiKV raftdb data
file: path={{ raftdb_path }} state=absent
when: raftdb_path is defined
- name: create new TiKV raftdb data dir
file: path={{ raftdb_path }} state=directory mode=0755
when: raftdb_path is defined
- name: PD cluster
hosts: pd_servers
tasks:
- name: stop PD by supervise
shell: cd {{ deploy_dir }}/scripts && ./stop_{{ item }}.sh
when: process_supervision == 'supervise'
with_items:
- pd
- name: stop PD by systemd
systemd: name=pd-{{ pd_client_port }}.service state=stopped
become: true
when: process_supervision == 'systemd'
- name: wait until the PD port is down
wait_for:
host: "{{ ansible_host }}"
port: "{{ pd_client_port }}"
state: stopped
msg: "the PD port {{ pd_client_port }} is not down"
- name: clean PD data
file: path={{ pd_data_dir }} state=absent
- name: create new PD data dir
file: path={{ pd_data_dir }} state=directory mode=0755
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。