๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
Linux (Cent OS)

[Linux CentOS 7 ] NTP ์„ค์ • ๋ฐฉ๋ฒ•

by Ji-Hoon 2022. 8. 6.

NTP ์„ค์ • ๋งค๋‰ด์–ผ ( CentOS Linux release 7.9 )

 

NTP ์„œ๋น„์Šค ํ™œ์„ฑํ™” ์—ฌ๋ถ€ ํ™•์ธ ๋ฐฉ๋ฒ•

- systemctl status ntpd.service

- ํ˜„์žฌ ์„œ๋ฒ„์— NTP ์„œ๋น„์Šค๊ฐ€ ํ™œ์„ฑํ™”๋˜์–ด ์žˆ๋Š”์ง€ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค

[root@localhost ~]# systemctl status ntpd.service
โ— ntpd.service - Network Time Service
   Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled; vendor preset: disabled)
   Active: inactive (dead)

 

NTP ์„œ๋น„์Šค Config ์„ค์ • ๋ฐฉ๋ฒ•

-  /etc/ntp.conf  ํŒŒ์ผ ํ™•์ธ

- ์‚ฌ์šฉํ•  NTP ์„œ๋ฒ„ ์ถ”๊ฐ€

- ์ธํ„ฐ๋„ท ๊ฒ€์ƒ‰ํ•˜๋‹ˆ ๋Œ€๋ถ€๋ถ„ time.bora.net / time.konet.net ์„œ๋ฒ„๋ฅผ ๋“ฑ๋กํ•ด์„œ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ์–ด ๋‘ ๊ฐœ ์ฃผ์†Œ ์ถ”๊ฐ€

# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst

server time.bora.net
server time.konet.net

#broadcast 192.168.1.255 autokey        # broadcast server
#broadcastclient                        # broadcast client
#broadcast 224.0.1.1 autokey            # multicast server
#multicastclient 224.0.1.1              # multicast client
#manycastserver 239.255.254.254         # manycast server
#manycastclient 239.255.254.254 autokey # manycast client

# Enable public key cryptography.
#crypto

includefile /etc/ntp/crypto/pw

# Key file containing the keys and key identifiers used when operating
# with symmetric key cryptography.

 

NTP ์„œ๋น„์Šค ์‹œ์ž‘, ํ™•์ธ ๋ฐฉ๋ฒ•

-  ntp.conf ํŒŒ์ผ์— ntp ์„œ๋น„์Šค์— ์‚ฌ์šฉํ•  ์„œ๋ฒ„๋ฅผ ์ถ”๊ฐ€ ํ–ˆ์œผ๋ฉด ์•„๋ž˜ ๋ช…๋ น์–ด๋กœ ์„œ๋น„์Šค ์‹œ์ž‘!

-  systemctl start ntpd.service ( ์„œ๋น„์Šค ์‹œ์ž‘ )

systemctl status ntpd.service ( ์„œ๋น„์Šค ์ƒํƒœ ํ™•์ธ )

-  Active : active ๋กœ ํ‘œ์‹œ๋œ๋‹ค๋ฉด ํ˜„์žฌ NTP ์„œ๋น„์Šค๊ฐ€ ํ™œ์„ฑํ™”๋œ ์ƒํƒœ

[root@localhost ~]# systemctl start ntpd.service
[root@localhost ~]# systemctl status ntpd.service
โ— ntpd.service - Network Time Service
   Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2022-05-23 20:46:56 EDT; 3s ago
  Process: 4159 ExecStart=/usr/sbin/ntpd -u ntp:ntp $OPTIONS (code=exited, status=0/SUCCESS)
 Main PID: 4160 (ntpd)
    Tasks: 1
   CGroup: /system.slice/ntpd.service
           โ””โ”€4160 /usr/sbin/ntpd -u ntp:ntp -g

May 23 20:46:56 localhost.localdomain ntpd[4160]: Listen and drop on 0 v4wildcard 0.0.0.0 UDP 123
May 23 20:46:56 localhost.localdomain ntpd[4160]: Listen and drop on 1 v6wildcard :: UDP 123
May 23 20:46:56 localhost.localdomain ntpd[4160]: Listen normally on 2 lo 127.0.0.1 UDP 123
May 23 20:46:56 localhost.localdomain ntpd[4160]: Listen normally on 3 ens33 192.168.32.129 UDP 123
May 23 20:46:56 localhost.localdomain ntpd[4160]: Listen normally on 4 virbr0 192.168.122.1 UDP 123
May 23 20:46:56 localhost.localdomain ntpd[4160]: Listen normally on 5 ens33 fe80::ba71:6fed:e48d:4a90 UDP 123
May 23 20:46:56 localhost.localdomain ntpd[4160]: Listen normally on 6 lo ::1 UDP 123
May 23 20:46:56 localhost.localdomain ntpd[4160]: Listening on routing socket on fd #23 for interface updates
May 23 20:46:56 localhost.localdomain ntpd[4160]: 0.0.0.0 c016 06 restart
May 23 20:46:56 localhost.localdomain ntpd[4160]: 0.0.0.0 c012 02 freq_set kernel -11.582 PPM

NTP ์„œ๋น„์Šค์— ์—ฐ๊ฒฐ๋œ ์„œ๋ฒ„ ์ •๋ณด ๋ฐ ์—ฐ๋™ ์ƒํƒœ ํ™•์ธ ๋ฐฉ๋ฒ•

-  ntpq -p

-  ๋™๊ธฐํ™” ์„ฑ๊ณต ์‹œ ์„œ๋ฒ„ ๋ช… ์•ž์— * ์ด ํ‘œ์‹œ ๋œ๋‹ค

[root@localhost etc]# ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*time.bora.net   90.1.14.51       2 u   32   64    3   15.268  -31.360   7.743
 216.120.146.201 .INIT.          16 u    -  512    0    0.000    0.000   0.000

 

'Linux (Cent OS)' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

[Cent OS 7] My SQL ์„ค์น˜ํ•˜๊ธฐ  (0) 2023.01.15
[๋ฆฌ๋ˆ…์Šค] ํŒŒ์ผ ์‚ญ์ œ ๋ช…๋ น์–ด  (0) 2022.05.03

๋Œ“๊ธ€