欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

tidb扩容tikv节点

程序员文章站 2022-07-13 10:53:12
...

步骤只要按照官方文档来,可能会遇到的错误,记录了下。

准备

编辑 inventory.ini,加入新加节点。

初始化新增节点

ansible-playbook bootstrap.yml -l xxxxx.xxx.xxx

会报错如下

TASK [bootstrap : gather facts] ***************************************************************************************************************************************************************
fatal: [xxx.xxx.xxx]: FAILED! => {"changed": false, "module_stderr": "Shared connection to xxx.xxx.xxx closed.\r\n", "module_stdout": "sudo: a password is required\r\n", "msg": "MODULE FAILURE", "rc": 1}
	to retry, use: --limit @/home/tidb/tidb-ansible-release-2.0/retry_files/bootstrap.retry

PLAY RECAP ************************************************************************************************************************************************************************************
xxx.xxx.xxx               : ok=6    changed=0    unreachable=0    failed=1   


ERROR MESSAGE SUMMARY *************************************************************************************************************************************************************************
[xxx.xxx.xxx]: Ansible FAILED! => playbook: bootstrap.yml; TASK: bootstrap : gather facts; message: {"changed": false, "module_stderr": "Shared connection to xxx.xxx.xxx closed.\r\n", "module_stdout": "sudo: a password is required\r\n", "msg": "MODULE FAILURE", "rc": 1}

需要将tidb ALL=(ALL) NOPASSWD: ALL加入visudo

deploy

ansible-playbook deploy.yml -l xxx.xxx.xxx -k

start

ansible-playbook start.yml -l xxx.xxx.xxx -k

可能会有的报错

TASK [start node_exporter by systemd] *********************************************************************************************************************************************************
fatal: [xxx.xxx.xxx]: FAILED! => {"changed": false, "msg": "Could not find the requested service node_exporter.service: host"}
	to retry, use: --limit @/home/tidb/tidb-ansible-release-2.0/retry_files/start.retry

PLAY RECAP ************************************************************************************************************************************************************************************
xxx.xxx.xxx               : ok=3    changed=0    unreachable=0    failed=1   


ERROR MESSAGE SUMMARY *************************************************************************************************************************************************************************
[xxx.xxx.xxx]: Ansible FAILED! => playbook: start.yml; TASK: start node_exporter by systemd; message: {"changed": false, "msg": "Could not find the requested service node_exporter.service: host"}

Ask for help:
Contact us: [email protected]
It seems that you encounter some problems. You can send an email to the above email address, attached with the tidb-ansible/inventory.ini and tidb-ansible/log/ansible.log files and the error message, or new issue on https://github.com/pingcap/tidb-ansible/issues. We'll try our best to help you deploy a TiDB cluster. Thanks. :-)

修改systemctl list-unit-files|grep node
看到没有对应的服务名称

手工添加,找到systemctl的路径:
cd /etc/systemd/system/

[Unit]
Description=node_exporter service
After=syslog.target network.target remote-fs.target nss-lookup.target

[Service]
LimitNOFILE=1000000
User=tidb
ExecStart=/home/tidb/deploy_2/scripts/run_node_exporter.sh
Restart=always
RestartSec=15s

[Install]
WantedBy=multi-user.target

再启动:

ansible-playbook start.yml -l xxx.xxx.xxx -k 

成功

更新监控

ansible-playbook rolling_update_monitor.yml --tags=prometheus -k

新增完成,登入监控平台查看
17:02 成功加入,开始平衡数据。
每个节点数据大概100K个regios