-
Notifications
You must be signed in to change notification settings - Fork 0
IP Address Change
-
Dump the hostfile
# stack report hostfile > stacki.hosts.csv
-
Dump /etc/hosts
# stack report host > hosts.stacki
-
Dump network config
# stack report networkfile > networks.stacki
-
Open network file, and add a new line. Change the file from
NETWORK,ADDRESS,MASK,GATEWAY,MTU,ZONE,DNS,PXE private,192.168.16.0,255.255.240.0,192.168.16.1,1500,stacki.com,False,True
to
NETWORK,ADDRESS,MASK,GATEWAY,MTU,ZONE,DNS,PXE private,10.2.0.0,255.255.255.0,10.2.0.1,1500,stacki.com,False,True oldprivate,192.168.16.0,255.255.240.0,192.168.16.1,1500,stacki.com,False,False
Note that this moved original private to oldprivate. The private line now contains new network information, including new Address, Mask, and Gateway
-
Open
hosts.csv
file, and change the IP addresses of the hosts from original to new.
-
Import the
network.csv
file into the database# stack load networkfile file=networks.csv
-
Import the
hosts.csv
file.# stack load hostfile file=hosts.csv
This might throw out an error message saying
error - host frontend is not in cluster
This error occurs because of a mismatch between IP address recorded in the database, and IP address of the NIC itself. It's OK to ignore this error message for now.
-
Reset the bootactions of all hosts.
# stack set host boot backend action=os # stack sync config # stack sync host config
-
Open the /etc/hosts file.
You should see old IP addresses for all hosts. This is currently showing incorrect information since, all the hosts still have their old networking information.
NOTE
During a switch-over of IP addresses, there will be many instances where the information in the database, will be inconsistent with information in the/etc/hosts
file, which in turn will be inconsistent with the status of the nodes. This might cause network connectivity issues. -
The /etc/hosts file has old IP addresses for all hosts. Move this to another location.
-
Copy over the ORIGINAL /etc/hosts file that was backed up.
-
In this file, change only the IP address of the frontend to the new IP address. Leave all the others IP addresses still pointing to the old IP addresses.
NOTE
This is required for thestack
command line to function correctly.Copy this version of
/etc/hosts
file to a safe location. this will need to be used again. Call it/tmp/etc.hosts.unstable
-
Next, change the networking files on the backend nodes.
# stack sync host network backend restart=no
This will change all networking files on the backend nodes, but will not restart the networking.
This means that the networking files, such as
/etc/sysconfig/network
,/etc/sysconfig/network-scripts/ifcfg-*
files have information in them, that is inconsistent with the running configuration of the hosts. -
The previous step will have rewritten the
/etc/hosts
file. Copy over the/tmp/etc.hosts.unstable
file back to/etc/hosts
-
Reset the networking of all hosts.
If you have console access to all backend hosts, instead of running the
stack run host
command, log into each hosts' console, and run# service network restart
If you don't have console access to the hosts, or if you have a large number of hosts, you can try to run the following -
# stack run host backend command="service network restart"
This will change the IP address of backend hosts, and the command will lose connectivity, and will not return. After about a minute, hit
Ctrl-C
to kill thestack run host
command. -
Reset the networking for the frontend.
IMPORTANT
Make sure that you have console access to the frontend. Do not run these commands over SSH. You will lose connectivity.# stack sync host network <frontend> restart=no # service network restart
-
Your networks, for backends and the frontend, should be fully configured, and accessible over the new IP space.
-
Test to see if you have connectivity between frontend and backend hosts
-
Test to see if you have connectivity to the frontend from an external host.
Checkout our Google Group or our Slack Team for any support or other questions.
Want to contribute to this Wiki? Fork it and send a pull request.