DBILITY

linux time sync ntp install ( 시간 동기화 ntp 설치 ) 본문

os/linux

linux time sync ntp install ( 시간 동기화 ntp 설치 )

DBILITY 2018. 5. 5. 17:47
반응형

cluster 내 서버 간의 시간이 달라지면 곤란(?)하니 동기화가 필요하다.

즉시 동기화는 rdate를 쓰자. rdate -s time.bora.net

 

[root@big-slave1 ~]# yum -y install ntp
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.neowiz.com
 * epel: ftp.riken.jp
 * extras: mirror.kakao.com
 * updates: mirror.kakao.com
Resolving Dependencies
--> Running transaction check
---> Package ntp.x86_64 0:4.2.6p5-25.el7.centos.2 will be installed
--> Processing Dependency: ntpdate = 4.2.6p5-25.el7.centos.2 for package: ntp-4.2.6p5-25.el7.centos.2.x86_64
--> Processing Dependency: libopts.so.25()(64bit) for package: ntp-4.2.6p5-25.el7.centos.2.x86_64
--> Running transaction check
---> Package autogen-libopts.x86_64 0:5.18-5.el7 will be installed
---> Package ntpdate.x86_64 0:4.2.6p5-25.el7.centos.2 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================
 Package                       Arch                 Version                               Repository          Size
===================================================================================================================
Installing:
 ntp                           x86_64               4.2.6p5-25.el7.centos.2               base               547 k
Installing for dependencies:
 autogen-libopts               x86_64               5.18-5.el7                            base                66 k
 ntpdate                       x86_64               4.2.6p5-25.el7.centos.2               base                86 k

Transaction Summary
===================================================================================================================
Install  1 Package (+2 Dependent packages)

Total download size: 699 k
Installed size: 1.6 M
Downloading packages:
(1/3): autogen-libopts-5.18-5.el7.x86_64.rpm                                                |  66 kB  00:00:00
(2/3): ntpdate-4.2.6p5-25.el7.centos.2.x86_64.rpm                                           |  86 kB  00:00:00
(3/3): ntp-4.2.6p5-25.el7.centos.2.x86_64.rpm                                               | 547 kB  00:00:00
-------------------------------------------------------------------------------------------------------------------
Total                                                                              1.8 MB/s | 699 kB  00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : autogen-libopts-5.18-5.el7.x86_64                                                               1/3
  Installing : ntpdate-4.2.6p5-25.el7.centos.2.x86_64                                                          2/3
  Installing : ntp-4.2.6p5-25.el7.centos.2.x86_64                                                              3/3
  Verifying  : ntp-4.2.6p5-25.el7.centos.2.x86_64                                                              1/3
  Verifying  : ntpdate-4.2.6p5-25.el7.centos.2.x86_64                                                          2/3
  Verifying  : autogen-libopts-5.18-5.el7.x86_64                                                               3/3

Installed:
  ntp.x86_64 0:4.2.6p5-25.el7.centos.2

Dependency Installed:
  autogen-libopts.x86_64 0:5.18-5.el7                   ntpdate.x86_64 0:4.2.6p5-25.el7.centos.2

Complete!
[root@big-slave1 ~]# vi /etc/ntp.conf
#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 0.asia.pool.ntp.org
server 1.asia.pool.ntp.org
server 2.asia.pool.ntp.org
server 3.asia.pool.ntp.org
:wq!
[root@big-slave1 ~]# systemctl status ntpd
● ntpd.service - Network Time Service
   Loaded: loaded (/usr/lib/systemd/system/ntpd.service; disabled; vendor preset: disabled)
   Active: inactive (dead)
[root@big-slave1 ~]# systemctl enable ntpd
[root@big-slave1 ~]# systemctl start ntpd
[root@big-slave1 ~]# systemctl status ntpd
● ntpd.service - Network Time Service
   Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled; vendor preset: disabled)
   Active: active (running) since Sat 2018-05-05 17:52:10 KST; 1s ago
  Process: 26004 ExecStart=/usr/sbin/ntpd -u ntp:ntp $OPTIONS (code=exited, status=0/SUCCESS)
 Main PID: 26005 (ntpd)
   CGroup: /system.slice/ntpd.service
           └─26005 /usr/sbin/ntpd -u ntp:ntp -g

May 05 17:52:09 big-slave1 ntpd[26005]: restrict: error in address '::1' on line 15. Ignoring...
May 05 17:52:09 big-slave1 ntpd[26005]: ntp_io: estimated max descriptors: 1024, initial socket boundary: 16
May 05 17:52:09 big-slave1 ntpd[26005]: Listen and drop on 0 v4wildcard 0.0.0.0 UDP 123
May 05 17:52:09 big-slave1 ntpd[26005]: Listen normally on 1 lo 127.0.0.1 UDP 123
May 05 17:52:09 big-slave1 ntpd[26005]: Listen normally on 2 eno16777728 192.168.100.181 UDP 123
May 05 17:52:09 big-slave1 ntpd[26005]: Listening on routing socket on fd #19 for interface updates
May 05 17:52:10 big-slave1 systemd[1]: Started Network Time Service.
May 05 17:52:10 big-slave1 ntpd[26005]: 0.0.0.0 c016 06 restart
May 05 17:52:10 big-slave1 ntpd[26005]: 0.0.0.0 c012 02 freq_set kernel 0.000 PPM
May 05 17:52:10 big-slave1 ntpd[26005]: 0.0.0.0 c011 01 freq_not_set

[root@big-slave1 ~]# ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 masao.paina.net 131.113.192.40   2 u   51   64    1   95.161  2712.11   0.000
 time2.isu.net.s 209.51.161.238   2 u   50   64    1  353.658  2715.32   0.000
 x.ns.gin.ntt.ne 249.224.99.213   2 u   50   64    1   57.094  2701.97   0.000
 dadns.cdnetwork 204.123.2.5      2 u   49   64    1    6.859  2710.16   0.000
[root@big-slave1 ~]#

 

반응형

'os > linux' 카테고리의 다른 글

centos 7 rabbitmq 설치  (0) 2018.10.19
lvm 확장 후 fs 적용  (0) 2018.05.13
centos 7 systemd 서비스 작성  (0) 2018.04.20
linux java 설치  (0) 2018.04.17
linux swap file 추가하기  (0) 2018.04.14
Comments