标签:开启 obb set 就是 cal loaded inactive 2.x 下载软件
时间服务器ntp软件(支持ntp协议) CentOS6自带
CentOS7需要安装的
chrony软件(支持ntp协议) CentOS7自带
环境准备
[root@Cobbler ~]# getenforce
Disabled
[root@Cobbler ~]# systemctl status firewalld.service
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:firewalld(1)
[root@m02 ~]# hostname -I
10.0.0.62 172.16.1.62
服务端部署
下载软件
[root@m02 ~]# yum install -y ntp
[root@m02 ~]# rpm -qa ntp
ntp-4.2.6p5-25.el7.centos.2.x86_64
8 #restrict default nomodify notrap nopeer noquery
9 restrict default nomodify
21 #server 0.centos.pool.ntp.org iburst
22 #server 1.centos.pool.ntp.org iburst
23 #server 2.centos.pool.ntp.org iburst
24 #server 3.centos.pool.ntp.org iburst
25 server ntp1.aliyun.com
restrict default nomodify notrap nopeer noquery
21,25c21,25
< #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 ntp1.aliyun.comserver 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
[root@m02 ~]# systemctl start ntpd
time5.aliyun.co 10.137.38.86 2 u 36 64 1 52.686 -1371.9 0.000
[root@m02 ~]# ntpstat
synchronised to NTP server (182.92.12.11) at stratum 3
time correct to within 982 ms
polling server every 64 s
客户端部署
下载软件
[root@Cobbler ~]# yum -y install ntpdate
测试是否同步
[root@Cobbler ~]# ntpdate 172.16.1.62
10 Jan 09:07:47 ntpdate[1504]: adjust time server 172.16.1.62 offset -0.001513 sec
[root@Cobbler ~]# crontab -l
#时间同步
/5 * /usr/sbin/ntpdate 172.16.1.62 &>/dev/null
服务端部署
修改chrony配置文件
[root@m02 ~]# vim /etc/chrony.conf
1 # Use public servers from the pool.ntp.org project.
2 # Please consider joining the pool
(http://www.pool.ntp.org/join.html).
3 #server 0.centos.pool.ntp.org iburst
4 #server 1.centos.pool.ntp.org iburst
5 #server 2.centos.pool.ntp.org iburst
6 #server 3.centos.pool.ntp.org iburst
7 server ntp1.aliyun.com
26 # Allow NTP client access from local network.
27 #allow 192.168.0.0/16
28 allow 172.16.1.0/24
1 # Use public servers from the pool.ntp.org project.
2 # Please consider joining the pool (http://www.pool.ntp.org/join.html).
3 #server 0.centos.pool.ntp.org iburst
4 #server 1.centos.pool.ntp.org iburst
5 #server 2.centos.pool.ntp.org iburst
6 #server 3.centos.pool.ntp.org iburst
7 server 172.16.1.62
开启服务
[root@Cobbler ~]# systemctl start chronyd
修改时间测试
[root@Cobbler ~]# date -s 1111
Wed Jan 10 11:11:00 CST 2018
5.查看时间
[root@Cobbler ~]# date
Wed Jan 10 11:15:47 CST 2018
[root@Cobbler ~]# date
Wed Jan 10 09:30:37 CST 2018
标签:开启 obb set 就是 cal loaded inactive 2.x 下载软件
原文地址:http://blog.51cto.com/13554498/2059429