Skip to main content

Changing BlueMind server IP address

This page describes how to change a BlueMind server's IP address.

delicate operation

This description is deliberately minimal as it is reserved to experienced administrators who are familiar with the sensitive operations performed.

IP address change procedure

Files affected

The following command identifies the files affected by this change: grep -lir <old_ip> /etc

Consider the following commands:

  • <old_ip> is the previous IP,
  • <new_ip> is the new

Procedure:

  1. Stop BlueMind:
    bmctl stop
    systemctl mask bluemind.target
  2. Start postgresql:
    systemctl start postgresql
  3. Update database information :

    💡 If prompted for a password, enter database password. It can be found in the /etc/bm/bm.ini file.

    export new_ip=xx.xx.xxx.xxx
    export old_ip=xx.xx.xxx.xxx
    export fqdn=$(grep ${old_ip} /etc/hosts | awk '{print $2}');
    sudo -Hu postgres psql bj -c "update t_server set ip = '${new_ip}',fqdn = '${fqdn}' where ip = '${old_ip}'; update t_systemconf set configuration = configuration || hstore('host','${new_ip}') || hstore('hz-member-address', '${new_ip}') || hstore('mynetworks', '${new_ip}') || hstore('redis-bootstrap-address', '${new_ip}');"
  4. Update the server's network configuration with the new IP address
  5. Update /etc/hosts file
    sed -i "s/${old_ip}/${new_ip}/g" /etc/hosts
  6. Edit the file /etc/bm/bm.ini, replacing the address of the "host" and "hz-member-address" parameters with the new IP address
    sed -i "s/${old_ip}/${new_ip}/g" /etc/bm/bm.ini
  7. Restart the server:
    reboot
  8. Restart BlueMind and the node :
    systemctl unmask bluemind.target
    bmctl start
    systemctl restart bm-node
  9. Delete and re-create realms keycloak :
    bm-cli auth reconfigure
    systemctl restart bm-keycloak
  10. Edit the /var/backups/bluemind folder structure, renaming the folder /var/backups/bluemind/dp_spool/rsync/<old_ip> with the new IP address

System reconfiguration

Manually

  1. Reconfiguring the firewall:
    sed -i "s/${old_ip}/${new_ip}/g" /etc/init.d/bm-iptables
    systemctl restart bm-iptables.service
  2. Reconfiguring postfix:
    sed -i "s/${old_ip}/${new_ip}/g" /etc/postfix/main.cf /etc/postfix/transport-flat
    postmap /etc/postfix/transport-flat
    mv /etc/postfix/transport-flat.db /etc/postfix/transport.db
  3. Reconfigure the bm-tick supervision tool:
    kapacitor list tasks |  awk '{print $1}' | grep -v ID | xargs -I {} kapacitor delete tasks {}
    bm-cli tick reconfigure

Via AdminConsole

Log into the BlueMind Administration console as admin0@global.virt and:

  1. Go to Security > Manage Firewall and immediately click on the "Save" button to force the regeneration of BlueMind firewall rules
  2. Go to System management > Manage messaging system, click on the "Run" button to re-generate the Postfix mail routing tables
  3. Go to System Management > System Configuration and replace the old IP address in the "My Networks" field by the new address or the address range for which you want the relay open and click "Save"
  4. Reconfigure the bm-tick supervision tool:
    kapacitor list tasks |  awk '{print $1}' | grep -v ID | xargs -I {} kapacitor delete tasks {}
    bm-cli tick reconfigure

Find out more

Related BlueMind documentation pages