如何在各個(gè)平臺(tái)上配置NTP的微調(diào)模式

這篇文章將為大家詳細(xì)講解有關(guān)如何在各個(gè)平臺(tái)上配置NTP的微調(diào)模式,文章內(nèi)容質(zhì)量較高,因此小編分享給大家做個(gè)參考,希望大家閱讀完這篇文章后對(duì)相關(guān)知識(shí)有一定的了解。

我們提供的服務(wù)有:網(wǎng)站設(shè)計(jì)制作、成都網(wǎng)站建設(shè)、微信公眾號(hào)開(kāi)發(fā)、網(wǎng)站優(yōu)化、網(wǎng)站認(rèn)證、平陰ssl等。為千余家企事業(yè)單位解決了網(wǎng)站和推廣的問(wèn)題。提供周到的售前咨詢和貼心的售后服務(wù),是有科學(xué)管理、有技術(shù)的平陰網(wǎng)站制作公司

對(duì)于11.2之前的版本,很多環(huán)境的重啟原因(top5的情況)是由于NTP調(diào)整時(shí)間的步伐過(guò)大導(dǎo)致的,所以RAC環(huán)境中,我們建議用戶如果使用NTP,需要配置成微調(diào)模式;

如何診斷節(jié)點(diǎn)重啟問(wèn)題


這里介紹幾個(gè)主流linux和unix平臺(tái)上NTP微調(diào)的配置方法:


For Linux :


1.請(qǐng)確確認(rèn)各節(jié)點(diǎn)的ntp包已經(jīng)安裝 ,我這里是個(gè)4.2.2的版本


[oracle@nascds10 ~]$ rpm -qa | grep ntp


ntp-4.2.2p1-9.el5_4.1


2.請(qǐng)編輯各個(gè)節(jié)點(diǎn)的ntp.conf文件


[oracle@nascds10 ~]$ su - root


Password:


[root@nascds10 ~]#  vi /etc/ntp.conf


#New ntp server added by Robinson


server  192.168.1.128 prefer  <<<<===========這里是時(shí)鐘服務(wù)器


restrict 192.168.7.0  mask 255.255.255.255 nomodify notrap #基于網(wǎng)段的限制(限制在網(wǎng)段192.168.7.0)


broadcastdelay 0.008


[root@nascds11 ~]# vi /etc/ntp.conf


#New ntp server added by Robinson


server 192.168.7.71 prefer


broadcastdelay 0.008


3、配置ntpd的參數(shù),我們主要強(qiáng)調(diào)的是要配置成"微調(diào)的模式" 也就是在options中要加入 -x的選項(xiàng)


[root@nascds10 ~]# vi /etc/sysconfig/ntpd


#The following item added by Robinson


#Set to 'yes' to sycn hw clock after successful ntpdate


SYNC_HWCLOCK=yes  


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


[root@nascds11 ~]# vi /etc/sysconfig/ntpd


The following item added by Robinson


SYNC_HWCLOCK=yes


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


4、自動(dòng)啟動(dòng)配置


[root@nascds10 ~]# chkconfig ntpd on


[root@nascds11 ~]# chkconfig ntpd on


5、重啟一下,使最新配置生效


[root@nascds10 ~]# service ntpd restart


Shutting down ntpd: [  OK  ]


ntpd: Synchronizing with time server: [  OK  ]


Syncing hardware clock to system time [  OK  ]


Starting ntpd: [  OK  ]


[root@nascds11 ~]# service ntpd restart


Shutting down ntpd: [  OK  ]


ntpd: Synchronizing with time server: [  OK  ]


Syncing hardware clock to system time [  OK  ]


Starting ntpd: [  OK  ]


6、檢查ntpd進(jìn)程的狀態(tài)


[root@nascds10 ~]# ntpq -p


      remote           refid      st t when poll reach   delay   offset  jitter


==============================================================================


  LOCAL(0)        .LOCL.          10 l   40   64    1    0.000    0.000   0.001


[root@nascds11 ~]# ntpq -p


      remote           refid      st t when poll reach   delay   offset  jitter


==============================================================================


  test.oracle.com  .INIT.          16 u   60   64    0    0.000    0.000   0.000


  LOCAL(0)        .LOCL.          10 l   59   64    1    0.000    0.000   0.001


For Aix:


1. NTP的同步設(shè)置  編輯 /etc/ntp.conf文件, 內(nèi)容如下:


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


#broadcastclient


server 192.168.5.2 


driftfile /etc/ntp.drift


tracefile /etc/ntp.trace


slewalways yes


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


