This topic describes how to configure host information.
Procedure
Perform the following steps to configure the host information on all servers:
Specify the IP address and hostname of the current server in
/etc/hosts.[root@xxx /]# vi /etc/hosts xxx.xxx.xxx.xxx observer1Note
Fill in the actual IP address. The IP address in the sample code is for reference only.
Specify
HOSTNAME=observer1in/etc/sysconfig/network.[root@xxx /]# vi /etc/sysconfig/network HOSTNAME=observer1Specify the hostname in
/etc/hostname.[root@xxx /]# vi /etc/hostname observer1Run the following command to obtain the IP address of the current host:
[root@xxx /]# hostname -i xxx.xxx.xxx.xxx