Linux下集群时间同步
来源:互联网 发布:淘宝翻墙代理 编辑:程序博客网 时间:2024/05/22 12:53
date命令:
date :查看当前时间,结果如下:Tue Mar 4 01:36:45 CST 2014
date -s 09:38:40 :设置当前时间,结果如下:Tue Mar 4 09:38:40 CST 2014
ntpdate命令:
ntpdate -u 210.72.145.44 :网络时间同步命令
注意:若不加上-u参数, 会出现以下提示:no server suitable for synchronization found
-u:从man ntpdate中可以看出-u参数可以越过防火墙与主机同步;
210.72.145.44:中国国家授时中心的官方服务器。
ntp常用服务器:
中国国家授时中心:210.72.145.44
NTP服务器(上海) :ntp.api.bz
美国:time.nist.gov
复旦:ntp.fudan.edu.cn
微软公司授时主机(美国) :time.windows.com
台警大授时中心(台湾):asia.pool.ntp.org
复旦:ntp.fudan.edu.cn
微软公司授时主机(美国) :time.windows.com
台警大授时中心(台湾):asia.pool.ntp.org
经测试中国国家授时中心与NTP上海服务器可以正常同步时间,注意需要加上-u参数!
实现Internet时间同步
设定计划任务
crontab格式如下:
# For details see man 4 crontabs
crontab格式如下:
# For details see man 4 crontabs
# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * command to be executed
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * command to be executed
设定crontab计划任务也有两种方式:
1、写在/etc/crontab里
代码:
00 11 * * * root ntpdate 210.72.145.44
每天11点与中国国家授时中心同步时间
每天11点与中国国家授时中心同步时间
当然前提是
yum install ntpdate
代码:
00 11 * * * root ntpdate 210.72.145.44
每天11点与中国国家授时中心同步时间
每天11点与中国国家授时中心同步时间
当然前提是
yum install ntpdate
代码也可是
00 11 * * * root ntpdate us.pool.ntp.org
00 11 * * * root ntpdate us.pool.ntp.org
0 0
- Linux下集群时间同步
- linux集群时间同步
- Linux集群时间同步
- linux集群时间同步
- linux集群时间同步
- linux集群时间同步
- linux集群时间同步
- hadoop在linux系统下的集群时间同步
- Hadoop在linux系统下的集群时间同步
- linux集群时间同步搭建
- Linux集群时间同步设置
- linux集群服务器时间同步
- Linux下时间同步
- linux hadoop本地集群时间同步
- linux集群时间同步,ntpd、ntpdate
- Linux下ntpdate时间同步
- Linux下局域网同步时间
- Linux下ntpdate时间同步
- ROS探索总结(四)(五)(六)——简单的机器人仿真 创建简单的机器人模型smartcar 使用smartcar进行仿真
- linux基础
- 在Fedora22中安装OpenCV3.0.0
- css3,scss和sass
- Android技术积累:开发规范
- Linux下集群时间同步
- Java 读取扫描枪
- 解决移动端点击链接触发颜色块的问题
- 数据库视图和表的区别
- UVA-558 Wormholes(Floyd)
- java 统计代码行数
- LeetCode 74. Search a 2D Matrix
- Vs2012 一直“正在更新 IntelliSense”
- LightOj1303