1. 程式人生 > >Ceph:監視器時鐘偏差問題(clock skew detected on)

Ceph:監視器時鐘偏差問題(clock skew detected on)

ack poc -c health 同步 時鐘 root bit name

最近幾天接觸到了ceph,搭建的過程中也發現很多問題:

1、故障現象

# ceph -s
    cluster e2ca994a-00c4-477f-9390-ea3f931c5062
    health HEALTH_WARN
            clock skew detected on mon.hz-01-ops-tc-ceph-04, mon.hz-01-ops-tc-ceph-02
            Monitor clock skew detected 
    monmap e1: 3 mons at {hz-01-ops-tc-ceph-02=172.16.2.231:6789/0,hz-01-ops-tc-ceph-03=172.16.2.172:6789/0,hz-01-ops-tc-ceph-04=172.16.2.181:6789/0}
            election epoch 6, quorum 0,1,2 hz-01-ops-tc-ceph-03,hz-01-ops-tc-ceph-04,hz-01-ops-tc-ceph-02
    osdmap e19: 4 osds: 4 up, 4 in
            flags sortbitwise,require_jewel_osds
      pgmap v37: 64 pgs, 1 pools, 0 bytes data, 0 objects
            135 MB used, 179 GB / 179 GB avail
                  64 active+clean

網上查資料有說ntp時間的問題,但我是在內部測試環境中進行的,不存在時間不同步的問題


2、處理過程

# cd /my-cluster
# ls
ceph.bootstrap-mds.keyring  ceph.bootstrap-osd.keyring  ceph.client.admin.keyring  ceph-deploy-ceph.log
ceph.bootstrap-mgr.keyring  ceph.bootstrap-rgw.keyring  ceph.conf                  ceph.mon.keyring
# vim ceph.conf 
# 添加如下信息:
mon clock drift allowed = 2    
mon clock drift warn backoff = 30
同步配置信息:
# ceph-deploy --overwrite-conf admin hz-01-ops-tc-ceph-01 hz-01-ops-tc-ceph-02 hz-01-ops-tc-ceph-03 hz-01-ops-tc-ceph-04
[ceph_deploy.conf][DEBUG ] found configuration file at: /root/.cephdeploy.conf
[ceph_deploy.cli][INFO  ] Invoked (1.5.39): /usr/bin/ceph-deploy --overwrite-conf admin hz-01-ops-tc-ceph-01 hz-01-ops-tc-ceph-02 hz-01-ops-tc-ceph-03 hz-01-ops-tc-ceph-04
[ceph_deploy.cli][INFO  ] ceph-deploy options:
[ceph_deploy.cli][INFO  ]  username                      : None
[ceph_deploy.cli][INFO  ]  verbose                      : False
[ceph_deploy.cli][INFO  ]  overwrite_conf                : True
[ceph_deploy.cli][INFO  ]  quiet                        : False
[ceph_deploy.cli][INFO  ]  cd_conf                      : <ceph_deploy.conf.cephdeploy.Conf instance at 0xccbc68>
[ceph_deploy.cli][INFO  ]  cluster                      : ceph
[ceph_deploy.cli][INFO  ]  client                        : ['hz-01-ops-tc-ceph-01', 'hz-01-ops-tc-ceph-02', 'hz-01-ops-tc-ceph-03', 'hz-01-ops-tc-ceph-04']
[ceph_deploy.cli][INFO  ]  func                          : <function admin at 0xbfa8c0>
[ceph_deploy.cli][INFO  ]  ceph_conf                    : None
[ceph_deploy.cli][INFO  ]  default_release              : False
[ceph_deploy.admin][DEBUG ] Pushing admin keys and conf to hz-01-ops-tc-ceph-01
[hz-01-ops-tc-ceph-01][DEBUG ] connected to host: hz-01-ops-tc-ceph-01 
[hz-01-ops-tc-ceph-01][DEBUG ] detect platform information from remote host
[hz-01-ops-tc-ceph-01][DEBUG ] detect machine type
[hz-01-ops-tc-ceph-01][DEBUG ] write cluster configuration to /etc/ceph/{cluster}.conf
[ceph_deploy.admin][DEBUG ] Pushing admin keys and conf to hz-01-ops-tc-ceph-02
[hz-01-ops-tc-ceph-02][DEBUG ] connected to host: hz-01-ops-tc-ceph-02 
[hz-01-ops-tc-ceph-02][DEBUG ] detect platform information from remote host
[hz-01-ops-tc-ceph-02][DEBUG ] detect machine type
[hz-01-ops-tc-ceph-02][DEBUG ] write cluster configuration to /etc/ceph/{cluster}.conf
[ceph_deploy.admin][DEBUG ] Pushing admin keys and conf to hz-01-ops-tc-ceph-03
[hz-01-ops-tc-ceph-03][DEBUG ] connected to host: hz-01-ops-tc-ceph-03 
[hz-01-ops-tc-ceph-03][DEBUG ] detect platform information from remote host
[hz-01-ops-tc-ceph-03][DEBUG ] detect machine type
[hz-01-ops-tc-ceph-03][DEBUG ] write cluster configuration to /etc/ceph/{cluster}.conf
[ceph_deploy.admin][DEBUG ] Pushing admin keys and conf to hz-01-ops-tc-ceph-04
[hz-01-ops-tc-ceph-04][DEBUG ] connected to host: hz-01-ops-tc-ceph-04 
[hz-01-ops-tc-ceph-04][DEBUG ] detect platform information from remote host
[hz-01-ops-tc-ceph-04][DEBUG ] detect machine type
[hz-01-ops-tc-ceph-04][DEBUG ] write cluster configuration to /etc/ceph/{cluster}.conf

到此,問題解決

Ceph:監視器時鐘偏差問題(clock skew detected on)