Book Contents

Book Index

Next Topic

Home

Configure Hostname Resolution

It is essential that the hostnames of the hosts used in creating a cluster resolve correctly. Invalid hostname resolution is a very common source of configuration problems. Your Vertica database will not install or work properly unless the hostname resolution is correct.

Setting Up Cluster Hosts

This procedure sets up the minimal hostname resolution required for a Vertica installation.

On each host machine that will become part of the database cluster:

  1. Make sure that the /etc/hosts file includes all of the hosts that will become part of the cluster. For example, if the hosts are named host01, host02, host03, and host04, the /etc/hosts file on each host should look like this:

    # Do not remove the following line, or various programs

    # that require network functionality will fail.

    127.0.0.1 localhost.localdomain localhost

    192.168.13.128 host01

    192.168.13.129 host02

    192.168.13.130 host03

    192.168.13.131 host04

    Replace the example IP addresses shown here with the real ones. Do not remove the loopback address (127.0.0.1).

  2. Make sure that the host identifies itself correctly. For example, on host01:

    # /bin/hostname -f

    localhost.localdomain

    localhost.localdomain is incorrect. In this case, you must set the hostname manually:

    # /bin/hostname host01

    # /bin/hostname -f

    host01

  3. Ping the host. For example:

    # ping host01

    PING host01 (192.168.13.128) 56(84) bytes of data.

    64 bytes from host01 (192.168.13.128): icmp_seq=0 ttl=64 time=0.086 ms

  4. Compare the ping command output to the hostname. The output of the hostname command must be identical to that of the ping command.

    Question for reviewers:
    Also make changes to /etc/sysconfig/network?
    What else can go wrong?

Setting the HOSTNAME Environment Variable

Some Linux installations require the HOSTNAME environment variable to be set correctly.

On each host machine that will become part of the database cluster:

  1. If the HOSTNAME environment variable is not defined, add the following line to your /root/.profile or /root/.bashrc file:

    export HOSTNAME=`hostname`

  2. If the HOSTNAME environment variable is already defined, make sure that it matches the hostname output:

    # echo $HOSTNAME

    host01

    If they do not match, change the value of HOSTNAME in /root/.profile or /root/.bashrc:

    export HOSTNAME=`/bin/hostname -f`

Important Notes

Examples

In this example, the machines in the cluster are tristan, isolde and kurwenal. The Administration Tools are running on tristan.

  1. Correct resolution:

    # /bin/hostname -f

    tristan.brittany.com

    # ping tristan

    Pinging tristan [192.168.0.50] with 32 bytes of data:

    Reply from tristan.brittany.com: bytes=32 time<1ms TTL=128

    Use the fully qualified domain name tristan.brittany.com in the cluster definition.

  2. Correct resolution:

    # ssh isolde hostname -f

    isolde

    # ping isolde

    Pinging isolde [192.168.0.51] with 32 bytes of data:

    Reply from isolde: bytes=32 time<1ms TTL=128

    You can use the short hostname isolde in the cluster definition for convenience.

  3. Incorrect resolution:

    # ssh kurwenal hostname -f

    kurwenal

    # ping kurwenal

    Pinging kurwenal [192.168.0.52] with 32 bytes of data:

    Reply from 192.168.0.52: bytes=32 time<1ms TTL=128

    The ping command output does not match the /bin/hostname -f output. Thus, the host machine kurwenal is not correctly configured and cannot be used in the cluster definition.