本文介绍了亚马逊Debian的实例(RDS)MDT为UTC同步本地Debian的时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
它试图在我的亚马逊Debian的情况下,此命令
it tried this command on my amazon Debian instances
root@ip-:~# date
Sun Apr 27 11:26:34 UTC 2014
和我在当地的Debain情况下,它是这样
and in my local debain instances its like this
root@debian:~# date
Sun Apr 27 16:56:56 MDT 2014
所以现在我怎样才能让我的本地的Debain机时间相同亚马逊实例时间
so now how can i make my local debain machine time as same as the amazon instance time
即
转换
Sun Apr 27 16:56:56 MDT 2014 ->(to) Sun Apr 27 11:26:34 UTC 2014 this
在我的本地的Debain machinee
in my local debain machinee
推荐答案
有两个关于手头上的时间差问题:
There are two issues concerning the time difference at hand:
- 时区 - 本地Debian系统与本地时区运行,而EC2实例与的。后者是pretty的许多规范和RESP。用于服务器的最佳实践,您可以通过
须藤的dpkg-重新配置的tzdata code>(见Ynhockey的回答的)。
- precision - 一方或双方你的系统表现出对UTC显著时钟偏移(减去时区偏移后两次都应该是相同的)。这是很容易通过安装网络时间协议(NTP)守护进程的的作为Debian的的,这可以归结为
命令和apt-get安装NTP
和编辑/etc/ntp.conf中
目标更本地NTP服务器源,获取最佳的效果。
- 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的实例(RDS)MDT为UTC同步本地Debian的时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!