Upgrade Centreon HA from Centreon 21.04
This chapter describes how to upgrade your Centreon HA platform from version 21.04 to version 21.10
Prerequisitesβ
Suspend cluster resources managementβ
In order to avoid a failover of the cluster during the update, it is necessary to unmanage all Centreon resources, as well as MariaDB.
pcs resource unmanage centreon
pcs resource unmanage ms_mysql
pcs resource unmanage php7-clone
Perform a backupβ
Be sure that you have fully backed up your environment for the following servers:
- Central server
- Database server
Update the RPM signing keyβ
For security reasons, the keys used to sign Centreon RPMs are rotated regularly. The last change occurred on October 14, 2021. When upgrading from an older version, you need to go through the key rotation procedure, to remove the old key and install the new one.
Upgrade processβ
Update the Centreon repositoryβ
Run the following commands:
- RHEL / CentOS / Oracle Linux 8
- CentOS 7
dnf install -y dnf-plugins-core
dnf config-manager --add-repo https://packages.centreon.com/rpm-standard/21.10/el8/centreon-21.10.repo
yum install -y yum-utils
yum-config-manager --add-repo https://packages.centreon.com/rpm-standard/21.10/el7/centreon-21.10.repo
WARNING: to avoid broken dependencies, please refer to the documentation of the additional modules to update the Centreon Business Repositories.
Upgrade PHPβ
Centreon 21.10 uses PHP in version 8.0.
- RHEL / Oracle Linux 8
- RHEL / CentOS 7
First, you need to install the remi repository:
dnf install -y dnf-plugins-core
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
dnf install -y https://rpms.remirepo.net/enterprise/remi-release-8.rpm
dnf config-manager --set-enabled 'powertools'
Then, you need to change the PHP stream from version 7.3 to 8.0 by executing the following commands and answering y to confirm:
dnf module reset php
dnf module install php:remi-8.0
First, you need to install the remi repository:
yum install -y yum-utils
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum install -y https://rpms.remirepo.net/enterprise/remi-release-7.rpm
Then, you need to enable the php 8.0 repository
yum-config-manager --enable remi-php80
Upgrade the Centreon solutionβ
Please, make sure all users are logged out from the Centreon web interface before starting the upgrade procedure.
Clean yum cache:
yum clean all --enablerepo=*
Then upgrade all the components with the following command:
- RHEL / Oracle Linux 8
- RHEL / CentOS 7
dnf update centreon\*
mv /etc/centreon-ha/centreon_central_sync.pm.rpmsave /etc/centreon-ha/centreon_central_sync.pm
On the Central Servers:
yum update centreon\*
mv /etc/centreon-ha/centreon_central_sync.pm.rpmsave /etc/centreon-ha/centreon_central_sync.pm
The PHP timezone should be set. Run the command on both Central Server nodes:
echo "date.timezone = Europe/Paris" >> /etc/php.d/50-centreon.ini
Replace Europe/Paris by your time zone. You can find the list of supported time zones here.
WARNING the following commands must be executed on only one node of the cluster.
- HA 2 Nodes
- HA 4 Nodes
pcs resource delete php7 --force
pcs resource create "php" \
systemd:php-fpm \
meta target-role="started" \
op start interval="0s" timeout="30s" \
stop interval="0s" timeout="30s" \
monitor interval="5s" timeout="30s" \
clone
pcs resource delete php7 --force
pcs resource create "php" \
systemd:php-fpm \
meta target-role="started" \
op start interval="0s" timeout="30s" \
stop interval="0s" timeout="30s" \
monitor interval="5s" timeout="30s" \
clone
pcs constraint location php-clone avoids @DATABASE_MASTER_NAME@=INFINITY @DATABASE_SLAVE_NAME@=INFINITY
Then to perform the WEB UI upgrade, please follow the official documentation Only on the active central node.
On the passive central node, move the "install" directory to avoid getting the "upgrade" screen in the WUI in the event of a further exchange of roles.
mv /usr/share/centreon/www/install /var/lib/centreon/installs/install-update-YYYY-MM-DD
sudo -u apache /usr/share/centreon/bin/console cache:clear
Removing cron jobsβ
The RPM upgrade puts cron jobs back in place. Remove them to avoid concurrent executions:
rm /etc/cron.d/centreon
rm /etc/cron.d/centstorage
rm /etc/cron.d/centreon-auto-disco
Reset the permissions for centreon_central_sync resourceβ
The RPM upgrade puts the permissions back in place. Change it using these commands:
chmod 775 /var/log/centreon-engine/
mkdir /var/log/centreon-engine/archives
chown centreon-engine: /var/log/centreon-engine/archives
chmod 775 /var/log/centreon-engine/archives/
find /var/log/centreon-engine/ -type f -exec chmod 664 {} \;
find /usr/share/centreon/www/img/media -type d -exec chmod 775 {} \;
find /usr/share/centreon/www/img/media -type f \( ! -iname ".keep" ! -iname ".htaccess" \) -exec chmod 664 {} \;
Configure MariaDB slave_parallel_modeβ
Since MariaDB 10.5, the slave_parallel_mode is no longer set up as conservative.
It's necessary to modify the mysql configuration by editing /etc/my.cnf.d/server.cnf
:
On the 2 Central servers in HA 2 nodes On the 2 Database servers in HA 4 nodes.
[server]
...
slave_parallel_mode=conservative
...
Clean broker memory filesβ
WARNING perform these commands only the active central node. Before resuming the cluster resources management, to avoid broker issues, cleanup all the .memory., .unprocessed. or .queue. files:
systemctl stop cbd-sql
rm -rf /var/lib/centreon-broker/central-broker-master.memory*
rm -rf /var/lib/centreon-broker/central-broker-master.queue*
rm -rf /var/lib/centreon-broker/central-broker-master.unprocessed*
systemctl start cbd-sql
Then perform these commands on the passive central node:
rm -rf /var/lib/centreon-broker/central-broker-master.memory*
rm -rf /var/lib/centreon-broker/central-broker-master.queue*
rm -rf /var/lib/centreon-broker/central-broker-master.unprocessed*
Restart Centreon processβ
Then to restart all the processes on the active central node:
systemctl restart cbd-sql cbd gorgoned centengine
And on the passive central node:
systemctl restart cbd
Resuming the cluster resources managementβ
Now that the update is finished, the resources can be managed again:
pcs resource manage centreon
pcs resource manage ms_mysql
It can happen that the replication thread is not running right after installation. Restarting the ms_mysql
resource may fix it.
pcs resource restart ms_mysql
Check cluster's healthβ
You can monitor the cluster's resources in real time using the crm_mon
command:
- HA 2 Nodes
- HA 4 Nodes
Stack: corosync
Current DC: @CENTRAL_SLAVE_NAME@ (version 1.1.20-5.el7_7.2-3c4c782f70) - partition with quorum
Last updated: Thu Feb 20 13:14:17 2020
Last change: Thu Feb 20 09:25:54 2020 by root via crm_attribute on @CENTRAL_MASTER_NAME@
2 nodes configured
14 resources configured
Online: [ @CENTRAL_MASTER_NAME@ @CENTRAL_SLAVE_NAME@ ]
Active resources:
Master/Slave Set: ms_mysql-master [ms_mysql]
Masters: [ @CENTRAL_MASTER_NAME@ ]
Slaves: [ @CENTRAL_SLAVE_NAME@ ]
Clone Set: cbd_rrd-clone [cbd_rrd]
Started: [ @CENTRAL_MASTER_NAME@ @CENTRAL_SLAVE_NAME@ ]
Resource Group: centreon
vip (ocf::heartbeat:IPaddr2): Started @CENTRAL_MASTER_NAME@
http (systemd:httpd24-httpd): Started @CENTRAL_MASTER_NAME@
gorgone (systemd:gorgoned): Started @CENTRAL_MASTER_NAME@
centreon_central_sync (systemd:centreon-central-sync): Started @CENTRAL_MASTER_NAME@
centreontrapd (systemd:centreontrapd): Started @CENTRAL_MASTER_NAME@
snmptrapd (systemd:snmptrapd): Started @CENTRAL_MASTER_NAME@
cbd_central_broker (systemd:cbd-sql): Started @CENTRAL_MASTER_NAME@
centengine (systemd:centengine): Started @CENTRAL_MASTER_NAME@
Clone Set: php-clone [php]
Started: [ @CENTRAL_MASTER_NAME@ @CENTRAL_SLAVE_NAME@ ]
[...]
4 nodes configured
21 resources configured
Online: [@CENTRAL_MASTER_NAME@ @CENTRAL_SLAVE_NAME@ @DATABASE_MASTER_NAME@ @DATABASE_SLAVE_NAME@]
Active resources:
Master/Slave Set: ms_mysql-master [ms_mysql]
Masters: [@DATABASE_MASTER_NAME@]
Slaves: [@DATABASE_SLAVE_NAME@]
Clone Set: cbd_rrd-clone [cbd_rrd]
Started: [@CENTRAL_MASTER_NAME@ @CENTRAL_SLAVE_NAME@]
Resource Group: centreon
vip (ocf::heartbeat:IPaddr2): Started @CENTRAL_MASTER_NAME@
http (systemd:httpd24-httpd): Started @CENTRAL_MASTER_NAME@
gorgone (systemd:gorgoned): Started @CENTRAL_MASTER_NAME@
centreon_central_sync (systemd:centreon-central-sync): Started @CENTRAL_MASTER_NAME@
cbd_central_broker (systemd:cbd-sql): Started @CENTRAL_MASTER_NAME@
centengine (systemd:centengine): Started @CENTRAL_MASTER_NAME@
centreontrapd (systemd:centreontrapd): Started @CENTRAL_MASTER_NAME@
snmptrapd (systemd:snmptrapd): Started @CENTRAL_MASTER_NAME@
vip_mysql (ocf::heartbeat:IPaddr2): Started @CENTRAL_MASTER_NAME@
Clone Set: php-clone [php]
Started: [@CENTRAL_MASTER_NAME@ @CENTRAL_SLAVE_NAME@]
Verifying the platform stabilityβ
You should now check that eveything works fine:
- Access to the web UI menus.
- Poller configuration generation + reload and restart method.
- Schedule immediate checks (Central + Pollers) , acknowledgements, downtimes, etc.
- Move resources or reboot active server and check again that everything is fine.