Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Linux NTP service configuration for Oracle RAC

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

When installing Oracle 11g RAC, we need to configure the ntp service. There are many ways to configure the clock synchronization mode when using virtual machines. You can use the clock synchronization function that comes with vmware, or you can directly use a local node as a time server. This article introduces a clock server that directly configures ntp mode. 1. View the hosts configuration of the two nodes

[root@node1 ~]# cat /etc/hosts

# Do not remove the following line, or various programs

# that require network functionality will fail.

#127.0.0.1 localhost.localdomain localhost

#::1 localhost6.localdomain6 localhost6

127.0.0.1 localhost.szdb.com localhost

# Public eth0

192.168.7.71 node1.szdb.com node1

192.168.7.72 node2.szdb.com node2

#Private eth2

10.10.7.71 node1-priv.szdb.com node1-priv

10.10.7.72 node2-priv.szdb.com node2-priv

#Virtual

192.168.7.81 node1-vip.szdb.com node1-vip

192.168.7.82 node2-vip.szdb.com node2-vip

2. Confirm that the ntp package for each node has been installed

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

ntp-4.2.2p1-9.el5_4.1

chkfontpath-1.10.1-1.1 #This is font related, not ntp package

[oracle@node1 ~]$ ssh node2 rpm -qa | grep ntp

ntp-4.2.2p1-9.el5_4.1

chkfontpath-1.10.1-1.1 #This is font related, not ntp package

3. Edit the ntp.conf file of the two nodes

[oracle@node1 ~]$ su - root

Password:

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

#New ntp server added by Robinson

server 127.127.1.0 prefer #Add preferred clock server

restrict 192.168.7.0 mask 255.255.255.255 nomodify notrap #Only allow 192.168.7.* time synchronization between clients on a network segment

broadcastdelay 0.008

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

#New ntp server added by Robinson

server 192.168.7.71 prefer

broadcastdelay 0.008

4. Edit the ntpd parameter of two nodes

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

#The following item added by Robinson

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

SYNC_HWCLOCK=yes #This option is used to automatically calibrate the system clock to the hardware clock

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

Note how to understand Linux clock types. In Linux system divided into system clock and hardware clock.

#System clock refers to the clock in the current Linux kernel, while hardware clock refers to the BIOS clock, the clock powered by the motherboard battery

#When Linux starts, the hardware clock reads the system clock setting, and then the system clock operates independently of the hardware clock

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

The following item added by Robinson

SYNC_HWCLOCK=yes

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

5. Configure ntp self-startup service

[root@node1 ~]# chkconfig ntpd on

[root@node2 ~]# chkconfig ntpd on

6. Start the ntp service on both nodes

[root@node1 ~]# service ntpd stop

Shutting down ntpd: [FAILED]

[root@node1 ~]# service ntpd start

ntpd: Synchronizing with time server: [FAILED]

Starting ntpd: [ OK ]

[root@node2 ~]# service ntpd restart

Shutting down ntpd: [ OK ]

ntpd: Synchronizing with time server: [ OK ]

Syncing hardware clock to system time [ OK ]

Starting ntpd: [ OK ]

7. Check the status of ntp

[root@node1 ~]# 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@node2 ~]# ntpq -p

remote refid st t when poll reach delay offset jitter

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

node1.szdb.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

#Author : Robinson

#Blog: http://blog.csdn.net/robinson_0612

You can also use watch ntpq -p to view real-time status

8. NTP related logs

[root@bigboy tmp]# cat /var/log/messages | grep ntpd

Source: http://blog.csdn.net/leshami/article/details/8268079

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report