Changing the Carbonio server IP address

One of the key system requirements when installing Carbonio is to have a static IP address that does not change over time. A good recommendation is to have two network interfaces on the server, one of which provides access to the web client and other Carbonio services from the external Internet, and the other is static and is used for access from the local network. All these recommendations appeared for the reason that if the IP address of the Carbonio server unexpectedly changes, it will work and start correctly. In this article we will talk about what actions should be taken if Carbonio’s IP address is changed in order to restore the functionality of not only the server itself, but also the services associated with it.

These instructions are suitable for both the commercial version of Carbonio and the free Carbonio Community Edition.

In case of a single server installation

If Carbonio and all services are installed on the same server, then eliminating the consequences of changing the IP address is a fairly trivial task.

  1. Change the appropriate entry in /etc/hosts

Carbonio does not start correctly precisely because the host name in the /etc/hosts file corresponds to the old IP address. For example, after changing the IP address from 1.2.3.4 to 4.3.2.1, you need to change the entry in /etc/hosts with this

1.2.3.4 mail.carbonio.local mail

for such

  1. Change the MTA’s list of trusted addresses

By default, the list of trusted servers looks like this:

zimbraMtaMyNetworks: 127.0.0.0/8 [::1]/128 1.2.3.0/24

Our task is to bring it to mind 127.0.0.0/8 [::1]/128 4.3.2.0/24

This is done using the command carbonio prov ms mail.carbonio.local zimbraMtaMyNetworks ‘127.0.0.0/8 [::1]/128 4.3.2.0/24’.

  1. Change the address in nginx settings

Go to the /opt/zextras/conf/nginx/includes folder and edit the nginx.conf.zmlookup file located there. The string it contains

zm_lookup_handlers https://1.2.3.4:7072/service/extension/nginx-lookup;

It should look like this:

  1. Change the Carbonio Mesh binding address

Carbonio Mesh, a system that ensures the connectivity of the mail server with other services, is also tied to an IP address during initial setup. After the change, you need to change it in the settings.

Open the file /etc/zextras/service-discover/config.json and edit the binding address specified there

  1. Reconfigure the video server

Reconfigure the Videoserver node

If you added a video server not by host name, but by IP address, you will need to delete the old entry about it and then add a new one.

To view the added video server, use the command carbonio chats clusterStatus

To delete a video server entry, use the command Carbonio chats video-server remove 1.2.3.4:8188

To add a new video server, use the command carbonio chats video-server add mail.carbonio.local port 8188 servlet_port 8090 secret VIDEOSERVER_PWD

To obtain the password from the video server VIDEOSERVER_PWD, run the command grep -i -e nat_1_1 -e api_secret /etc/janus/janus.jcfg

To change the public address of the video server, open the file /etc/janus/janus.jcfg and write the new IP address in the nat_1_1_mapping line

After these steps, you will need to restart the Carbonio server.

In case of multi-server installation

The process of restoring functionality largely depends on how many servers’ IP addresses have changed, as well as on how exactly the network visibility of the servers is ensured.

  1. Change the appropriate entry in /etc/hosts

Following the example of point 1 in the previous section of the instructions, change the local entry for the name of each server whose IP address has changed in the /etc/hosts file.

In Carbonio, nodes communicate with each other using domain names, and a common practice is to write server names not in the local DNS, but in the /etc/hosts file. If the server names are registered in DNS, it is enough to simply update their records; if the server names are registered in /etc/hosts, you will need to make changes to them on each of the servers.

  1. Check your local configuration for an IP address

In some cases, especially if there are several LDAP servers in the infrastructure, access to them can be configured not by domain name, but by IP address. You can check this in the /opt/zextras/conf/localconfig.xml file in the ldap_master_url and ldap_url fields.

  1. Change the MTA’s list of trusted addresses

This action should only be performed on the MTA node and only if the IP address has changed significantly. The procedure for changing trusted addresses completely repeats the steps from paragraph 2 of the previous section of the instructions.

  1. Reconfigure Carbonio Preview

If the Proxy node address has changed, you will need to change the settings of the Carbonio Preview service, which accesses the Memcached module located on the proxy exactly by IP address.

To do this, open the /etc/carbonio/preview/config.ini file and make changes to the Carbonio Preview settings.

nginx_lookup_server_full_path_urls = https://New_AppServer_IP:7072
memcached_server_full_path_urls = New_Proxy_IP:11211

Replace New_Proxy_IP with the new Proxy server address if it has changed. Replace New_Appserver_IP with the new Appserver server address if it has changed.

If your infrastructure has several Proxy and/or AppServer servers, specify their IP addresses separated by commas. Eg:

nginx_lookup_server_full_path_urls = https://New_AppServer1_IP:7072,https://New_AppServer2_IP:7072
memcached_server_full_path_urls = New_Proxy1_IP:11211,New_Proxy2_IP:11211

  1. Reconfigure Nginx

If you change the IP address of the Proxy node, go to it and go to the /opt/zextras/conf/nginx/includes folder. Open the nginx.conf.zmlookup file and in the zm_lookup_handlers line, change the IP address specified there to a new one.

  1. Reconfigure the Videoserver node

If you added a video server to the infrastructure by IP address, you should first delete the old entry and then add a new one.

To view added video servers, use the carbonio chats clusterStatus command

To delete a video server entry, use the command carbonio chats video-server remove Old_Videoserver_IP:8188

To add a new video server, use the command carbonio chats video-server add New_Videoserver_HN port 8188 servlet_port 8090 secret VIDEOSERVER_PWD

Replace Old_Videoserver_IP with your server’s old IP address and New_Videoserver_HN with your new hostname to add a video server by hostname.

To obtain the password from the video server VIDEOSERVER_PWD on the node with it, run the command grep -i -e nat_1_1 -e api_secret /etc/janus/janus.jcfg

To change the public address of the video server, open the file /etc/janus/janus.jcfg on the node with it and write in the line nat_1_1_mapping new IP address.

  1. Reconfiguring Carbonio Mesh

Carbonio Mesh consists of server and agent nodes. Their reconfiguration occurs in different ways.

If you change the IP address of the Carbonio Mesh server node, just open the /etc/zextras/service-discover/config.json file on it and edit the binding address specified there.

If the IP address of the agent node changes, you will need to remove it from the cluster using the command consul force-leave Old_agent_IP, executed on a Carbonio Mesh server node. Instead of Old_agent_IP, enter the address that the agent node had before the IP change.

After that, add the node again by running the command on the server node consul join New_agent_IPin which replace New_agent_IP with the current IP address of the agent node.

After completing all these steps, perform a hard reboot of all Carbonio infrastructure nodes.

Thanks to the described actions, you can quickly restore the full functionality of the Carbonio infrastructure in the event of a change in the IP addresses of all or part of its servers.

For questions regarding testing, purchasing, licensing and consultations, please contact sales@svzcloud.ru to exclusive partner Zextras.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *