• <rt id="uxhzh"></rt>
    1. 您好,歡迎進入北京泰福特電子科技有限公司官網

      咨詢服務熱線

      400-015-1230

      11G RAC 配置NTP服務器

      發布時間:2022-04-12 10:28:51

      tip01的IP:162.20.1.228  NTP服務端  

      tip02的IP:162.20.1.229  NTP客戶端

      配置NTP服務器之前,確認服務器已裝好NTP包  

      [root@tip01 ~]# rpm -qa  | grep ntp  

      ntp-4.2.2p1-9.el5_4.1  

      chkfontpath-1.10.1-1.1  

      然后再把服務器的系統時鐘與硬件時間同步一下  

      先查看下系統  

      [root@tip01 ~]# date  

      2012年05月20日 星期日 22:07:01 CST  

      查看硬件時鐘  

      [root@tip01 ~]# hwclock  

      2012年05月20日 星期日 13時33分46秒  -0.415712 seconds  

      這里,系統時鐘與硬件時鐘不同步,我們通過以下命令來把硬件時鐘與系統時鐘同步  

      [root@tip01 ~]# clock --systohc  

      在查看下系統時鐘與硬件時鐘,已經同步了    

      [root@tip01 ~]# date  

      2012年 05月20日 星期日 22:08:07 CST  

      [root@tip01 ~]# hwclock  

      2012年 05月20日 星期日 22時08分12秒  -

      0.154372 seconds  

      [root@tip01 ~]#  

      ---------------------

      編輯tip01節點的配置文件  

      # vi /etc/ntp.conf  

      restrict default kod nomodify notrap nopeer noquery  

      restrict -6 default kod nomodify notrap nopeer noquery  

      restrict 127.0.0.1  

      restrict -6 ::1  

      server  162.20.1.228   #  

      server  127.127.1.0    

      #local clock  

      fudge  127.127.1.0 stratum 10  

      driftfile /var/lib/ntp/drift  

      keys /etc/ntp/keys  

      restrict 162.20.1.228  mask 255.255.255.255 nomodify notrap noquery

      編輯tip02節點ntp.conf文件  

      # vi /etc/ntp.conf  

      server tip01  

      restrict tip01 mask 255.255.255.255 nomodify notrap noquery  

      3.分別在tip01,tip02上修改NTPD參數文件  

      #vi /etc/sysconfig/ntpd  

      SYNC_HWCLOCK=yes

      OPTIONS="-x -u ntp:ntp -p /var/run/ntpd.pid"  

      #RAC安裝時需要檢測的-x參  

      #cd /etc/ntp  

      #ls  

      keys  ntpservers  step-tickers  

      # more ntpservers  

      #This file contains a list of ntp servers to show in the system-config-

      date user interface.  

      #It is not recommended that you modify this file by hand.  

      #添加ntp 服務器地址或者主機名  

      tip01  

      注:注意查看step-tickers內容,如果step-tickers錯誤也會導致ntp不同步  

      # more step-tickers  

      # 在tip01,tip02上執行chkconfig,使NTP服務開機啟動  

      [root@tip01 ~]# chkconfig  ntpd on  

      [root@tip02 ~]# chkconfig  ntpd on  

      [root@tip01 ~]# service ntpd restart  

      關閉 ntpd:[確定]  

      ntpd: 同步時間服務器:[失敗]  

      啟動 ntpd:[確定]  

      確保該端口以udp方式開放。  

      [root@tip01 ~]

      # netstat -an |grep 123  

      udp        0      0 192.168.99.228:123          0.0.0.0:*      udp        0      0 162.20.1.228:123            0.0.0.0:*                          udp        0      0 127.0.0.1:123               0.0.0.0:*                              

      udp        0      0 0.0.0.0:123                 0.0.0.0:*                      udp        0      0 ::1:123                     :::*                        udp        0      0 fe80::250:56ff:fe9d:123     :::*                            udp        0      0 :::123                 :::*  

      查看ntp狀態  

      [root@tip01 ~]# ntpstat  

      synchronised to local net at stratum 11  

      time correct to within 11 ms  

      polling server every 1024 s  

      在tip02節點啟動ntp服務  

      [root@tip02 ~]#

      service ntpd start  

      ntpd: 同步時間服務器:[確定]  

      同步硬件時鐘到系統時鐘 [確定]  

      啟動 ntpd:[確定]  

      切換至事先配好的grid用戶來驗證兩節點時間  

      [grid@tip02 ~]$ ssh tip01 date  

      2012年 05月 20日 星期日 22:21:46 CST  

      [grid@tip02 ~]$ ssh tip02 date  

      2012年 05月 20日 星期日 22:21:48 CST  

      [grid@tip02 ~]$  


      • 聯系方式
      • 傳 真:86-10-82782026
      • 電 話:400-015-1230
      • 地 址:北京市海淀區北清路68號院用友軟件園北區17號樓三層
      在線咨詢

      咨詢電話:

      400-015-1230

      • 微信掃碼 關注我們

      Copyright ? 2002-2035 北京泰福特電子科技有限公司 版權所有 備案號:京ICP備12028220號-3
      京公網安備 11010802025976號

      掃一掃咨詢微信客服

      18519396506
      欧美日韩国产一区
      Powered by RRZCMS