Total de visualizações de página

segunda-feira, 18 de abril de 2016

Configure NIS Slave Server to continue NIS service if NIS


Configure NIS Slave Server to continue NIS service if NIS master server would be down.
+----------------------+          |          +----------------------+
| [    NIS Server    ] |10.0.0.30 | 10.0.0.31| [    NIS Client    ] |
|   dlp.server.world   +----------+----------+   www.server.world   |
|                      |          |          |                      |
+----------------------+          |          +----------------------+
+----------------------+          |
| [     NIS Slave    ] |10.0.0.50 |
|  slave.server.world  +----------+
|                      |
+----------------------+

[1]
[2]Install and Configure Ypserv on NIS Slave Server.
[root@slave ~]# 
yum -y install ypserv rpcbind
# set NIS domain

[root@slave ~]# 
ypdomainname server.world 

[root@slave ~]# 
echo "NISDOMAIN=server.world" >> /etc/sysconfig/network 

[root@slave ~]# 
vi /var/yp/securenets
# create new (specify networks you allow to access)

255.0.0.0       127.0.0.0
255.255.255.0   10.0.0.0

[root@slave ~]# 
vi /etc/hosts
# add NIS servers and clients' IP

10.0.0.30   dlp.server.world dlp
10.0.0.50   slave.server.world slave

[root@slave ~]# 
systemctl start rpcbind ypserv ypxfrd yppasswdd 

[root@slave ~]# 
systemctl enable rpcbind ypserv ypxfrd yppasswdd
# sync with NIS master server

[root@slave ~]# 
/usr/lib64/yp/ypinit -s dlp.server.world 

We will need a few minutes to copy the data from dlp.server.world.
Transferring group.bygid...
Trying ypxfrd ... success
...
...
At this point, make sure that /etc/passwd and /etc/group have
been edited so that when the NIS is activated, the data bases you
have just created will be used, instead of the /etc ASCII files.
[3]
NIS master server is also required to be a NIS client. Configure NIS master server as a NIS Client, refer to here.
[4]Configure on NIS master server for new NIS Slave.
[root@dlp ~]# 
vi /var/yp/Makefile
# line 23: change

NOPUSH=
false
# update NIS database

[root@dlp ~]# 
/usr/lib64/yp/ypinit -m 

At this point, we have to construct a list of the hosts which will run NIS
servers.  dlp.server.world is in the list of NIS server hosts.  Please continue to add
the names for the other hosts, one per line.  When you are done with the
list, type a <control D>.
        next host to add:  dlp.server.world
        
# specify NIS slave

        next host to add: 
slave.server.world

        next host to add: 
# Ctrl + D key

The current list of NIS servers looks like this:

dlp.server.world
slave.server.world

Is this correct? [y/n: y] 
y

We need a few minutes to build the databases...
Building /var/yp/server.world/ypservers...
...
...
Now you can run ypinit -s dlp.server.world on all slave server.
[5]Configure on NIS Client to bind NIS slave, too.
[root@www ~]# 
vi /etc/yp.conf
# add slave server's setting to the end

domain server.world server dlp.server.world
domain server.world server slave.server.world
[root@www ~]# 
systemctl restart ypbind

Nenhum comentário:

Postar um comentário