linux时间同步服务(chronyd服务)

网友投稿 714 2022-10-16

linux时间同步服务(chronyd服务)

linux时间同步服务(chronyd服务)

配置chrony服务

集群中节点之间需要时间同步,不依赖外部的时间服务NTP,在内部搭建时间服务器。首先保证所有节点都安装了chrony,命令如下:​​yum install chrony -y​​​。 在提供时间同步服务的服务端节点做如下操作:

vim /etc/chrony.conf22 allow 192.168.211.131 ##允许哪些客户端来同步主机的时间29 local stratum 10 ##本机不同步任何主机时间,本机作为时间源systemctl restart chronyd.service ##重启配置文件

在需要同步服务的客户端节点做如下操作:

vim /etc/chrony.conf3 server 192.168.211.132 iburst ##本机同步192.168.211.132主机的时间systemctl restart chronyd.service ##重启配置文件

测试:在客户端节点执行​​chronyc sources -v​​

一些系统时间设定的命令

date ##可用man date 学习date命令NAMEdate - print or set the system date and timeSYNOPSISdate [OPTION]… [+FORMAT]date [-u|–utc|–universal] [MMDDhhmm[[CC]YY][.ss]]DESCRIPTIONDisplay the current time in the given FORMAT, or set the system date.Mandatory arguments to long options are mandatory for

#查看当前日期的x天前或者x天后的时间

1.从1970年1月1日 00:00:00 到目前为止经历的秒数

2.12 PM/AM

3.一年中的第几周

timedatectl status ##显示系统时间timedatectl set-timezone Asia/Shanghai ##更改当前时区为东八区timedatectl set-time “2012-10-30 18:17:16” ##设定系统时间timedatectl set-local-rtc 0 ##设定是否使用UTC时间

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:Nett分布式分隔符解码器逻辑源码剖析
下一篇:MR4C- C++ 的 MapReduce​ 框架
相关文章

 发表评论

暂时没有评论,来抢沙发吧~