1.时区同步
centOS6:
cat /etc/sysconfig/clock #查看修改时区
centOS7:
timedatectl # 查看系统时间方面的各种状态
timedatectl list-timezones # 列出所有时区
#设置系统时区 CentOS7
timedatectl set-timezone Asia/Shanghai
2.分布式集群时间同步
ntpd服务
通过命令是外网时间同步:
ntpdate -u 时间服务器ip
ntpdate -u 120.25.108.11
ntp常用服务器:(time.pool.aliyun.com)可用:http://www.ntp.org.cn/pool.ph
2.1centOS7 时间服务器与外网时间同步
将集群中某个主机设定为时间服务器
查看ntpd.service是否开机自启动:
systemctl list-unit-files --type=service | grep ntpd
systemctl enable ntpd.service
开启ntpd服务