您的位置:首页 > 数据库

TiDB数据库PD混合部署

2019-09-26 16:55 1156 查看

1、汇总

1.1、问题

多套tidb集群的pd  部署在同样的机器,pd的服务相同,导致pd无法启动

版本:2.1.2

1.2、问题及解决

修改相关文件的端口部分解决

2、具体

2.1、具体问题

2.1.1、系统服务

/etc/systemd/system

pd.service

2.1.2、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

郑州冶疗男性不孕不育医院哪家好:http://byby.zztjyy.com/

2.2、修复

tidb中控机:

【1、更改部署的】

/work/tidb/tidb-ansible-2.1/roles/pd/tasks/ systemd_deployment.yml

更改:

service_name: pd- {{ pd_client_port }}

【2、滚动升级的】

/work/tidb/tidb-ansible-2.1/ rolling_update.yml

更改:

- name: stop PD by systemd 
systemd: name=pd -{{ pd_client_port }} .service state=stopped

http://www.chacha8.cn/detail/1132398232.html

- name: start PD by systemd 
systemd: name=pd -{{ pd_client_port }} .service state=started 
 

 

【3、更改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、修复后结果

手动删除目标pd机器的:

${deploy_dir}/scripts/start_pd.sh

${ deploy_dir } /scripts/stop_pd.sh

${ deploy_dir } /scripts/run_pd.sh

中控机重新部署:

ansible-playbook deploy.yml  -l  pd机器IP

 

检查:

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

 

cd /etc/systemd/system

pd-10000 .service

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: