服务器时间同步设置

服务器时钟同步:为确保系统的正常运行,需要所有服务器,与标准时间保持时钟同步。

范围:Oracle DB所在的服务器,Tomcat服务器。
设置方式——
Windows系统:控制面板-日期和时间-Internet时间,点选“自动与 Internet 时间服务器同步(S)”。
CentOS系统:
1)安装 ntpdate:#yum install ntp
2)实现定时同步
2.1)#crontab -e (打开文件)
2.2)在后面添加行:* */6 * * * /usr/sbin/ntpdate -u pool.ntp.org (使用命令crontab -u user -e命令编辑用户user的cron(c)作业。用户通过编辑文件来增加或修改任何作业请求。或者编辑/var/spool/cron/username
username这个文件直接放的是cron要执行的命令。 日志信息:/var/spool/mail/root)
2.3)保存退出


# 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
# | | | | |
# * * * * * user-name command to be executed



如果想要配置其他局域网机器同步某台具有外网权限机器时间时,该台外网权限机器需要开启ntp服务,并开机启动:
启动ntp服务器

[code="java"] # /etc/init.d/ntpd start 启动

Starting ntpd: [ OK ]

# chkconfig ntpd on 设置开机自启动ntpd服务[/code]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值