Ntp时间服务器
集群保障时间一致 共有3个方法
- 手工的改 date –s “2016-01-05”
- 启动service NTP
- 基于实体机 7*24 不关机 用脚本在规定时间同步 达到时间同步完美
Ntp 时间服务器
- 编辑 /etc/ntp.conf
vim /etc/ntp.conf
- 相关内容编辑 进入配置文件我们需要在配置文件中添加代码内容
-
把如下图第一个红框中内容替换为以下内容
restrict default ignore
restrict 127.0.0.1 mask 255.255.255.0 nomodify notrap
注意这里的ip写的是自己的window 中VMnet1 IPv4 地址,不知道的可以在cmd命令中ipconfig查看 -
把第二个红框中的内容用#号注释掉
#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
-
注释完成之后添加