linux 校准时间
2016-07-23 17:31
811 查看
最近在做一个项目,发现本地测试数据的之间一直是正确的,但是线上的测试数据时间总是出问题。排除代码问题,那么可能是服务器时间不准确
查看时间后发现果然时间有问题
在运行上述指令的过程中,发现总是有下述错误
一番折腾后,发现是防火墙问题
date
查看时间后发现果然时间有问题
yum install ntp #安装ntpdate ntpdate cn.pool.ntp.org
在运行上述指令的过程中,发现总是有下述错误
[root@xxx]# ntpdate cn.pool.ntp.org 23 Jul 08:30:52 ntpdate[1548]: sendto(time6.aliyun.com): Operation not permitted 23 Jul 08:30:52 ntpdate[1548]: sendto(ntp-sz.chl.la): Operation not permitted 23 Jul 08:30:52 ntpdate[1548]: sendto(dns1.synet.edu.cn): Operation not permitted 23 Jul 08:30:53 ntpdate[1548]: sendto(time6.aliyun.com): Operation not permitted 23 Jul 08:30:53 ntpdate[1548]: sendto(ntp-sz.chl.la): Operation not permitted 23 Jul 08:30:53 ntpdate[1548]: sendto(dns1.synet.edu.cn): Operation not permitted 23 Jul 08:30:54 ntpdate[1548]: sendto(time6.aliyun.com): Operation not permitted 23 Jul 08:30:54 ntpdate[1548]: sendto(ntp-sz.chl.la): Operation not permitted 23 Jul 08:30:54 ntpdate[1548]: sendto(dns1.synet.edu.cn): Operation not permitted 23 Jul 08:30:55 ntpdate[1548]: sendto(time6.aliyun.com): Operation not permitted 23 Jul 08:30:55 ntpdate[1548]: sendto(ntp-sz.chl.la): Operation not permitted 23 Jul 08:30:55 ntpdate[1548]: sendto(dns1.synet.edu.cn): Operation not permitted 23 Jul 08:30:56 ntpdate[1548]: no server suitable for synchronization found
一番折腾后,发现是防火墙问题
service iptables stop # 关闭防火墙 ntpdate cn.pool.ntp.org # 同步时间 service iptables start # 开启防火墙
相关文章推荐
- Linux socket 初步
- Linux Kernel 4.0 RC5 发布!
- linux lsof详解
- linux 文件权限
- Linux 执行数学运算
- 10 篇对初学者和专家都有用的 Linux 命令教程
- SUSE 11 & RedHat 6.1 & HP-UX B.11.31 NTP时间同步服务实施案例集锦
- Linux 与 Windows 对UNICODE 的处理方式
- Ubuntu12.04下QQ完美走起啊!走起啊!有木有啊!
- 解決Linux下Android开发真机调试设备不被识别问题
- 运维入门
- 运维提升
- Linux 自检和 SystemTap
- Ubuntu Linux使用体验
- c语言实现hashmap(转载)
- Linux 信号signal处理机制
- linux下mysql添加用户
- Scientific Linux 5.5 图形安装教程