tikv節點擴容NTP報錯處理記錄
之前已經使用ansible 批量安裝部署啟動過ntp
安裝:ansible -i sms_addtikv.txt all -m shell -a "sudo yum install ntp ntpdate -y" -b
啟動:ansible -i sms_addtikv.txt all -m shell -a "sudo systemctl start ntpd.service " -b
但是ansible-playbook deploy.yml 安裝tikv時還是報錯:
ERROR MESSAGE SUMMARY ********************************************************************************************************************************************************************************************************************************************************
[172.168.34.89]: Ansible FAILED! => playbook: deploy.yml; TASK: check_system_dynamic : Preflight check - NTP service; message: {"changed": false, "msg": "Make sure NTP service is running and ntpstat is synchronised to NTP server. See https://github.com/pingcap/docs/blob/master/op-guide/ansible-deployment.md#how-to-check-whether-the-ntp-service-is-normal ."}
[172.168.34.72]: Ansible FAILED! => playbook: deploy.yml; TASK: check_system_dynamic : Preflight check - NTP service; message: {"changed": false, "msg": "Make sure NTP service is running and ntpstat is synchronised to NTP server. See https://github.com/pingcap/docs/blob/master/op-guide/ansible-deployment.md#how-to-check-whether-the-ntp-service-is-normal ."}
先檢視ntp狀態
[[email protected]] ~$ ntpstat
unsynchronised
polling server every 64 s
沒有同步好,接下來手動再操作下
[[email protected]] ~$ ntpstat
unsynchronised
time server re-starting
polling server every 8 s
[[email protected]] ~$
[[email protected]] ~$ sudo systemctl stop ntpd.service
[
26 Oct 16:28:52 ntpdate[31699]: adjust time server 5.103.139.163 offset 0.001772 sec
[[email protected]] ~$ sudo systemctl start ntpd.service
[[email protected]] ~$
[[email protected]] ~$
[[email protected]] ~$ ntpstat
synchronised to NTP server (193.228.143.13) at stratum 3
time correct to within 170 ms
polling server every 64 s
[[email protected]] ~$
番外:
一般的執行如下命令,基本可以搞定
$ sudo systemctl stop ntpd.service $ sudo ntpdate pool.ntp.org $ sudo systemctl start ntpd.service |
---|
有時候centos7系統不行,採用下面命令
$ sudo yum install ntp ntpdate $ sudo systemctl start ntpd.service $ sudo systemctl enable ntpd.service |
---|
之後再執行 ansible-playbook deploy.yml命令,就會暢通無阻,順利執行完成。