zoukankan      html  css  js  c++  java
  • CentOS7+CDH5.14.0安装全流程记录,图文详解全程实测-4配置NTP服务

    配置NTP服务。标准的做法是配置NTP服务器,但是这里为了方便就用简化的方式配置了。

    这个在安装初期,不是必须的,只要保证各机器的时间同步就行,使用如下命令可以查看时间是否同步:

    [root@cdh1 ~]# date;ssh cdh2 date;
    2019年 04月 12日 星期五 16:19:58 CST
    2019年 04月 12日 星期五 16:19:59 CST

    时间差1-2秒钟就没事。

     确保每台机器的ntpd服务都是启动状态,否则后面CDH安装完成后,主机状态会是错误状态。

    systemctl start ntpd.service

    systemctl status ntpd.service

    设置开机自动启动:

    systemctl enable ntpd.service


    1.执行命令,修改配置。

    vim /etc/ntp.conf
                我修改的配置如下,注意第一行配置根据自己centos的网关来配置。

    restrict 192.168.9.0 mask 255.255.255.0 nomodify notrap 

    # Use public servers from the pool.ntp.org project.

    # Please consider joining the pool (http://www.pool.ntp.org/join.html).

    #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

    fudge 127.127.1.0 stratum 10
                

    2.执行命令

    vim /etc/sysconfig/ntpd
                增加一行:

                SYNC_HWCLOCK=yes

     3.重启ntp服务

    systemctl restart ntpd.service

    systemctl status ntpd.service

  • 相关阅读:
    ViewModel和LiveData问题思考与解答
    vps_centos_7_系统环境常规配置备忘
    JVM内存管理&GC
    sping注解
    ibatis order by 防止sql注入
    好用的绿色工具(mss2sql,jd-gui)
    mysql优化
    Spring事务
    好文分享_java堆栈的区别
    Linux usual cmd
  • 原文地址:https://www.cnblogs.com/qqflying/p/10696799.html
Copyright © 2011-2022 走看看