timedatectl可以查看当前服务器的时区设置输出如下:
Local time: 一 2016-09-26 02:46:23 UTC
Universal time: 一 2016-09-26 02:46:23 UTC
RTC time: 一 2016-09-26 02:46:23
Time zone: UTC (UTC, +0000)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: n/a
可以使用timedatectl list-timezone将时区列出来
使用timedatectl set-timezone “”设置时区
开启ntp:timedatectl set-ntp yes
时间设置:
How do I install and configure NTP under CentOS Linux version 5.x or 6.x server to synchronize the system clock?
You can easily install NTP (Network Time Protocol, a means of transmitting time signals over a computer network) using the yum command under Red Hat or CentOS/Fedora Linux server or workstation based systems. You need to install the following packages:
- ntp : ntpd server which continuously adjusts system time and utilities used to query and configure the ntpd daemon.
- ntpdate : Utility to set the date and time via NTP.
- ntp-doc : NTP documentation
Procedure: Setup NTPD on CentOS Linux
Open the terminal or login over the ssh session. You must login as as the root user. Type the following yum command to install ntp# yum install ntp ntpdate ntp-doc
Turn on service, enter:# chkconfig ntpd on
Synchronize the system clock with 0.pool.ntp.org server (use this command only once or as required):# ntpdate pool.ntp.org
Start the NTP server. The following will continuously adjusts system time from upstream NTP server. No need to run ntpdate:# /etc/init.d/ntpd start
Configure ntpd (optional)
Edit /etc/ntp.conf, enter:# vi /etc/ntp.conf
Set public servers from the pool.ntp.org project:
server 0.rhel.pool.ntp.org
server 1.rhel.pool.ntp.org
server 2.rhel.pool.ntp.org
自从有了女票~保持不了更新频率了呢
转载请注明来源链接 http://just4fun.im/2016/09/26/centos7-e6-97-b6-e5-8c-ba-e8-ae-be-e7-bd-ae/ 尊重知识,谢谢:)