This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Mapping new IP addresses

There are times when nodes of an existing, operational Vertica database cluster require new IP addresses.

There are times when nodes of an existing, operational Vertica database cluster require new IP addresses. Cluster nodes might also need to run based on different IP protocols, for example, when changing the protocol from broadcast to point-to-point.

To change the IP addresses of hosts in your database cluster, use the re_ip function to re-IP and map old addresses to the new ones:

$ admintools -t re_ip -f mapfile

The mapfile references the file that you create, which contains the old and new IP addresses.

Use this function to re-IP in one of the following situations:

  • If your Vertica database cluster has the same data and control messaging address, do one of the following:

    • Re-IP all the database cluster node IP addresses.

    • Re-IP only one or some of the database cluster node IP addresses.

    $ admintools -t re_ip -f mapfile
    
  • Re-IP the Vertica database cluster from broadcast mode to point-to-point (unicast) mode:

    $ admintools -t re_ip -d dbname -T
    
  • Re-IP the Vertica database cluster from point-to-point (unicast) mode to broadcast mode :

    $ admintools -t re_ip -d dbname -U
    
  • Re-IP the control address of the database cluster. In this case the mapping file must contain the control messaging IP address and associated broadcast address.

    $ admintools -t re_ip -f mapfile
    
  • Re-IP only one database address without changing the admintools configuration. See Mapping IP Addresses on the Database only.

For more information on the options used in the above commands, see Re-IP command-line options.

Re-IP and the export IP address

By default, the node IP address and the export IP address are configured with the same IP address. The export address is the IP address of the node on the network with access to other DBMS systems. Use the export address for importing and exporting data from DBMS systems. You can manually change the export address using the instructions found here.

If you change the export address and run the re-ip command, the export address remains the same.

Example

Run the following command:

=> SELECT node_name, node_address, export_address FROM nodes;
    node_name      | node_address    | export_address
------------------------------------------------------
v_VMartDB_node0001 | 192.168.100.101 | 192.168.100.101
v_VMartDB_node0002 | 192.168.100.102 | 192.168.100.101
v_VMartDB_node0003 | 192.168.100.103 | 192.168.100.101
v_VMartDB_node0004 | 192.168.100.104 | 192.168.100.101
(4 rows)

In the above example the export_address is the default. In this case, when you run the re-ip command the export_address changes to the new node_address.

If you manually change the export address as described here, you may have something like the following:

=> SELECT node_name, node_address, export_address FROM nodes;
    node_name      | node_address    | export_address
------------------------------------------------------
v_VMartDB_node0001 | 192.168.100.101 | 10.10.10.1
v_VMartDB_node0002 | 192.168.100.102 | 10.10.10.2
v_VMartDB_node0003 | 192.168.100.103 | 10.10.10.3
v_VMartDB_node0004 | 192.168.100.104 | 10.10.10.4
(4 rows)

In this case, when you run the re-ip command the export_address does not change.

Finding IP addresses

IP addresses for the hosts and nodes are stored in opt/vertica/config/admintools.conf:

[Cluster]
hosts = 203.0.113.111, 203.0.113.112, 203.0.113.113

[Nodes]
node0001 = 203.0.113.111/home/dbadmin,/home/dbadmin
node0002 = 203.0.113.112/home/dbadmin,/home/dbadmin
node0003 = 203.0.113.113/home/dbadmin,/home/dbadmin

You can also display a list of IP addresses with the following:

$ admintools -t list_allnodes
Node             | Host          | State | Version        | DB
-----------------+---------------+-------+----------------+-----------
v_vmart_node0001 | 203.0.113.111 | UP    | vertica-10.1.1 | VMart
v_vmart_node0002 | 203.0.113.112 | UP    | vertica-10.1.1 | VMart
v_vmart_node0003 | 203.0.113.113 | UP    | vertica-10.1.1 | VMart

1 - Re-IP addresses with a mapping file

Mapping new IP addresses includes:.

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 use control messaging for communication between hosts, you might also need to update IPs with new controlAddress and controlBroadcast IP addresses.

Create a mapping file

Create a mapping file as follows:

  1. Get the new IP addresses and save them in a text file.

  2. Get the old IP addresses with list_allnodes:

    $ admintools -t list_allnodes
    Node             | Host          | State | Version        | DB
    -----------------+---------------+-------+----------------+-----------
    v_vmart_node0001 | 192.0.2.254   | UP    | vertica-10.1.1 | VMart
    v_vmart_node0002 | 192.0.2.255   | UP    | vertica-10.1.1 | VMart
    v_vmart_node0003 | 192.0.2.256   | UP    | vertica-10.1.1 | VMart
    
  3. Copy the contents of the Host column into the text file where you saved the new IP addresses, in this format:

    oldIPaddress newIPaddress
    

    For example:

    192.0.2.254 198.51.100.255
    192.0.2.255 198.51.100.256
    192.0.2.256 198.51.100.257
    
  4. Use the text file to create a mapping file that you can use to perform one of these tasks:

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

  1. Create a mapping file that uses this format:

    oldIPaddress newIPaddress[, controlAddress, controlBroadcast]
    

    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
    

    controlAddress and controlBroadcast are optional. If omitted:

    • controlAddress defaults to the newIPaddress.

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

  2. Run re_ip 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

  1. Create a mapping file that uses this format:

    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
    
  2. Run re_ip and change the control messaging mode as follows:

    • Change control messaging mode to point-to-point:

      $ admintools -t re_ip -d db name -T
      
    • Change control messaging mode to broadcast:

      $ admintools -t re_ip -d db name -U
      

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

