Summary of Oracle RAC time synchronization method

Source: Internet
Author: User

I. Use the ntpdate command

1. When the server is linked to the extranet

# CRONTAB-E

Join a line:

*/1 * * * * ntpdate 210.72.145.44

210.72.145.44 for China National Time Service Center server address, so that the machine every 1 points can be synchronized with the National Time Service center.

Note: When using the Ntpdate command, the NTPD service must be turned off, otherwise it will report the "NTP" in-use, exiting error.

The NTPD Service command is turned off as follows:

[Root@node2 init.d]#/etc/init.d/ntpd Stop

Shutting down NTPD: [OK]

2. Set up local time server

You need to modify several configurations in the/etc/ntp.conf file, such as local time server IP 10.85.10.119, CONFIGURED as follows:

Server 210.72.145.44 prefer (China National Service Center server address prefer gives priority attention to changing the default server to this)

Server 127.127.1.0 (local time)

Restrict 10.85.10.0 mask 255.255.255.0 nomodify (allow 10. 85.10.* IP uses this time server)

Restrict 0.0.0.0 mask 0.0.0.0 nomodify notrap noquery notrust (block other IP over to update time)

The other remains the default.

Enable the NTP service to start automatically when the system boots and execute:

# Chkconfig NTPD on

Start/close/restart NTP command:

#/ETC/INIT.D/NTPD Start

#/ETC/INIT.D/NTPD Stop

#/etc/init.d/ntpd Restart

#service ntpd Restart

Write sync time in CMOS

Vi/etc/sysconfig/ntpd

Sync_hwclock=yes

You need to restart the service to make the configuration effective each time you modify the configuration file.

You can use the following command to check whether the NTP service is started, and you should be able to get a process ID number:

# pgrep NTPD

Check the status of the time server synchronization using the following command:

# ntpq-p

With Ntpstat can also view some synchronization status, with Netstat-ntlup view port usage!

It takes 5-10 minutes for the client to update the time from the server side.

Client settings:

# CRONTAB-E

Join a line:

*/1 * * * * ntpdate 10.85.10.119.

Description of related configuration parameters

# Restrict permission control syntax is:
# Restrict IP Mask netmask_ip parameter
# where IP can be the software address, can also be default, default is similar to 0.0.0.0 slightly!
# As for the paramter, there are:
# Ignore: Turn off all NTP Online Services
# Nomodify: Indicates that the client side cannot change the time parameter on the Server side, however,
# The client side can still be used for network school on the server side.
# Notrust: This client source will be treated as an untrusted domain unless authenticated
# Noquery: Do not provide client-side time queries
# If paramter is not set at all, that means there is no limit to the IP (or domain)! 』

# set up the top-level host mainly to the server this parameter to set, the syntax is:
# Server [ip| FQDN] [prefer]
# The server is followed by our upper-level time server?? The? Curled Server parameter
# After adding perfer, that means our NTP host is mainly used as the host of the
# The corresponding of the time correction. In addition, in order to solve the transmission delay action of the update Time packet,

Second, the use of Rdate synchronization time

If you want to install RAC with VMware, the time must be the same for each of the points, and you can use one node as the standard and the other nodes to synchronize with the node.
If there are two nodes:
a:10.85.10.119
b:10.85.10.121

With a as the time standard, B nodes are synchronized with a node time.
1. Open 37 ports in a node
The simplest, but also least secure, approach is to turn off the firewall: iptables-f

2. Start time service at Node A

#chkconfig time on #在系统引导的时候自动启动

If you do not start the service, the other nodes will be in sync with the node when the error occurs: Connect refused

Note: To use the root user

3, in the B node and a node synchronization time

Rdate-s 10.85.10.119

The execution plan can be done in crontab, once every minute, so that time synchronization is ensured.

[Root@node2 ~]# Crontab-l

*/1 * * * * rdate-s 10.85.10.119


three. Using the network Time Protocol (NTP) Server

1. If the company network has a time server: 10.85.10.80, at this point only need to modify the NTP service profile at each node, so that each node and time server to synchronize.

# vi/etc/ntp.conf

Server 10.85.10.80 prefer

Driftfile/var/lib/ntp/drift

Broadcastdelay 0.008

Restart the NTP service after the change is done

#/etc/init.d/ntpd restart

2. If there is no time service, you can use one of the RAC 2 nodes as a server. The other is synchronized with this server.

Add the server with Node1, its IP is: 10.85.10.119, modify configuration file

#vi/etc/ntp.conf

Server 127.127.1.0– Local Clock

Fudge 127.127.1.0 Stratum 11

Broadcastdelay 0.008

Node2 is synchronized with Node1.

Modifying the Node2 NTP configuration file

# vi/etc/ntp.conf

Server 10.85.10.119 prefer

Driftfile/var/lib/ntp/drift

Broadcastdelay 0.008

Restart the NTP service after the change is done

#/etc/init.d/ntpd restart

Or the Node2 is using crontab to sync time with the server

*/15 * * * * ntpdate 10.85.10.119

About Network Time Protocol (NTP) servers, rdate synchronization times, Ntpdate command synchronization times, and personal referrals are addressed using the Ntpdate command.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.