Linux

Synchronizing filesystems with rsync

Synchronizing multiple boxes can be important for multiple reasons, high-availability, disaster recovery, poor mans backups, etc... Here is a quick tutorial on using rsync to synchronize a couple of boxes. In this example one box is the master one is the slave. WARNING, this approach isn't the most secure... you should look into the auth users option, especially if you are doing this on the Internet and not your internal network.

On the slave, create a /etc/rsyncd.conf file with these contents:
[mirror1]
path = /place/to/mirror/to1
uid = SYNCUSER
gid = SYNCGROUP

Incorrect timezone on a Linux box

To correct the timezone on a Linux box you need to get the correct /etc/localtime file. Here is how you would set a Centos box to Central time:

cp /usr/share/zoneinfo/US/Central /etc/localtime

Time won't sync with NTP server on linux

I am throwing this one out there as I have seen it bite a few people in the past. You realize your system time is way off and setup ntp and get it running but the system time never updates... You have verified the config and ntp is setup properly. The most likely cause is the fact that ntpd won't correct massive clock skew. If you are off by a great deal you will have to get it in sync manually then ntpd will keep it in sync going forward. This is how you would deal with a clock skew on centos:

yum install ntp
chkconfig ntpd on
ntpdate 0.rhel.pool.ntp.org
/etc/init.d/ntpd start

NFS exports on solaris

I have been using Linux so long that I constantly forget how to do the same operations on a Solaris box, and NFS is definitely different. So here's a note so I don't forget, hope it's useful to someone else.

Linux (redhat/centos):
edit /etc/exports
/etc/init.d/nfs reload

Solaris:
edit /etc/dfs/dfstab
shareall

Syndicate content