Infrastructure IP address migration¶
Infrastructure IP address migration involves updating configuration files and system service parameters to reflect changes in IP addresses. This process typically requires restarting services to ensure changes take effect^[600-developer-operation-maintenance-zabbix-zabbix-agentd.md].
Procedure¶
The migration process for Linux environments involves creating backups of configuration files, performing replacements using sed, and restarting services^[600-developer-operation-maintenance-zabbix-zabbix-agentd.md].
Zabbix agent configuration¶
For the Zabbix Agent, the configuration file located at /etc/zabbix/zabbix_agentd.conf must be modified^[600-developer-operation-maintenance-zabbix-zabbix-agentd.md]. The procedure is as follows:
- Backup: Create a timestamped backup of the original file^[600-developer-operation-maintenance-zabbix-zabbix-agentd.md].
cp /etc/zabbix/zabbix_agentd.conf /etc/zabbix/zabbix_agentd.conf.20180810 - Update IP: Use
sedto replace the old IP address with the new one within theServerparameter^[600-developer-operation-maintenance-zabbix-zabbix-agentd.md].sed -i 's/Server=zabbix.mypay1.com/Server=zabbix.mypay1.com,10.140.0.23/g' /etc/zabbix/zabbix_agentd.conf - Verify: Confirm the change using
grep^[600-developer-operation-maintenance-zabbix-zabbix-agentd.md].cat /etc/zabbix/zabbix_agentd.conf | grep mypay - Restart: Restart the service to apply changes^[600-developer-operation-maintenance-zabbix-zabbix-agentd.md].
systemctl restart zabbix-agent.service
Service Configuration (e.g., Tomcat)¶
Application service configurations, such as those found in /etc/systemd/system/tomcat.service, also require updates^[600-developer-operation-maintenance-zabbix-zabbix-agentd.md].
- Backup: Copy the service file to a backup version^[600-developer-operation-maintenance-zabbix-zabbix-agentd.md].
- Update: Replace the specific IP string (e.g.,
35.229.223.31) with the new address (e.g.,10.140.0.242)^[600-developer-operation-maintenance-zabbix-zabbix-agentd.md].sed -i "s/35.229.223.31/10.140.0.242/g" /etc/systemd/system/tomcat.service - Reload and Restart: Because systemd files are modified, you must run
daemon-reloadbefore restarting the service^[600-developer-operation-maintenance-zabbix-zabbix-agentd.md].systemctl disable tomcat.service systemctl enable tomcat.service systemctl daemon-reload systemctl restart tomcat.service
Windows Environments¶
For Windows servers, configuration changes are followed by restarting services via the command line^[600-developer-operation-maintenance-zabbix-zabbix-agentd.md].
- Zabbix Agent:
net stop "Zabbix Agent" net start "Zabbix Agent" - Tomcat:
net stop Tomcat8 net start Tomcat8
Sources¶
^[600-developer-operation-maintenance-zabbix-zabbix-agentd.md]
Related¶
- [[Zabbix]]
- DevOps
- [[Tomcat]]