After various searches on the web, the time of the Linux platform and the Solaris platform is synchronized as follows:
Host Condition:
Application: 2 Linux servers Redhat 5.5 intranet
Database: 2 Solaris server Solaris 10 Intranet
Interface server: 1 Linux servers Redhat 5.5 intranet + public network
Implementation plan:
Synchronize the server with the interface server for time and synchronize the application with the database server.
Operation Steps:
Start the deployment time synchronization service with the root user login interface server (135.146.16.40)
1: Get the installation package
#wget http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2.6p5.tar.gz
2: Unpack the installation package
#tar ZXVF ntp-4.2.6p5.tar.gz
#cd NTP-4.2.6P5
3: Checksum + config + compile + install
#./configure--PREFIX=/USR/LOCAL/NTP--enable-all-clocks--enable-parse-clocks
#make && make Install
4: The previous step takes approximately 1-3 minutes to install and start configuring the ntp.conf file
#vi/etc/ntp.conf
①, first configuration: Allows clients of any IP to have time synchronization
Change the line "Restrict default Kod nomodify notrap nopeer noquery" to: Restrict default nomodify
②, second configuration: Only allow time synchronization for 135.146.16.*** network segment clients
Add a line after restrict default nomodify notrap noquery (which means time synchronization for all IPs is denied): Restrict 135.146.16.0 mask 255.255.255.0 nomodify
5: Start NTPD
/usr/local/ntp/bin/ntpd-c/etc/ntp.conf-p/tmp/ntpd.pid
After waiting a few minutes, the other server can be synchronized with the 40 server time, the method of synchronization is: Ntpdate 135.146.16.40
The server is configured, and the client is now configured
One: Linux Client Configuration
Vi/var/spool/cron/root
Add a row to synchronize with the time synchronization server 5:13, 9:13, 14:13, 19:13 Daily
5,9,14,19 * * */usr/sbin/ntpdate 192.168.18.2
Two: Solaris Client Configuration
1. Create an NTP client configuration file
# touch/etc/inet/ntp.conf
# chown Root:sys/etc/inet/ntp.conf
2, edit the ntp.conf, set the synchronization time of the server
# vi/etc/inet/ntp.conf
Add server 135.146.16.40 prefer this line
3. Start the NTP service
# Svcadm Enable Svc:/network/ntp:default
4: View boot status
# Svcs Svc:/network/ntp:default
If online is OK, if it appears as maintenance, you need to execute the # Svcadm clear Svc:/network/ntp:default again to see if it is back to normal
5: Wait 1 minutes to view sync status
# ntpq-p
Check every 5 minutes to see that the reach value is constantly getting larger and the disp value is constantly getting smaller, then it works fine.
Set up time synchronization (Linux,solaris)