2团
Published on 2024-08-16 / 10 Visits
0
0

openEuler启动ntp服务

1. 系统信息

当前主机安装的操作系统是openEuler 22.03版本。

[root@http-stress1 ~]# cat /etc/os-release 
NAME="openEuler"
VERSION="22.03 (LTS-SP1)"
ID="openEuler"
VERSION_ID="22.03"
PRETTY_NAME="openEuler 22.03 (LTS-SP1)"
ANSI_COLOR="0;31"

2. 启动ntp服务出错

[root@http-stress2 ~]# systemctl status ntp
Unit ntp.service could not be found.

3. 检查systemd服务列表

输入如下命令检查systemd是否存在ntp服务:

systemctl list-unit-files --type=service

image-mzdq.png

由上图可知,systemd提供了ntp服务,重启systemd服务:

systemctl daemon-reload

4. 启动ntp服务

操作如下所示:

[root@http-stress2 ~]# systemctl start ntpd
[root@http-stress2 ~]# 
[root@http-stress2 ~]# systemctl status ntpd
● ntpd.service - Network Time Service
     Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled; vendor preset: disabled)
     Active: active (running) since Mon 2023-09-18 10:21:02 CST; 4s ago
    Process: 24170 ExecStart=/usr/sbin/ntpd -u ntp:ntp $OPTIONS (code=exited, status=0/SUCCESS)
   Main PID: 24173 (ntpd)
      Tasks: 2 (limit: 50662)
     Memory: 1.7M
     CGroup: /system.slice/ntpd.service
             └─ 24173 /usr/sbin/ntpd -u ntp:ntp -g

Sep 18 10:21:02 http-stress2 ntpd[24173]: Listen and drop on 1 v4wildcard 0.0.0.0:123
Sep 18 10:21:02 http-stress2 ntpd[24173]: Listen normally on 2 lo 127.0.0.1:123
Sep 18 10:21:02 http-stress2 ntpd[24173]: Listen normally on 3 eth0 10.14.2.18:123
Sep 18 10:21:02 http-stress2 ntpd[24173]: Listen normally on 4 lo [::1]:123
Sep 18 10:21:02 http-stress2 ntpd[24173]: Listen normally on 5 eth0 [2409:8c20:1833:a359::1e]:123
Sep 18 10:21:02 http-stress2 ntpd[24173]: Listen normally on 6 eth0 [fe80::f816:3eff:fe10:7bae%2]:123
Sep 18 10:21:02 http-stress2 ntpd[24173]: Listening on routing socket on fd #23 for interface updates
Sep 18 10:21:02 http-stress2 ntpd[24173]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized
Sep 18 10:21:02 http-stress2 ntpd[24173]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized
Sep 18 10:21:02 http-stress2 systemd[1]: Started Network Time Service.


Comment