Situation: You have NIS Master, you need a slave setup in your office.
This tutorial is covering steps for Redhat/CentOS/Fedora 64 bits. It might differ from what you have seen online.
1. Install ypserv in your server
yum install -y ypserv.x86_64
2. Start the services
service ypserv start
service ypxfrd start
3. Verify the yp is ready
#rpcinfo -u localhost ypserv
program 100004 version 1 ready and waiting
program 100004 version 2 ready and waiting
4. Copy the database fro Master
/usr/lib/yp/ypinit -s master_domain_name
or
/usr/lib64/yp/ypinit -s master_domain_name
5. edit /etc/yp.conf
ensure you have the new slave hostname set is primary
6. Test
ypcat -k passwd | grep userid
7. Never forget to turn on
chkconfig ypserv on
chkconfig ypxfrd on
How to keep the database in sync?
1. Master push , this can be done via master. You can find it here
2.Slave pull from Master.
/usr/lib64/yp/
either one will do:
ypxfr_1perday ypxfr_1perhour ypxfr_2perday
Run this at your crontab