Linux集群 NTP 时间同步
2018-06-22 15:09
561 查看
基于CentOS 7
执行
查看同步情况:
执行
查看同步情况:
规划
比如有2台机器IP | 主机名 | 说明 |
---|---|---|
192.168.103.51 | cdh51 | 本地NTP服务端 |
192.168.103.52 | cdh52 | 本地NTP客户端 |
安装NTP服务
每台机器都安装ntpyum -y install ntp
NTP服务端(cdh51)配置
/etc/ntp.conf配置driftfile /var/lib/ntp/drift restrict default nomodify notrap nopeer noquery restrict 127.0.0.1 restrict ::1 # 添加该行允许某个网段服务器从该服务同步时间 restrict 192.168.103.0 mask 255.255.255.0 nomodify notrap # 本地NTP服务同外网NTP服务同步时间 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 includefile /etc/ntp/crypto/pw keys /etc/ntp/keys disable monitor
执行
ntpdate 0.centos.pool.ntp.org,手动做一次时间同步。再执行
systemctl start ntpd
查看同步情况:
# ntpq -p remote refid st t when poll reach delay offset jitter ============================================================================== +ntp1.ams1.nl.le 130.133.1.10 2 u 253 256 377 229.358 -2.606 10.955 +ntp.wdc1.us.lea 130.133.1.10 2 u 459 128 150 331.680 -44.356 17.944 *85.199.214.100 .GPS. 1 u 384 64 140 215.429 10.354 22.668
NTP服务端(cdh51)配置
/etc/ntp.conf配置driftfile /var/lib/ntp/drift restrict default nomodify notrap nopeer noquery restrict 127.0.0.1 restrict ::1 # 同NTP服务端cdh51同步时间 server cdh51 iburst includefile /etc/ntp/crypto/pw keys /etc/ntp/keys disable monitor
执行
ntpdate cdh51,手动做一次时间同步。再执行
systemctl start ntpd
查看同步情况:
# ntpq -p remote refid st t when poll reach delay offset jitter ============================================================================== *cdh51 85.199.214.100 2 u 52 128 377 0.322 -3.060 0.674
相关文章推荐
- Hadoop在linux系统下的集群时间同步
- Linux安装ntp同步时间
- linux主机时间同步总结(ntpdate)
- linux ntp 时间同步
- Linux从Windows通过NTP同步时间
- linux时间同步,ntpd、ntpdate
- linux hadoop本地集群时间同步
- linux同步时间(ntpdate)的IP
- linux集群时间同步,ntpd、ntpdate
- hadoop在linux系统下的集群时间同步
- Linux下ntpdate时间同步
- linux时间同步,ntpd、ntpdate
- linux 及 HP-UX 时间同步 连接NTP server
- ntp组件安装(集群时间同步)
- Linux内网服务器从Windows通过NTP同步时间
- linux ntp时间同步
- Linux安装ntp同步时间
- NTP for Windows,与Linux进行时间同步
- Linux使用ntpdate和ntpd进行时间同步
- Linux ntpdate同步网络时间