我要评分
获取效率
正确性
完整性
易理解

Modifying Host Names

  1. Set the host name of each node.
    1
    hostnamectl set-hostname HOSTNAME
    

    HOSTNAME: host name. The value cannot contain special characters including .#$

    After the modification, log in to the OS again for the change to take effect.

  2. Modify the /etc/hosts file on all nodes based on the network requirements.
    1. Open the file.
      1
      vi /etc/hosts
      
    2. Press i to enter the insert mode and add the following content:
      1
      2
      HOSTIP1 HOSTNAME1
      HOSTIP2 HOSTNAME2
      

      HOSTIP: host IP address.

      HOSTNAME: host name.

      For example: 192.168.14.2 controller

    1. Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.