Centos 7.4配置时间同步NTP服务

1 查看是否安装ntp服务     rpm -qa | grep ntp

 

2 如果没安装,执行  yum install ntp

3 编辑配置文件 vi /etc/ntp.conf

    去掉第18行的# 修改成自己的网段
    restrict 192.168.7.0 mask 255.255.255.0 nomodify notrap

    注释掉以下几行(22行)
     #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 127.127.1.0     #local clock
     fudge 127.127.1.0  stratum 10

4 启动ntp服务(默认式开始)PC1 root用户操作

    systemctl start ntpd

    systemctl enable ntpd

5、同步服务器的时间(PC1)  ntpdate cn.pool.ntp.org    -->操作这一步时关闭ntp服务

6、如果另外两台的ntp的进程开启,那么需要关闭

7.第2、3台向第一台同步时间  ntpdate bigdata01

8.制定周期性时间同步计划任务(PC2、PC3定时向PC1手动同步时间)
    在PC2 PC3每10分钟同步一次时间


    # crontab -e
    */10 * * * * /usr/sbin/ntpdate hadoop.senior01

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值