Openstack Swift学习(八):配置ntp

栏目: 编程工具 · 发布时间: 7年前

内容简介:openstack swift 对各个节点的时钟同步有着较强的要求,所以需要在系统中配置时钟同步。编辑 /etc/sysconfig/ntpd:

openstack swift 对各个节点的时钟同步有着较强的要求,所以需要在系统中配置时钟同步。

1.选择一台主机作为服务器,配置 ntp

1.1 安装

yum install -y ntp

1.2 编辑 /etc/ntp.conf

#服务默认拒绝所有NTP连线
restrict default kod nomodify notrap nopeer noquery
#拒绝IPV6所有NTP连线
restrict -6 default kod nomodify notrap nopeer noquery

#示允许本机访问  
restrict 127.0.0.1
restrict -6 ::1                     

#允许192.168.0.0/24 网段的主机来进行对时,不允许客户端来修改,登录ntp服务器
restrict 192.168.0.0 mask 255.255.255.0 nomodify notrap    

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

server 1.cn.pool.ntp.org
server 2.cn.pool.ntp.org prefer    #prefer优先使用

1.3 同步更新hwclock

编辑 /etc/sysconfig/ntpd:

SYNC_HWCLOCK=yes

1.4 启动

sudo systemctl restart ntpd.service

1.5 加入开机启动

sudo chkconfig ntpd on

2. 客户端同步时间

2.1 同步

ntpdate 192.168.0.128

192.168.0.128 是搭建 ntp 服务的机器的 ip。

2.2 加入任务计划

每天凌晨一点同步:

crontab -e  
0 1 * * * sudo ntpdate 192.168.0.128

以上所述就是小编给大家介绍的《Openstack Swift学习(八):配置ntp》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Beginning iPhone and iPad Web Apps

Beginning iPhone and iPad Web Apps

Chris Apers、Daniel Paterson / Apress / 2010-12-15 / USD 39.99

It seems that everyone and her sister has developed an iPhone App—everyone except you, the hard-working web professional. And now with the introduction of the iPad, you may even feel farther behind. B......一起来看看 《Beginning iPhone and iPad Web Apps》 这本书的介绍吧!

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具