TiDB database PD hybrid deployment
The problem of deploying the same machine in multiple clusters of pd
-- 2019-04-25 Spring Thunder
1. Summary 1.1, questions
The pd of multiple tidb clusters is deployed on the same machine, and the service of pd is the same, which causes pd to fail to start.
Version: 2.1.2
1.2. Problem and solution
Modify the port part of the related files to solve the problem
2. Specific 2.1, specific issues 2.1.1, system services
/ etc/systemd/system
Pd.service
2.1.2, start and stop script of pd
[${deploy_dir} / scripts/start_pd.sh]
#! / bin/bash
Set-e
# WARNING: This file was auto-generated. Do not edit!
# All your edit might be overwritten!
Sudo systemctl start pd.service
[${deploy_dir} / scripts/stop_pd.sh]
#! / bin/bash
Set-e
# WARNING: This file was auto-generated. Do not edit!
# All your edit might be overwritten!
Sudo systemctl stop pd.service
2.2, repair
Tidb central control computer:
[1. Change the deployed]
/ work/tidb/tidb-ansible-2.1/roles/pd/tasks/ systemd_deployment.yml
Change:
Service_name: pd- {{pd_client_port}}
[2, rolling upgrade]
/ work/tidb/tidb-ansible-2.1/ rolling_update.yml
Change:
-name: stop PD by systemd
Systemd: name=pd-{{pd_client_port}} .service state=stopped
-name: start PD by systemd
Systemd: name=pd-{{pd_client_port}} .service state=started
[3. Change start]
/ work/tidb/tidb-ansible-2.1/ start.yml
-name: start PD by systemd
Systemd: name=pd- {{pd_client_port}} .service state=started
2.3. Results after repair
Manually delete the target pd machine's:
${deploy_dir} / scripts/start_pd.sh
${deploy_dir} / scripts/stop_pd.sh
${deploy_dir} / scripts/run_pd.sh
The central control computer is redeployed:
Ansible-playbook deploy.yml-l pd machine IP
Check:
Start_pd.sh
#! / bin/bash
Set-e
# WARNING: This file was auto-generated. Do not edit!
# All your edit might be overwritten!
Sudo systemctl start pd-10000 .service
Stop_pd.sh
#! / bin/bash
Set-e
# WARNING: This file was auto-generated. Do not edit!
# All your edit might be overwritten!
Sudo systemctl stop pd-10000 .service
Zhengzhou Infertility Hospital: http://jbk.39.net/yiyuanzaixian/zztjyy/
Cd / etc/systemd/system
Pd-10000 .service
Enable:
Ansible-playbook start.yml