1.yum install ntp ntpdate 安装NTP服务器

2.NTP服务器配置:修改配置文件  vi /etc/ntp.conf

3./etc/init.d/ntpd restart重启服务

4.ntpq -p查看状态

5.date查看当前时间

6.客户机同步时间 ntpdate pool.ntp.org    (pool.ntp.org为服务机ip地址,pool.ntp.org为官方地址)

7.配置时间同步客户机       crontab -e(添加计划任务)添加 * * * * */usr/sbin/ntpdate ntp-server ip地址 >>/usr/local/logscrontab/ntpdate.log(* * * * *分别表示分 时 日 月 星期)

8.ntp服务器配置文件内容

               NTP时间服务器搭建 

                NTP时间服务器搭建

                NTP时间服务器搭建

9.客户端crontab添加    * * * * */usr/sbin/ntpdate ip地址 >>/data/logs/ntp.log 2>&1 (ip地址为服务机ip地址)

相关文章:

  • 2022-12-23
  • 2022-01-23
  • 2021-12-21
  • 2021-09-12
  • 2021-10-19
  • 2021-10-27
  • 2022-01-18
猜你喜欢
  • 2021-07-21
  • 2022-02-14
  • 2021-11-20
  • 2021-05-17
  • 2022-12-23
相关资源
相似解决方案