搭建时间同步服务器——简单高效
2015-12-07 22:30
302 查看
#安装环境CentOS6.7
一、搭建时间同步服务器(172.16.1.61)
1,查看包是否安装
rpm -qa ntp
若没有找到
yum -y install ntp
2、修改ntp.conf配置文件
#配置前做好备份
cd /etc/
mv ntp.conf ntp.bak.conf
vi /etc/ntp.conf
14 restrict 127.0.0.1
15 restrict 0.0.0.0 mask 0.0.0.0 nomodify
16 restrict -6 ::1
23 #server 0.centos.pool.ntp.org iburst
24 #server 1.centos.pool.ntp.org iburst
25 #server 2.centos.pool.ntp.org iburst
26 #server 3.centos.pool.ntp.org iburst
27 server time.nist.gov
28 server 210.72.145.44 prefer
29 server 218.21.130.42
45 server 127.127.1.0 #local clock
46 fudge 127.127.1.0 stratum 10
3、添加开机自启动ntp服务
/etc/init.d/ntpd start
chkconfig ntpd on
echo "###start ntp server">>/etc/rc.local
echo "/etc/init.d/ntpd start" >>/etc/rc.local
二、配置时间同步客户机
1、修改ntp.conf配置文件
#配置前做好备份
cd /etc/
mv ntp.conf ntp.bak.conf
vi /etc/ntp.conf
22 #server 0.centos.pool.ntp.org iburst
23 #server 1.centos.pool.ntp.org iburst
24 #server 2.centos.pool.ntp.org iburst
25 #server 3.centos.pool.ntp.org iburst
26 server 172.16.1.61
2、添加定时任务crontab
###create cron by follow ntp server time at 2015-12-07
*/5 * * * * /usr/sbin/ntpdate 172.16.1.61 >/dev/null 2>&1
本文出自 “Linux高级运维之路” 博客,请务必保留此出处http://yulianhui.blog.51cto.com/10829691/1720560
一、搭建时间同步服务器(172.16.1.61)
1,查看包是否安装
rpm -qa ntp
若没有找到
yum -y install ntp
2、修改ntp.conf配置文件
#配置前做好备份
cd /etc/
mv ntp.conf ntp.bak.conf
vi /etc/ntp.conf
14 restrict 127.0.0.1
15 restrict 0.0.0.0 mask 0.0.0.0 nomodify
16 restrict -6 ::1
23 #server 0.centos.pool.ntp.org iburst
24 #server 1.centos.pool.ntp.org iburst
25 #server 2.centos.pool.ntp.org iburst
26 #server 3.centos.pool.ntp.org iburst
27 server time.nist.gov
28 server 210.72.145.44 prefer
29 server 218.21.130.42
45 server 127.127.1.0 #local clock
46 fudge 127.127.1.0 stratum 10
3、添加开机自启动ntp服务
/etc/init.d/ntpd start
chkconfig ntpd on
echo "###start ntp server">>/etc/rc.local
echo "/etc/init.d/ntpd start" >>/etc/rc.local
二、配置时间同步客户机
1、修改ntp.conf配置文件
#配置前做好备份
cd /etc/
mv ntp.conf ntp.bak.conf
vi /etc/ntp.conf
22 #server 0.centos.pool.ntp.org iburst
23 #server 1.centos.pool.ntp.org iburst
24 #server 2.centos.pool.ntp.org iburst
25 #server 3.centos.pool.ntp.org iburst
26 server 172.16.1.61
2、添加定时任务crontab
###create cron by follow ntp server time at 2015-12-07
*/5 * * * * /usr/sbin/ntpdate 172.16.1.61 >/dev/null 2>&1
本文出自 “Linux高级运维之路” 博客,请务必保留此出处http://yulianhui.blog.51cto.com/10829691/1720560
相关文章推荐
- Android广播机制-Broadcast Receiver
- View的封装
- hdu2191 悼念512汶川大地震遇难同胞——珍惜现在,感恩生活 (多重背包)
- Remove Nth Node From End of List
- opencv SVM 训练行人检测器注意事项
- 对SQL授权的认识
- flask表单提交的两种方式
- HDU1069 Monkey and Banana 简单dp
- Python的lambda匿名函数
- 扩展欧几里德问题
- [LeetCode]018-4-Sum
- 随意细解:UI -- 初级数据持久化
- 新能源首页
- 内存管理pbuf.c源码解析——LwIP学习
- COCOS2D-3.9 Value接口分析
- 浅谈java.awt使用过程中遇到的问题
- HTTP Referer
- 【Android学习】真机获取SD卡遇到的问题
- 继续学习
- 51nod 1463:找朋友 线段树