Re-IP Addresses with a Mapping File

Mapping new IP addresses includes:

  • Creating a mapping file that maps the old IP addresses to the new IP addresses.
  • Using the mapping file to update configuration files and the database catalog.

If you are using control messaging for communication between hosts, you may also need to update IPs with the new controlAddress and controlBroadcast IP addresses.

The embedded messages subsystem operates based on the controlAddress IP and controlBroadcast IP when you use the -U option.

Create Mapping File

Before creating a mapping file you need to know the new IP addresses. Create a mapping file as follows:

  1. If you do not already have them, obtain the new IP addresses and save them in a text file. You can save the file anywhere on your system.
  2. Run the following command to obtain the old IP addresses.
    $ admintools -t list_allnodes
    Node             | Host          | State | Version                | DB
    -----------------+---------------+-------+------------------------+-----------
    v_vmart_node0001 | 192.0.2.254   | UP    | vertica-8.1.1.20170511 | VMart
    v_vmart_node0002 | 192.0.2.255   | UP    | vertica-8.1.1.20170511 | VMart
    v_vmart_node0003 | 192.0.2.256   | UP    | vertica-8.1.1.20170511 | VMart
  3. Copy the contents of the Host column into the same text file as the new IP addresses. The file is in the format old address, new address:
    192.0.2.254 198.51.100.255
    192.0.2.255 198.51.100.256
    192.0.2.256 198.51.100.257

You can have the following map file formats:

Re-IP from an old IP address to a new IP address:

oldIPaddress newIPaddress, controlAddress (optional), controlBroadcast (optional)

In this scenario, the controlAddress and controlBroadcast are optional. If you do not include them in the map file:

  • The controlAddress defaults to the newIPaddress.
  • The controlBroadcast defaults to the host of the newIPaddress’s broadcast IP address.

For example:

192.0.2.254 198.51.100.255, 198.51.100.255, 203.0.113.255
192.0.2.255 198.51.100.256, 198.51.100.256, 203.0.113.255
192.0.2.256 198.51.100.257, 198.51.100.257, 203.0.113.255

The command for performing this Re-IP process is as follows:

$ admintools -t re_ip -f <mapfile>

Re-IP from an old IP address to a new IP address and change the control messaging mode

oldIPaddress newIPaddress, controlAddress, controlBroadcast

For example:

192.0.2.254 198.51.100.255, 203.0.113.255, 203.0.113.258
192.0.2.255 198.51.100.256, 203.0.113.256, 203.0.113.258
192.0.2.256 198.51.100.257, 203.0.113.257, 203.0.113.258

Note that the map file uses comma separators after the new IP address and controlAddress.

The command for performing this re-IP process and changing the control messaging mode to point-to-pont is as follows:

$ admintools -t re_ip -d db name -T

The command for performing this re-IP process and changing the control messaging mode to broadcast is as follows:

$ admintools -t re_ip -d db name -U

Re-IP the node control address on the database only (see Mapping IP Addresses on the Database only).

nodeName nodeIPaddress controlAddress, controlBroadcast

For example:

v_vmart_node0001 192.0.2.254, 203.0.113.255, 203.0.113.258
v_vmart_node0002 192.0.2.255, 203.0.113.256, 203.0.113.258
v_vmart_node0003 192.0.2.256, 203.0.113.257, 203.0.113.258

The command for performing database-only re-IP is as follows:

$ admintools -t re_ip -f <mapfile> -O -d database

Re-IP the IP Addresses

After creating the mapping file you can re-IP the new IP addresses. The re-IP process automatically backs up admintools.conf so you can recover the original settings if necessary.

  1. Stop the database.
  2. Run the following command to map the old IP addresses to the new IP addresses:
    $ admintools -t re_ip -f mapfile

    This example uses the command for performing a re-IP from an old IP address to a new IP address.

    A warning occurs if:

    • Any of the IP addresses is incorrectly formatted
    • a duplicate old or new IP address exists in the file. For example, 192.0.2.256 appears twice in the old IP set.

    If the syntax is correct and mapping begins:

    • Re-maps the IP addresses as listed in the mapping file.
    • Prompts you to confirm the updates to the database, unless you use the -i option.
    • Updates the required local configuration files with the new IP addresses.
    • Distributes the updated configuration files to the hosts using the new IP addresses.

    Track these steps using the following prompts:

    Parsing mapfile...
    New settings for Host 192.0.2.254 are:
    
    address: 198.51.100.255
    
    New settings for Host 192.0.2.255 are:
    
    address: 198.51.100.256
    
    New settings for Host 192.0.2.254 are:
    
    address: 198.51.100.257
    
    The following databases would be affected by this tool: Vmart
    
    Checking DB status ...
    Enter "yes" to write new settings or "no" to exit > yes
    Backing up local admintools.conf ...
    Writing new settings to local admintools.conf ...
    
    Writing new settings to the catalogs of database Vmart ...
    The change was applied to all nodes.
    Success. Change committed on a quorum of nodes.
    
    Initiating admintools.conf distribution ...
    Success. Local admintools.conf sent to all hosts in the cluster.					
  3. Restart the database.

Mapping IP Addresses on the Database only

You can map IP addresses for just the database. This task involves mapping the name of the nodes in the database to the new IP addresses. This is useful for error recovery because admintools.conf does not get updated. Vertica updates only spread.conf and the catalog with the changes.

You can also map IP addresses on the database only to set controlAddress and controlBroadcast on a single database. This task allows nodes on the same host to have a different data and controlAddress.

  1. Stop the database.
  2. Create a mapping file in the following format:
    nodeName IPaddress, controlAddres, controlBroadcast

    For example:

    192.0.2.254, 203.0.113.255, 203.0.113.258 192.0.2.256, 203.0.113.257, 203.0.113.258

    vertica_node001 192.0.2.254, 203.0.113.255, 203.0.113.258
    vertica_node002 192.0.2.255, 203.0.113.256, 203.0.113.258
    vertica_node003 192.0.2.256, 203.0.113.257, 203.0.113.258
  3. Run the following command to map the new IP addresses:
    $ admintools -t re_ip -f <mapfile> -O -d database
  1. Restart the database.