Modifying Host Names
- Set the host name of each node.
1hostnamectl 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.
- Modify the /etc/hosts file on all nodes based on the network requirements.
- Open the file.
1vi /etc/hosts - 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
- Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
- Open the file.