我們這里還是要強(qiáng)調(diào)微調(diào)slewalways  ,這個(gè)值的默認(rèn)設(shè)置是no,也就是說(shuō)如果您不設(shè)置,NTP最大可一次調(diào)整1000秒. 根據(jù)IBM的官方說(shuō)明,如果我們不指定slewthreshold  那么默認(rèn)值是 0.128 seconds. 如果想特別設(shè)置,請(qǐng)指定slewthreshold 的值,注意單位是second


2.在NTP客戶端啟動(dòng)xntpd守護(hù)進(jìn)程


# startsrc -s xntpd

3. 查詢xntpd的狀態(tài)


當(dāng) system peer 不為 'insane' 時(shí), 表明客戶端已與服務(wù)器端成功地進(jìn)行了同步.


# lssrc -ls xntpd


Program name: --/usr/sbin/xntpd


Version: -------3


Leap indicator: 00 (No leap second today.) Sys peer: ------192.168.5.2 ...


關(guān)于更多的關(guān)于IBM的平臺(tái)上NTP的設(shè)置,可以參考IBM的官方文檔解釋?zhuān)?/p>


http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.files/doc/aixfiles/ntp.conf.htm

For HP  UX:

NTP在HP上的配置,是比較省心的,不容易導(dǎo)致RAC重啟的,因?yàn)镠P上的NTP默認(rèn)的就是微調(diào)的模式


1、首先我們還是要編輯ntp的配置文件 /etc/rc.config.d/netdaemons,把 XNTPD 設(shè)定為1表示啟動(dòng)


   export XNTPD=1


2、編輯配置文件 /etc/ntp.conf ,配置好時(shí)間同步服務(wù)器


   server 192.168.5.2      #  第一個(gè)地址是主服務(wù)器


   server 192.168.5.3      #  第二個(gè)地址是備用服務(wù)器


3、啟動(dòng)ntp的進(jìn)程


   # /sbin/init.d/xntpd start


4、檢查NTP的狀態(tài)


   # /usr/sbin/ntpq -p


  這個(gè)命令您會(huì)看到同步的地址


  如果出現(xiàn)的結(jié)果是No association ID's returned 那么表示您失敗了


關(guān)于HP主機(jī)上NTP的模式,有3種如下,在HP 平臺(tái)的man page中有詳細(xì)的說(shuō)明:


模式1:offset below 128 milliseconds

This is the normal operating regime of NTP. A properly configured NTP hierarchy (with reasonable networking) can operate for years without ever approaching the 128 millisecond upper limit. All time adjustments are small and smooth (known as slewing), and nobody even notices the slew adjustments unless they have a cesium clock or a GPS clock and expensive instrumentation to make sophisticated measurements (HP/Agilent makes the instruments).

模式2:offset above 128 milliseconds

This regime is often encountered at power-on because, those battery-backed real-time clocks they put in computers are not too great. Because NTP is quite capable of keeping the offset below one millisecond all the time it is running, many users want to get into the normal regime quickly when an offset above 128 millisecond is encountered at startup. So in this situation NTP will (fairly quickly) make a single step change, and is usually successful in getting the offset well below 128 millisecond so there will be no more of the disruptive step changes.


模式3:offset above 1000 seconds


This is so far out of the normal operating range that NTP decides something is terribly wrong and human intervention is required. The daemon shuts down.


For Solars:


我這沒(méi)有測(cè)試的平臺(tái),不過(guò)在KM (How to Configure NTP or Windows Time for Oracle Clusterware (Doc ID 1056693.1))里找到了配置的辦法,這里還有Windows的配置方式


檢查配置:


/usr/bin/svcs ntp


STATE          STIME    FMRI


online          7:39:29 svc:/network/ntp:default


ps -ef|grep ntp


root 21212     1   0   Feb 02 ?           0:33 /usr/lib/inet/xntpd

配置/etc/inet/ntp.conf 啟用slewalaways


grep 'slewalways|pll' /etc/inet/ntp.conf


slewalways yes


disable pll


啟動(dòng):


/usr/sbin/svcadm enable ntp

關(guān)于如何在各個(gè)平臺(tái)上配置NTP的微調(diào)模式就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,可以學(xué)到更多知識(shí)。如果覺(jué)得文章不錯(cuò),可以把它分享出去讓更多的人看到。

文章題目:如何在各個(gè)平臺(tái)上配置NTP的微調(diào)模式
瀏覽路徑:http://bm7419.com/article24/jcscje.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供定制網(wǎng)站、響應(yīng)式網(wǎng)站、云服務(wù)器、搜索引擎優(yōu)化、靜態(tài)網(wǎng)站小程序開(kāi)發(fā)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

微信小程序開(kāi)發(fā)