centos7 查看启动ntp服务命令

拼搏现实的明天。 2022-01-21 06:01 1429阅读 0赞

1. 查看ntp服务命令:

  1. [root@node1 ~]# systemctl status ntpd
  2. * ntpd.service - Network Time Service
  3. Loaded: loaded (/usr/lib/systemd/system/ntpd.service; disabled; vendor preset: disabled)
  4. Active: inactive (dead)

可以看到状态为:inactive,也就是没有启动ntp服务

2. 启动ntp服务命令:

  1. [root@node1 ~]# systemctl start ntpd

确认是否启动:

  1. [root@node1 ~]# systemctl status ntpd
  2. * ntpd.service - Network Time Service
  3. Loaded: loaded (/usr/lib/systemd/system/ntpd.service; disabled; vendor preset: disabled)
  4. Active: active (running) since 2017-10-16 17:12:05 CST; 2s ago
  5. Process: 8925 ExecStart=/usr/sbin/ntpd -u ntp:ntp $OPTIONS (code=exited, status=0/SUCCESS)
  6. Main PID: 8926 (ntpd)
  7. CGroup: /system.slice/ntpd.service
  8. `-8926 /usr/sbin/ntpd -u ntp:ntp -g
  9. 10月 16 17:12:05 node1 ntpd[8926]: ntp_io: estimated max descriptors: 1024,...16
  10. 10月 16 17:12:05 node1 ntpd[8926]: Listen and drop on 0 v4wildcard 0.0.0.0 ...23
  11. 10月 16 17:12:05 node1 ntpd[8926]: Listen and drop on 1 v6wildcard :: UDP 123
  12. 10月 16 17:12:05 node1 ntpd[8926]: Listen normally on 2 lo 127.0.0.1 UDP 123
  13. 10月 16 17:12:05 node1 ntpd[8926]: Listen normally on 3 ens33 192.168.197.1...23
  14. 10月 16 17:12:05 node1 ntpd[8926]: Listen normally on 4 lo ::1 UDP 123
  15. 10月 16 17:12:05 node1 ntpd[8926]: Listen normally on 5 ens33 fe80::522e:70...23
  16. 10月 16 17:12:05 node1 ntpd[8926]: Listening on routing socket on fd #22 fo...es
  17. 10月 16 17:12:05 node1 ntpd[8926]: 0.0.0.0 c016 06 restart
  18. 10月 16 17:12:05 node1 ntpd[8926]: 0.0.0.0 c012 02 freq_set kernel 14.727 PPM
  19. Hint: Some lines were ellipsized, use -l to show in full.

可以看到此时ntp状态为active,也就是成功启动了ntp服务

3. 设置开启自启动ntp服务:

  1. [root@node1 ~]# systemctl enable ntpd

发表评论

表情:
评论列表 (有 0 条评论,1429人围观)

还没有评论,来说两句吧...

相关阅读

    相关 centos 7 ntp

    程序员近来摊上个自动化运维的项目。 服务数量上,NTP客户端有两个,服务端只有一个。客户端分别是ntpd和ntpdate,服务端只有ntpd。 ntpd的配置文件/e

    相关 CentOS7中使用ntp服务同步时间

    简单记录使用ntp对centos7进行实践同步。 在安装fabric时,如果虚拟机之间实践差距太大就会导致异常,虽然可以使用命令直接修改时间,但考虑到后期维护还是选择使用nt

    相关 centos7 ntp时间同步

    一 应用场景 公司分配给你两台服务器,要求你使他们时间同步,有人问为什么要时间同步?如果一个集群中,时间相差很大,那么会出现很多诡异的问题,你也不想在一个无法解决的问题上浪费