将本地Debian时间与amazon Debian实例(RDS)MDT同步到UTC [英] synchronize local Debian time with amazon Debian instances (RDS) MDT to UTC
本文介绍了将本地Debian时间与amazon Debian实例(RDS)MDT同步到UTC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
它在我的亚马逊Debian实例上尝试此命令
root @ ip-:〜#date
Sun Apr 27 11:26:34 UTC 2014
在我本地的debain实例中,它像这样
root @ debian:〜#date
Sun Apr 27 16:56:56 MDT 2014
所以现在我如何让我的本地debain机器时间与亚马逊实例时间一样
ie
转换
Sun Apr 27 16:56 :56 MDT 2014 - >(to)Sun Apr 27 11:26:34 UTC 2014这个
在我当地的debain machinee
解决方案
有两个问题涉及到时差:
- 时区 - 您的本地Debian系统随当地时区一起运行,而EC2实例正在运行,协调世界时(UTC)。后者几乎是规范,服务器的最佳做法,您可以通过
sudo dpkg-reconfigure tzdata
调整您的本地系统(请参阅Ynhockey的答案如何在Debian中永久重置时区?)。 - 精准度 - 您的一个或两个系统展示对UTC有显着的时钟偏差(两次都应该相同地减去时区偏移量)。通过将网络时间协议(NTP)后台驻留程序安装到自动设置时间,如Debian的 DateTime ,它归结为
sudo apt-get install ntp
并编辑/etc/ntp.conf
以更好地定位本地NTP服务器源,以获得最佳效果。
it tried this command on my amazon Debian instances
root@ip-:~# date
Sun Apr 27 11:26:34 UTC 2014
and in my local debain instances its like this
root@debian:~# date
Sun Apr 27 16:56:56 MDT 2014
so now how can i make my local debain machine time as same as the amazon instance time
i.e
convert
Sun Apr 27 16:56:56 MDT 2014 ->(to) Sun Apr 27 11:26:34 UTC 2014 this
in my local debain machinee
解决方案
There are two issues concerning the time difference at hand:
- Timezone - your local Debian system is running with your local timezone, whereas the EC2 instance is running with Coordinated Universal Time (UTC). The latter is pretty much the norm and resp. best practice for servers, you can adjust your local system via
sudo dpkg-reconfigure tzdata
(see Ynhockey's answer to How do I permanently reset the time zone in Debian?). - Precision - either one or both of your systems exhibit significant clock skew against UTC (both times should be identically after subtracting the timezone offset). This is easily remedied by installing a Network Time Protocol (NTP) daemon to Set the time automatically as explained in Debian's DateTime, which boils down to
sudo apt-get install ntp
and editing/etc/ntp.conf
to target more local NTP server sources for optimal results.
这篇关于将本地Debian时间与amazon Debian实例(RDS)MDT同步到UTC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文