Ubuntu 22.04
Sponsored Link

NIS : Configure Secondary Server2022/09/09

 
Configure NIS Secondary Server to continue NIS service if NIS Primary server would be down.
+----------------------+          |          +----------------------+
| [    NIS Primary   ] |10.0.0.30 | 10.0.0.31| [    NIS Client    ] |
|     dlp.srv.world    +----------+----------+   client.srv.world   |
|                      |          |          |                      |
+----------------------+          |          +----------------------+
+----------------------+          |
| [   NIS Secondary  ] |10.0.0.51 |
|   node01.srv.world   +----------+
|                      |
+----------------------+

[1]
[2] Configure as a NIS Secondary Server.
root@node01:~#
vi /etc/default/nis
# line 6: change (set NIS secondary)

NISSERVER=
slave
root@dlp:~#
vi /etc/ypserv.securenets
# This line gives access to everybody. PLEASE ADJUST!
# comment out
# 0.0.0.0         0.0.0.0
# ::/0

# add IP range you allow to bind NIS server from NIS clients
255.255.255.0   10.0.0.0

root@node01:~#
systemctl restart rpcbind ypserv

root@node01:~#
systemctl enable rpcbind ypserv

# sync with NIS master server

root@node01:~#
/usr/lib/yp/ypinit -s dlp.srv.world

We will need a few minutes to copy the data from dlp.srv.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 primary server is also required to be a NIS client. Configure NIS primary server as a NIS Client, refer to here.
[4] Configure on NIS primary server for new NIS secondary host.
root@dlp:~#
vi /var/yp/Makefile
# line 23: change

NOPUSH=
false
# update NIS database

root@dlp:~#
/usr/lib/yp/ypinit -m

At this point, we have to construct a list of the hosts which will run NIS
servers.  dlp.srv.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.srv.world
        next host to add:  node01.srv.world   # specify NIS secondary
        next host to add:                     # Ctrl + D key
The current list of NIS servers looks like this:

dlp.srv.world
node01.srv.world

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

.....
.....
dlp.srv.world has been set up as a NIS master server.

Now you can run ypinit -s dlp.srv.world on all slave server.
[5] Configure on NIS Client to bind NIS secondary, too.
root@client:~#
vi /etc/yp.conf
# add secondary server's setting to the end

domain srv.world server dlp.srv.world
domain srv.world server node01.srv.world
root@client:~#
systemctl restart rpcbind nscd ypbind
Matched Content