[关闭]
@dyj2017 2017-10-30T10:45:00.000000Z 字数 1418 阅读 1181

centos7 查看启动ntp服务命令

centos7


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
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注