Moving the Master Server to a Different Host

Once you have NIS configured on your network, your security, performance, or other needs may change. You may want to move the master server configuration to a different host, perhaps one that is more secure or offers greater performance. To do so, use the following procedure:

  1. Copy all the map input files (not the map files themselves) from the old master server host to the new master server host. In the case of the ypservers map, there is no input file to copy. To create a temporary ypservers map input file, do the following on the old master server host:
    1. Change to the /var/yp directory by entering:
      cd /var/yp
    2. Enter the command:
      makedbm -u domain/ypservers > tmpservers
      where domain specifies the name of this NIS domain. This sends the contents of the current ypservers map to a file called tmpservers.
    3. Edit the tmpservers file, and change the name of the master server from the old master server host to the new master server host. For example, if the tmpservers file contains the line:
      YP_MASTER_NAME old_master

      change this line to:

      YP_MASTER_NAME new_master
    4. Save the file and exit the editor.
    5. Copy the tmpservers file to the /var/yp directory on the new master server host.
  2. Configure the new master server host by following the instructions in Configuring the NIS Master Server.
  3. On the new master server host, enter:
    cd /var/yp
    Then, enter the commands:
    makedbm - tmpservers < tmpservers
    mv tmpservers.pag domain/ypservers.pag
    mv tmpservers.dir domain/ypservers.dir
  4. On each of the worker servers, enter the smit ypxfr fast path. Specify ypservers in the Name of the MAP to be transferred field, and specify the hostname of the new master server host in the HOSTNAME of the master server field.
  5. Exit SMIT to retrieve the updated ypservers map from the new master server host.
  6. Propagate the rest of the newly rebuilt maps by following the instructions in Propagating an NIS Map.
  7. If you are using the ypservers file to avoid broadcasts, you may need to change the internet address in the file on the clients. See Avoiding Broadcasts.