linux:linux_rac_ntp
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen RevisionVorhergehende Überarbeitung | |||
linux:linux_rac_ntp [2016/09/14 15:22] – [NTP Konfiguration für das Oracle Cluster mit der -x Slewing Option einrichten] gpipperr | linux:linux_rac_ntp [2018/06/02 09:52] (aktuell) – [NTP Konfiguration für das Oracle Cluster mit der " -x" Slewing Option einrichten] gpipperr | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
+ | ===== Die Uhrzeit unter Linux für eine Oracle Cluster Installation überwachen/ | ||
+ | Eine unabdingbare Voraussetzung für ein funktionierende Oracle Real Application Cluster ist eine exakt gleiche Uhrzeit auf allen Cluster Knoten. | ||
+ | |||
+ | Gerade beim Start des Clusters muss die Uhrzeit des System exakt stimmen, d.h. auch die Bios/Real Time Clock muss auf die richtige Uhrzeit gesetzt werden. | ||
+ | |||
+ | Für Windows siehe [[windows: | ||
+ | ==== NTP Konfiguration für das Oracle Cluster mit der " -x" Slewing Option einrichten ==== | ||
+ | |||
+ | |||
+ | NTP muss mit der Option **" -x"** (Für slew) eingerichtet werden. | ||
+ | |||
+ | Das bedeutet, das die Uhrzeit nicht schlagartig bei Änderungen verstellt wird, sondern langsam an den echten Wert angenähert wird. | ||
+ | |||
+ | |||
+ | <code bash> | ||
+ | $ vi / | ||
+ | … | ||
+ | OPTIONS=” -x -g ” | ||
+ | … | ||
+ | </ | ||
+ | |||
+ | Auf das führende Leerzeichen vor dem **-x** achten. | ||
+ | |||
+ | Auf die richtigen NTP Server achten, dazu Datei "/ | ||
+ | <code bash> | ||
+ | $ cat / | ||
+ | … | ||
+ | restrict < | ||
+ | … | ||
+ | </ | ||
+ | |||
+ | |||
+ | Ist ein Zugriff auf das Internet finden finden sich hier: http:// | ||
+ | |||
+ | Beispiel für einen Server Eintrag: | ||
+ | <code bash> | ||
+ | |||
+ | # Permit all access over the loopback interface. | ||
+ | # be tightened as well, but to do so would effect some of | ||
+ | # the administrative functions. | ||
+ | restrict 127.0.0.1 | ||
+ | restrict ::1 | ||
+ | |||
+ | # Hosts on local network are less restricted. | ||
+ | restrict 10.10.10.0 mask 255.255.255.0 nomodify notrap | ||
+ | |||
+ | # Server | ||
+ | server 192.168.178.1 | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | Testen des Zeitdienstes (und setzen der aktuellen Zeit): | ||
+ | <code bash> | ||
+ | $ service ntpd stop | ||
+ | $ ntpdate -s < | ||
+ | |||
+ | $ service ntpd restart | ||
+ | </ | ||
+ | |||
+ | Autostart einrichten Linux 6: | ||
+ | <code bash> | ||
+ | $ chkconfig --level 35 ntpd on | ||
+ | |||
+ | $ chkconfig --list | grep ntpd | ||
+ | ntpd 0:off | ||
+ | |||
+ | </ | ||
+ | |||
+ | Autostart einrichten Linux 7: | ||
+ | <code bash> | ||
+ | systemctl enable ntpd.service | ||
+ | systemctl restart ntpd.service | ||
+ | </ | ||
+ | |||
+ | ===Genauigkeit über den Drift file prüfen=== | ||
+ | |||
+ | <code bash> | ||
+ | cat / | ||
+ | -7.437 | ||
+ | </ | ||
+ | |||
+ | In der Datei steht " | ||
+ | |||
+ | Einheit: | ||
+ | 1 PPM = 1 part per million = 1 microsecond per second = 3.6ms per Stunde = 86.4ms per Tag | ||
+ | |||
+ | |||
+ | ===Datei "/ | ||
+ | |||
+ | Eine wichtige Rolle die diesen Zusammenhang spielt die Datei "/ | ||
+ | |||
+ | Abfragen mit " | ||
+ | |||
+ | |||
+ | In der Datei djtime wird die tägliche Abweichung und der Zeitpunkt der letzen Korrectur verzeichnet | ||
+ | |||
+ | Beispiel: | ||
+ | <code bash> | ||
+ | cat / | ||
+ | |||
+ | 0.000081 1417182843 0.000000 | ||
+ | 1417182843 | ||
+ | UTC | ||
+ | |||
+ | |||
+ | date -d @1417182843 | ||
+ | |||
+ | Fri Nov 28 14:54:03 CET 2014 | ||
+ | |||
+ | </ | ||
+ | |||
+ | * 1. Zeile: die tägliche Abweichung in Sekunden (als Gleitkommazahl) - Zeitpunkt der letzten Korrektur in epoch - der Wert 0.000000 | ||
+ | * 2. Zeile: Zeitpunkt der letzten Korrektur in epoch oder »0« , falls noch keine Korrektur stattfand | ||
+ | * 3. Zeile »LOCAL« oder »UTC« , zeigt an ob die Hardwareuhr auf lokale Zeitzone oder »Coordinated Universal Time« eingestellt ist | ||
+ | |||
+ | Ein Aufruf von " | ||
+ | |||
+ | Beim Bootvorgang wird diese Information dann (evlt. ? je nach Linux?) verwendet, um die Uhr beim Booten zu setzen. In einer Umgebung konnte beobachtet werden da beim Booten die Uhrzeit dadurch extrem falsch gesetzt wurde, mit der " -x" Option im Rack führte das wiederum zu masiven Problemen beim Start des Cluster Knoten. | ||
+ | |||
+ | |||
+ | |||
+ | ===Test=== | ||
+ | |||
+ | |||
+ | Gestarteten Zeitdienst mit dem Programm [[http:// | ||
+ | |||
+ | <code bash> | ||
+ | |||
+ | / | ||
+ | |||
+ | ntpq> lopeers | ||
+ | | ||
+ | ============================================================================== | ||
+ | *iris.wf-hosting 192.168.178.181 | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | |||
+ | # | ||
+ | # | ||
+ | # remote: | ||
+ | # refid: | ||
+ | # st : The remote peer or server Stratum | ||
+ | # t: Type (u: unicast or manycast client, b: broadcast or multicast client, l: local reference clock, s: symmetric peer, A: manycast server, B: broadcast server, M: multicast server, see “Automatic Server Discovery“); | ||
+ | # when: number of seconds passed since last response | ||
+ | # poll: polling interval, in seconds, for source | ||
+ | # reach: | ||
+ | # delay: | ||
+ | # offset: | ||
+ | # disp/ | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ntpq> rl | ||
+ | associd=0 status=0614 leap_none, sync_ntp, 1 event, freq_mode, | ||
+ | version=" | ||
+ | processor=" | ||
+ | leap=00, stratum=3, precision=-24, | ||
+ | refid=176.31.45.66, | ||
+ | reftime=d7125e40.97fd54d9 | ||
+ | clock=d7125e50.c5a2a83c | ||
+ | mintc=3, offset=0.091, | ||
+ | clk_jitter=0.032, | ||
+ | |||
+ | # weitere wichtige Befehle: | ||
+ | |||
+ | ntpq> peers | ||
+ | ntpq> associations | ||
+ | |||
+ | # Auslese eines peer mit der assID | ||
+ | |||
+ | ntpq> readlist < | ||
+ | |||
+ | ntpq> exit | ||
+ | |||
+ | </ | ||
+ | |||
+ | Überwachen mit [[http:// | ||
+ | |||
+ | <code bash> | ||
+ | |||
+ | ntpdc | ||
+ | |||
+ | ntpdc> monlist | ||
+ | |||
+ | remote address | ||
+ | =============================================================================== | ||
+ | hv02.nebie.de | ||
+ | alvo.fungus.at | ||
+ | tischi.de | ||
+ | iris.wf-hosting.de | ||
+ | |||
+ | |||
+ | ntpdc> sysstat | ||
+ | |||
+ | time since restart: | ||
+ | time since reset: | ||
+ | packets received: | ||
+ | packets processed: | ||
+ | current version: | ||
+ | previous version: | ||
+ | declined: | ||
+ | access denied: | ||
+ | bad length or format: | ||
+ | bad authentication: | ||
+ | rate exceeded: | ||
+ | |||
+ | |||
+ | # Alles zusammen abfragen: | ||
+ | |||
+ | |||
+ | ntpq -c peer -c as -c rl | ||
+ | |||
+ | | ||
+ | ============================================================================== | ||
+ | +minion.webershe 192.53.103.108 | ||
+ | -89.163.176.81 | ||
+ | *monitman.com | ||
+ | +freiwuppertal.d 130.133.1.10 | ||
+ | |||
+ | ind assid status | ||
+ | =========================================================== | ||
+ | 1 10798 941a | ||
+ | 2 10799 9324 | ||
+ | 3 10800 961a | ||
+ | 4 10801 941a | ||
+ | associd=0 status=0615 leap_none, sync_ntp, 1 event, clock_sync, | ||
+ | version=" | ||
+ | processor=" | ||
+ | stratum=3, precision=-21, | ||
+ | refid=144.76.118.85, | ||
+ | reftime=d80b8e6a.b134c8b9 | ||
+ | clock=d80b8ec8.a6f43595 | ||
+ | mintc=3, offset=-106.861, | ||
+ | clk_jitter=12.849, | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | ==Wie genau ist die Uhrzeit nun eingestellt? | ||
+ | |||
+ | Im Cluster wird oft von der Clustersoftware eine Zeitdifferenz in Bereich einer Millisekunde erkannt und gelogt. | ||
+ | |||
+ | Auch ist die Frage wie groß denn gerade der Offset durch die " -x" Option ist. | ||
+ | |||
+ | Detail suchen: | ||
+ | <code bash> | ||
+ | / | ||
+ | |||
+ | offset: | ||
+ | frequency: | ||
+ | poll adjust: | ||
+ | watchdog timer: | ||
+ | |||
+ | #From the man page: | ||
+ | # The `offset' | ||
+ | # The `frequency' | ||
+ | # The `time_const' | ||
+ | # The `watchdog timer' value is the number of seconds which have elapsed since the last sample offset was given to the loop filter. | ||
+ | |||
+ | / | ||
+ | |||
+ | pll offset: | ||
+ | pll frequency: | ||
+ | maximum error: | ||
+ | estimated error: | ||
+ | status: | ||
+ | pll time constant: | ||
+ | precision: | ||
+ | frequency tolerance: | ||
+ | |||
+ | # | ||
+ | |||
+ | / | ||
+ | |||
+ | system peer: 192.168.178.1 | ||
+ | system peer mode: | ||
+ | leap indicator: | ||
+ | stratum: | ||
+ | precision: | ||
+ | root distance: | ||
+ | root dispersion: | ||
+ | reference ID: | ||
+ | reference time: | ||
+ | system flags: | ||
+ | jitter: | ||
+ | stability: | ||
+ | broadcastdelay: | ||
+ | authdelay: | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | / | ||
+ | |||
+ | ntp_gettime() returns code 0 (OK) | ||
+ | time d80b8e61.a8555000 | ||
+ | maximum error 12666016 us, estimated error 16 us, TAI offset 0 | ||
+ | ntp_adjtime() returns code 0 (OK) | ||
+ | modes 0x0 (), | ||
+ | offset 0.000 us, frequency 0.000 ppm, interval 1 s, | ||
+ | maximum error 12666016 us, estimated error 16 us, | ||
+ | status 0x1 (PLL), | ||
+ | time constant 7, precision 1.000 us, tolerance 500 ppm, | ||
+ | |||
+ | # Auf einem RedHat System: | ||
+ | |||
+ | / | ||
+ | |||
+ | ntp_gettime() returns code 5 (ERROR) | ||
+ | |||
+ | # | ||
+ | |||
+ | / | ||
+ | |||
+ | .. | ||
+ | stratum=3, precision=-23, | ||
+ | .. | ||
+ | tc=10, mintc=3, offset=4.686, | ||
+ | .. | ||
+ | |||
+ | ## microseconds => 2^precision | ||
+ | ## When repeatedly reading the time, the difference may vary almost randomly. The difference of these differences (second derivation) is called jitter. | ||
+ | |||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | ==Fehlersuche== | ||
+ | |||
+ | Siehe: | ||
+ | * http:// | ||
+ | |||
+ | |||
+ | ==== Real Time Clock ==== | ||
+ | Beim Bootvorgang holt sich das OS die Zeit vom der Hardware, der Real Time Clock. | ||
+ | |||
+ | Der Wert der Real Time Clock kann hier abgefragt werden: | ||
+ | |||
+ | <code bash> | ||
+ | cat / | ||
+ | </ | ||
+ | |||
+ | |||
+ | Bzgl. Epoch Zeit siehe diesen guten Epoch Rechner: http:// | ||
+ | |||
+ | ==Lokale OS Zeit mit der Real Time Clock der Hardware vergleichen== | ||
+ | |||
+ | <code bash> | ||
+ | |||
+ | # epoch auswerten: | ||
+ | date -d @`cat / | ||
+ | |||
+ | # | ||
+ | cat / | ||
+ | |||
+ | # Gleichzeitig auswerten: | ||
+ | # Gleichzeitig abfragen mit: | ||
+ | |||
+ | echo NTP Time=`date +" | ||
+ | |||
+ | </ | ||
+ | |||
+ | Bzgl. der Zeitformate siehe hier: http:// | ||
+ | |||
+ | |||
+ | Die Uhrzeit der Hardware Clock MUSS gleich der Uhrzeit des OS sein und sollte nicht zu stark auseinander laufen. | ||
+ | |||
+ | |||
+ | Management Karten wie der HP iLO können beim Booten die Uhrzeit zwar gut setzen, müssen selber aber auf die richtige Zeit gesetzt werden und die richtigen Zeitserver verwenden! Auf die Zeitzone achten! | ||
+ | |||
+ | == Setzen== | ||
+ | |||
+ | Gesetzt werden kann die HW Clock mit [[http:// | ||
+ | <code bash> | ||
+ | # auslesen als root mit: | ||
+ | hwclock -r | ||
+ | |||
+ | #HW Clock auf System zeit setzen mit: | ||
+ | hwclock --systohc | ||
+ | |||
+ | </ | ||
+ | |||
+ | ==== Mit dem Oracle clufy Utility prüfen==== | ||
+ | |||
+ | Zeitdienst im Oracle Cluster prüfen: | ||
+ | <code bash> | ||
+ | |||
+ | #Umgebung auf das Oracle Home des Clusters einstellen | ||
+ | |||
+ | cd $ORACLE_HOME/ | ||
+ | |||
+ | ./cluvfy comp clocksync -n all -verbose | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | Zeitdienst nur im OS prüfen: | ||
+ | <code bash> | ||
+ | |||
+ | #Umgebung auf das Oracle Home des Clusters einstellen | ||
+ | |||
+ | cd $ORACLE_HOME/ | ||
+ | |||
+ | ./cluvfy comp clocksync -noctss -n all -verbose | ||
+ | |||
+ | </ | ||
+ | |||
+ | <note warning> | ||
+ | |||
+ | Prüfen ob der Oracle ctss Cluster Time Synchronization Service aktiv ist: | ||
+ | |||
+ | <code bash> | ||
+ | # Als Grid User | ||
+ | |||
+ | crsctl check ctss | ||
+ | CRS-4700: The Cluster Time Synchronization Service is in Observer mode. | ||
+ | |||
+ | </ | ||
+ | |||
+ | Sobald der CTSS erkennt das KEIN NTP konfiguriert ist ( CTSS prüft ob die / | ||
+ | |||
+ | |||
+ | |||
+ | ===Beispiel für fehlerhaften Zeit Dienst:=== | ||
+ | |||
+ | ==Erste Anzeichen im Cluster Alert Log== | ||
+ | |||
+ | <code bash> | ||
+ | #Umgebung auf das Oracle Home des Clusters einstellen | ||
+ | |||
+ | cd $ORACLE_HOME/ | ||
+ | |||
+ | grep -B 1 clock alertgpidb01.log | ||
+ | |||
+ | ... | ||
+ | 2014-05-05 18: | ||
+ | [ctssd(21703)]CRS-2409: | ||
+ | ... | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | Ursache: Siehe Meldungen von den Clufy Kommando für die Analyse | ||
+ | |||
+ | |||
+ | * CRS-2409: | ||
+ | * CRS-2409 messages seen from CTSS despite NTP running properly. (Doc ID 1311163.1) | ||
+ | |||
+ | |||
+ | **Ursache: | ||
+ | |||
+ | Der Unterschied in der Uhrzeit zwischen diesem Knoten und dem referenz Knoten im Cluster ist größer als 1ms. | ||
+ | Laut Node 1311163.1 kann das ingnoriert werden, wenn keine Fehler bei einem ntp test mit clufy auftauchen. | ||
+ | |||
+ | |||
+ | |||
+ | == Schwerwiegender Fehler == | ||
+ | |||
+ | <code bash> | ||
+ | [ctssd(7784)]CRS-2412: | ||
+ | </ | ||
+ | |||
+ | |||
+ | Analyse: | ||
+ | * Detail Logfile unter **$ORACLE_HOME/ | ||
+ | * clufy Output beachten! | ||
+ | |||
+ | |||
+ | |||
+ | * Linux: CRS-2412: The Cluster Time Synchronization Service detects that the local time is significantly different from the mean cluster time (Doc ID 1632514.1) | ||
+ | |||
+ | ==== Quellen==== | ||
+ | |||
+ | NTP: | ||
+ | |||
+ | * http:// | ||
+ | * http:// | ||
+ | * https:// | ||
+ | * http:// | ||
+ | * http:// | ||
+ | * https:// | ||
+ | |||
+ | |||
+ | Oracle: | ||
+ | |||
+ | * http:// | ||
+ | * How to Configure NTP or Windows Time for Oracle Clusterware (Doc ID 1056693.1) | ||
+ | * Linux: An Example NTP Client Configuration to use with Oracle Clusterware 11gR2 (Doc ID 1104473.1) | ||
+ | * Grid Infrastructure Does not Start after Node Reboot as Master octssd.bin Stuck (Doc ID 1215893.1) | ||
+ | |||
+ | Windows ntpd | ||
+ | * https:// | ||
+ | |||
+ | Blogs: | ||
+ | |||
+ | * http:// | ||
+ | * http:// | ||
+ | * http:// | ||
+ | * http:// | ||
+ | * http:// |
linux/linux_rac_ntp.txt · Zuletzt geändert: 2018/06/02 09:52 von gpipperr