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》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

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

Algorithms

Algorithms

Robert Sedgewick、Kevin Wayne / Addison-Wesley Professional / 2011-3-19 / USD 89.99

Essential Information about Algorithms and Data Structures A Classic Reference The latest version of Sedgewick,s best-selling series, reflecting an indispensable body of knowledge developed over the ......一起来看看 《Algorithms》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具