ntpdate[6043]: Can't find host –d: Name or service not known (-2)
来源:互联网 发布:王尼玛有没有开淘宝店 编辑:程序博客网 时间:2024/05/16 08:14
针对这一问题,可能与服务器配置有关,可通过同步pool.ntp.org时间使得集群时间得到同步,无秒级时间差。
date --set 101010(年月日【不用输入时分秒,下面的代码可同步】)ntpdate pool.ntp.org
ps:The pool.ntp.org project is a big virtual cluster of timeservers providing reliable easy to use NTP service for millions of clients.
The pool is being used by millions or tens of millions of systems around the world. It's the default "time server" for most of the major Linux distributions and many networked appliances (see information for vendors).
修改linux系统的时间CST与EDT
CST:Central Standard TimeCST:中部标准时间
同时代表了下面4个时区:
CST Central Standard Time (USA) UT-6:00
CST Central Standard Time (Australia) UT 9:30
CST China Standard Time UT 8:00
CST Cuba Standard Time UT-4:00
EDT:Eastem Daily Time北美东部时间
2017年 06月 30日 星期五 20:08:29 CST
[root@test ~]# mv /etc/localtime /etc/localtime.bak
[root@test ~]# ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
[root@test ~]# date
修改后的时间:
2017年 06月 30日 星期五 12:31:32 UTC
修改命令:tzselect
保存:hwclock -w
=================================================保存:hwclock -w
系统时间变化原因分析
Linux的时间有两种,一是系统时间,另外是硬件时间(BIOS时间)。
系统每次启动时会读出BIOS时间,将之赋给系统时间。之后系统时间将独立运行,而BIOS时间不会变化。
在BIOS时间中,有两种表示形式。一种是以localtime表示的,一种是以UTC表示的。具体查看的方式可以通过hwclock –debug,该命令可以输出当前硬件时间的表示形式。
下面例举各种情况下系统时间的变化:
1.当hwclock设定为localtime,/etc/sysconf/clock 中的 UTC=true时,重启后系统时间后相对于BIOS时间被提前8个小时。
2.当hwclock设定为localtime,/etc/sysconf/clock中的 UTC=false时,重启后系统时间相对于BIOS时间没有变化
3.当hwclock设定为UTC,/etc/sysconf/clock 中的 UTC=true时,重启后系统时间后相对于BIOS时间无变化
4.当hwclock设定为UTC,/etc/sysconf/clock 中的 UTC=false时,重启后系统时间后相对于BIOS时间被推后8个小时。
如下图所示:
/etc/sysconf/clock中UTC=true
/etc/sysconf/clock中UTC=false
硬件时间 localtime
重启后系统时间后相对于BIOS时间被提前8个小时
系统时间无变化
硬件时间 UTC
系统时间无变化
重启后系统时间后相对于BIOS时间被推后8个小时
可见,当BIOS时间设置的类型和 /etc/sysconf/clock中的设置不一致时,就会导致系统启动时的系统时间错误。
如果有脚本实现时间同步,但是系统启动之后运行的。虽然时间同步可以将系统时间同步到正确时间,但是由于之前的系统时间错误设定,将会出现一个错误的时间间隔,这个时间间隔可能会对依赖系统时间的程序产生影响。
对策:出现这种问题的根本原因是硬件时间的类型和 /etc/sysconf/clock中的设置不一致。所以我们将在时间同步脚本中增加对硬件时间的同步,这样可以解决这种问题。
注:
UTC时间:世界协调时间(Universal Time Coordinated,UTC) ,也就是0时区的时间
阅读全文
0 0
- ntpdate[6043]: Can't find host –d: Name or service not known (-2)
- Name or service not known
- could not translate host name “localhost”, service “5432″ to address: Name or service not known
- )Name or service not known: mod_unique_id: unable to find IPv4 addr ess of "wb_three_cgi20"
- apache启动失败:Name or service not known: mod_unique_id: unable to find IPv4 address of "narkii"
- Unable to resolve address ' ' service ' ': Name or service not known
- Unable to resolve address ' ' service ' ': Name or service not known
- Could not resolve hostname 。。。。。。: Name or service not known
- apache启动失败 Name or service not known: mod_unique_id
- apache启动失败 Name or service not known: mod_unique_id
- telnet报错:Name or service not known: Illegal seek
- Hadoop搭建,找不到主机问题 : Name or service not known
- 关于Warn:name or service not known的解决办法
- java.net.UnknownHostException: XXXX Name or service not known
- java.net.UnknownHostException: host01: host01: Name or service not known
- linux ping报错Name or service not known
- java.net.UnknownHostException: XXX: XXX: Name or service not known
- urllib2.URLError: <urlopen error [Errno -2] Name or service not known>
- CSDN博客积分规则
- python基础教程---更加抽象,类,继承多态封装
- C++ 分割字符串的问题不少啊
- C语言小函数——删除字符串str1中含有的字符串str2
- 构造一个函数能将border-bottom-color用函数转成驼峰命名法,就是变成:borderBottomColor输出
- ntpdate[6043]: Can't find host –d: Name or service not known (-2)
- pip安装tensorflow出错怎么办
- ThreadLocal模式
- win10使用keytool将localhostapp.pem证书导入到cacerts中
- 将border-bottom-color用函数转成驼峰命名法
- 织梦dedecms调用随机文章并定时自动更新转子
- Jenkins插件编写入门
- .9图片不能使用问题(Android开发)
- js时钟程序