Product SiteDocumentation Site

2.4.3. Short Node Names

During installation, we filled in the machine’s fully qualifier domain name (FQDN) which can be rather long when it appears in cluster logs and status output. See for yourself how the machine identifies itself:
# uname -n
pcmk-1.clusterlabs.org
# dnsdomainname clusterlabs.org
The output from the second command is fine, but we really don’t need the domain name included in the basic host details. To address this, we need to update /etc/sysconfig/network. This is what it should look like before we start.
# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=pcmk-1.clusterlabs.org
GATEWAY=192.168.122.1
All we need to do now is strip off the domain name portion, which is stored elsewhere anyway.
 # sed -i.bak 's/\.[a-z].*//g' /etc/sysconfig/network
Now confirm the change was successful. The revised file contents should look something like this.
# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=pcmk-1
GATEWAY=192.168.122.1
However we’re not finished. The machine wont normally see the shortened host name until about it reboots, but we can force it to update.
# source /etc/sysconfig/network
# hostname $HOSTNAME
Now check the machine is using the correct names
# uname -npcmk-1
# dnsdomainname clusterlabs.org
Now repeat on pcmk-2.