Re-IP the node control address on the database only

  1. Create a mapping file that uses this format:

    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
    
  2. Run re_ip as follows:

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

For details, see Mapping IP Addresses on the Database below.

Re-IP 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 re-ip to map old IP addresses to new IP addresses:

    $ admintools -t re_ip -f mapfile
    

    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_ip performs the following tasks:

    • Remaps 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 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

You can map IP addresses for the database only. 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:

    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
    
  4. Restart the database.

2 - Re-IP command-line options

re_ip supports the following options:.

re_ip supports the following options:

-h --help
Displays the online help for re_ip.
-f mapfile --file=mapfile
Name of the mapping text file. The file contents depend on the type of re-IP operation. See .
-O --dba-only
Used for error recovery, updates and replaces data on the database cluster catalog and control messaging system. If the map text file fails, Vertica automatically recreates it when you re-run the command. The format of the map text file is:
NodeName AssociatedNodeIPAddress, new ControlAddress, new ControlBroadcast

NodeName and AssociatedNodeIPAddress must be the same as in admintools.conf.

This option updates only one database at a time so it requires the -d option:

$ admintools -t re_ip -f mapfile -O -d database
-i --noprompts
Specifies that the system does not prompt for the validation of the new settings before executing the re-IP operation. Prompting is on by default.
-T --point-to-point
Sets control messaging to the point-to-point (unicast) protocol. This option updates only one database at a time so so it requires the -d option. This option does not require a mapping text file.
-U --broadcast
Sets the control messaging to broadcast protocol. This option updates only one database at a time so you must use the -d option. You do not need a mapping text file with this option.
-d database name --database=database name
The database name, required with the following re-IP options:
  • -O

  • -T

  • -U

3 - Restarting a node with new host IPs

For information about remapping node IP addresses on a non-Kubernetes database, see Mapping New IP Addresses.

Kubernetes only

The node IP addresses of an Eon Mode database on Kubernetes must occasionally be updated—for example, a pod fails, or is added to the cluster or rescheduled. When this happens, you must update the Vertica catalog with the new IP addresses of affected nodes and restart the node.

Vertica's restart_node tool addresses these requirements with its --new-host-ips option, which lets you change the node IP addresses of an Eon Mode database running on Kubernetes, and restart the updated nodes. Unlike remapping node IP addresses on other (non-Kubernetes) databases, you can perform this task on individual nodes in a running database:

admintools -t restart_node \
  {-d db-name |--database=db-name} [-p password | --password=password] \
  {{-s nodes-list | --hosts=nodes-list} --new-host-ips=ip-address-list}
  • nodes-list is a comma-delimited list of nodes to restart. All nodes in the list must be down, otherwise admintools returns an error.

  • ip-address-list is a comma-delimited list of new IP addresses or hostnames to assign to the specified nodes.

The following requirements apply to nodes-list and ip-address-list:

  • The number of node hosts and IP addresses or hostnames must be the same.

  • The lists must not include any embedded spaces.

For example, you can restart node v_k8s_node0003 with a new IP address:

$ admintools -t list_allnodes
  Node           | Host       | State    | Version        | DB
 ----------------+------------+----------+----------------+-----
  v_k8s_node0001 | 172.28.1.4 | UP       | vertica-10.1.1 | K8s
  v_k8s_node0002 | 172.28.1.5 | UP       | vertica-10.1.1 | K8s
  v_k8s_node0003 | 172.28.1.6 | DOWN     | vertica-10.1.1 | K8s

$ admintools -t restart_node -s v_k8s_node0003 --new-host-ips 172.28.1.7 -d K8s
 Info: no password specified, using none
*** Updating IP addresses for nodes of database K8s ***
        Start update IP addresses for nodes
         Updating node IP addresses
         Generating new configuration information and reloading spread
*** Restarting nodes for database K8s ***
         Restarting host [172.28.1.7] with catalog [v_k8s_node0003_catalog]
         Issuing multi-node restart
         Starting nodes:
                 v_k8s_node0003 (172.28.1.7)
         Starting Vertica on all nodes. Please wait, databases with a large catalog may take a while to initialize.
         Node Status: v_k8s_node0003: (DOWN)
         Node Status: v_k8s_node0003: (DOWN)
         Node Status: v_k8s_node0003: (DOWN)
         Node Status: v_k8s_node0003: (DOWN)
         Node Status: v_k8s_node0003: (RECOVERING)
         Node Status: v_k8s_node0003: (UP)
$ admintools -t list_allnodes
  Node           | Host       | State | Version        | DB
 ----------------+------------+-------+----------------+-----
  v_k8s_node0001 | 172.28.1.4 | UP    | vertica-10.1.1 | K8s
  v_k8s_node0002 | 172.28.1.5 | UP    | vertica-10.1.1 | K8s
  v_k8s_node0003 | 172.28.1.7 | UP    | vertica-10.1.1 | K8s