Solved

How to sync time in linux LAN

Posted on 2007-03-27
7
3,256 Views
Last Modified: 2013-12-16
Peace be upon you all
I have no time to spend with searching old answers so how i can synchoronize 3 linux server times.
In simple steps.
0
Comment
Question by:mukhtar2t
7 Comments
 
LVL 4

Expert Comment

by:freaky_NL
ID: 18798841
You need to install ntpd and configure it. It quite simple actually.

You could also setup a cron job to run 'ntpdate -s eu.pool.ntp.org' every so often to sync the time. The daemon (ntpd) is the preferred way tho'.

You provide very little information on distribution and such, therefore I'll leave it up to you to search for docs on your distribution. Almost every distribution has docs on this and almost everyone handles configuration and installation differently
0
 
LVL 1

Expert Comment

by:iamgibbon
ID: 18798850
command line interface guide to setting ntp servers in linux environment can be found here: http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch24_:_The_NTP_Server
hth.
0
 
LVL 4

Expert Comment

by:freaky_NL
ID: 18798854
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 4

Author Comment

by:mukhtar2t
ID: 18798859
Hello freaky_NL
what is information you need to guide me
0
 
LVL 4

Expert Comment

by:freaky_NL
ID: 18798886
Atleast knowing your distribution would be nice.
0
 
LVL 4

Author Comment

by:mukhtar2t
ID: 18798892
Linux main 2.6.9-22.ELsmp #1 SMP Mon Sep 19 18:32:14 EDT 2005 i686 i686 i386 GNU/Linux
0
 
LVL 5

Accepted Solution

by:
suggestionstick earned 500 total points
ID: 18799280
Hi

What Freaky_Nl is looking for is your distribution name for example: redhat enterprise linux 4 or debian sarge or fedora 6

The general ntp guideline is that you sync one of your linux servers against a public time server and then use this ntpd server to sync your other servers time.

Checkout http://www.pool.ntp.org/ for available time servers.

If you can supply us with a distribution we can give you a more detailed install guide, however I have listed a general conf for ntpd below. It's split into 2 sections one conf for the main time server and another for the 2 ntp clients.

a ntpd.conf for your main linux ntp server

# default restrictions
restrict default noquery notrust nomodify

# override the default restrictions here for your other 2  Linux server boxes
restrict  1.2.3.4 mask 255.255.255.255 nomodify  
restrict  1.2.3.5 mask 255.255.255.255 nomodify

# public NTP servers to sync with
server Public-timeserver1
server Public-timeserver2

restrict Public-timeserver1 noquery nomodify
restrict Public-timeserver2 noquery nomodify


# NTP drift file - used to keep track of your system clocks
# time deviation
driftfile /etc/ntp.drift

# NTP log file
logfile /var/log/ntp.log


example config file for your other linux boxes


# default restrictions
restrict default noquery notrust nomodify

# Permit all access over the loopback interface
restrict 127.0.0.1

# public NTP servers to sync with
server FQDN-of-your primary-ntp-server


restrict  FQDN-of-your primary-ntp-server noquery nomodify

# NTP drift file - used to keep track of your system clocks
# time deviation
driftfile /etc/ntp.drift

# NTP log file
logfile /var/log/ntp.log




Trev
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
AWS - HAProxy- KeepAlived 5 43
Mac OS X - Quickest way to delete a folder & all 35000 files in it 3 54
su - oracle could not open session 6 79
Coding C# in Linux 8 71
Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

823 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question