Changing node 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 use control messaging for communication between hosts, you might also need to update IPs with new controlAddress and controlBroadcast IP addresses.
Important
re_ip does not change export addresses and any functionality that relies on them. Before running re_ip, check whether you need to update the subnet, network interface, load balance groups, and load balancing rules to match the new IPs. Mismatches can lead to load balancing or import/export failures.
Create a mapping file
Create a mapping file as follows:
-
Get the new IP addresses and save them in a text file.
-
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 -
Copy the contents of the
Hostcolumn into the text file where you saved the new IP addresses, in this format:oldIPaddress newIPaddressFor 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 -
Use the text file to create a mapping file that you can use to perform one of these tasks:
-
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.255controlAddressandcontrolBroadcastare optional. If omitted:-
controlAddressdefaults tonewIPaddress. -
controlBroadcastdefaults to the host ofnewIPaddress’s broadcast IP address.
-
-
Run
re_ipas follows:$ admintools -t re_ip -f mapfile
Update IP addresses and change control messaging mode
-
Create a mapping file that uses this format:
oldIPaddress newIPaddress, controlAddress, controlBroadcastFor 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 -
Run
re_ipand change the control messaging mode as follows:-
Change control messaging mode to point-to-point:
$ admintools -t re_ip -d dbname -T -
Change control messaging mode to broadcast:
$ admintools -t re_ip -d dbname -UThe embedded messages subsystem operates based on the
controlAddressandcontrolBroadcastIPs when you use the -U option.
-
Change database node control addresses
-
Create a mapping file that uses this format:
nodeName nodeIPaddress, controlAddress, controlBroadcastFor 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 -
Run
re_ipas follows:$ admintools -t re_ip -f mapfile -O -d dbname
For details, see Mapping IP Addresses on the Database below.
Update IP addresses
After creating a mapping file, you can update IP addresses with re_ip. re_ip automatically backs up admintools.conf so you can recover the original settings if necessary.
-
Stop the database.
-
Run
re_ipto map old IP addresses to new IP addresses:$ admintools -t re_ip -f mapfilere_ipissues warnings for the following mapping file errors:-
IP addresses are incorrectly formatted.
-
Duplicate IP addresses, whether old or new.
If
re_ipfinds no syntax errors, it performs the following tasks:-
Remaps the IP addresses as listed in the mapping file.
-
If the
-ioption is omitted, asks to confirm updates to the database. -
Updates required local configuration files with the new IP addresses.
-
Distributes the updated configuration files to the hosts using new IP addresses.
For example:
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. -
-
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 different data and controlAddress.
-
Stop the database.
-
Create a mapping file in the following format:
nodeName nodeIPaddress, controlAddress, controlBroadcastFor 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 -
Run the following command to map the new IP addresses:
$ admintools -t re_ip -f mapfile -O -d dbname -
Restart the database.