配置本地时钟服务器

本文使用两节点虚拟机集群环境介绍如何配置本地时钟服务器,两台机器分别为,

192.168.1.93    openstack-1.novalocal   openstack-1
192.168.1.94    openstack-2.novalocal   openstack-2

这里假设我们以openstack-1为本地时钟服务器,openstack-2与opentack-1进行时钟同步,步骤如下,

1 确保ntpd关闭状态

[root@openstack-1 ~]# service ntpd stop
Shutting down ntpd:                                        [  OK  ]
[root@openstack-1 ~]# service ntpd status
ntpd is stopped

[root@openstack-2 ~]# service ntpd stop
Shutting down ntpd:                                        [  OK  ]
[root@openstack-2 ~]# service ntpd status
ntpd is stopped

2 配置openstack-1,编辑/etc/ntp.conf,将

server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst

修改为

server 127.127.1.0 iburst

3 配置openstack-2,编辑/etc/ntp.conf,将

server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst

修改为

server 192.168.1.93 iburst

4 使用ntpdate同步openstack-2与openstack-1时间,报错如下

root@openstack-2 ~]# ntpdate -u openstack-1
 8 Aug 15:06:57 ntpdate[12705]: no server suitable for synchronization found

5 启动openstack-1上面的ntp服务并在openstack-2上重新ntpdate

[root@openstack-1 ~]# service ntpd start
Starting ntpd:                                             [  OK  ]
You have mail in /var/spool/mail/trafodion
[root@openstack-1 ~]#
[root@openstack-1 ~]#
[root@openstack-1 ~]# service ntpd status
ntpd (pid  62422) is running...

[root@openstack-2 ~]# ntpdate -u openstack-1
 8 Aug 15:07:14 ntpdate[12852]: adjust time server 192.168.1.93 offset 0.001302 sec

6 启动openstack-2上面的ntpd服务

[root@openstack-2 ~]# service ntpd start
Starting ntpd:                                             [  OK  ]
[root@openstack-2 ~]# service ntpd status
ntpd (pid  13299) is running...

至此,本地时钟服务器已经配置完成,欢迎指正!

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

数据源的港湾

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值