网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。
一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!
server ntp.aliyun.com
腾讯
server time1.cloud.tencent.com
server time2.cloud.tencent.com
server time3.cloud.tencent.com
server time4.cloud.tencent.com
server time5.cloud.tencent.com
苹果
server time.asia.apple.com
微软
server time.windows.com
其他
server cn.ntp.org.cn
Record the rate at which the system clock gains/losses time.
driftfile /var/lib/chrony/drift
Allow the system clock to be stepped in the first three updates
if its offset is larger than 1 second.
makestep 1.0 3
Enable kernel synchronization of the real-time clock (RTC).
rtcsync
Enable hardware timestamping on all interfaces that support it.
#hwtimestamp *
Increase the minimum number of selectable sources required to adjust
the system clock.
#minsources 2
Allow NTP client access from local network.
#allow 192.168.0.0/16
Serve time even if not synchronized to a time source.
#local stratum 10
Specify file containing keys for NTP authentication.
#keyfile /etc/chrony.keys
Specify directory for log files.
logdir /var/log/chrony
Select which information is logged.
#log measurements statistics tracking
启动服务及时区设置
启动服务
$ systemctl start chronyd
开机启动
$ systemctl enable chronyd
查看当前状态
$ systemctl status chronyd
查看亚洲时区
$ timedatectl list-timezones | grep Asia
设置时区
$ timedatectl set-timezone Asia/Shanghai
![在这里插入图片描述](https://img-blog.csdnimg.cn/20210604115450343.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQwOTA3OTc3,size_16,color_FFFFFF,t_70)
验证服务
查看现有的时间服务器
$ chronyc sources -v
查看时间服务器状态
$ chronyc sourcestats -v
显示时钟同步相关参数
$ chronyc tracking
查看当前时区及时间
$ timedatectl
![在这里插入图片描述](https://img-blog.csdnimg.cn/20210604115522224.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQwOTA3OTc3,size_16,color_FFFFFF,t_70)
![在这里插入图片描述](https://img-blog.csdnimg.cn/20210604115543743.png)
手动同步时间
使用 ntpdate 同步时间
$ ntpdate ntp.aliyun.com
chronyd 未启动时,如下命令同步时间
$ chronyd -q ‘server pool.ntp.org iburst’
chronyd 启动时,使用如下命令同步时间
$ chronyc -a ‘burst 4/4’ && sleep 10 && chronyc -a makestep
![在这里插入图片描述](https://img-blog.csdnimg.cn/20210604115705581.png)
手动设置时间
date 设置时间
$ date -s ‘2021-06-03 19:00:00’
关闭 ntp 同步后,才可以使用 timedatectl 进行时间设置
$ timedatectl set-ntp false
设置日期和时间
$ timedatectl set-time ‘2021-06-03 19:00:00’
设置日期
$ timedatectl set-time ‘2021-06-03’
设置时间
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上软件测试知识点,真正体系化!
由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新
化!**
由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新