Upgrade from Centreon 20.10
This chapter describes how to upgrade your Centreon platform from version 20.10 to version 22.04.
When you upgrade your central server, make sure you also upgrade all your remote servers and your pollers. All servers in your architecture must have the same version of Centreon. In addition, all servers must use the same version of the BBDO protocol.
If you want to migrate your Centreon server to Oracle Linux / RHEL 8 you need to follow the migration procedure
To perform this procedure, your MariaDB version must be >= 10.3.22. If not, please follow this procedure in order to update MariaDB before you can continue with the upgrade from version 20.10 to version 21.04 as described by this document.
Warning, following the correction of a problem relating to the database schema, it will be necessary to stop the insertion of the data collected into the database during the update. These will be stored in temporary files and then installed at the end of the update process.
Prerequisitesβ
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 the Centreon Central serverβ
Since 21.04, Centreon uses MariaDB 10.5.
This upgrade process will only upgrade Centreon components first.
MariaDB will be upgraded afterwards.
Update the Centreon repositoryβ
Run the following commands:
- Alma / RHEL / Oracle Linux 8
- CentOS 7
dnf install -y dnf-plugins-core
dnf config-manager --add-repo https://packages.centreon.com/rpm-standard/22.04/el8/centreon-22.04.repo
yum install -y yum-utils
yum-config-manager --add-repo https://packages.centreon.com/rpm-standard/22.04/el7/centreon-22.04.repo
If you have an offline license, install the corresponding repository for the plugin packs. If you are using a Business edition, install the correct Business repository too. You can find the repositories on the support portal.
Install the MariaDB repositoryβ
- Alma / RHEL / Oracle Linux 8
- CentOS 7
cd /tmp
curl -JO https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
bash ./mariadb_repo_setup
sed -ri 's/1[0-1]\.[0-9]+/10.5/' /etc/yum.repos.d/mariadb.repo
rm -f ./mariadb_repo_setup
cd /tmp
curl -JO https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
bash ./mariadb_repo_setup
sed -ri 's/1[0-1]\.[0-9]+/10.5/' /etc/yum.repos.d/mariadb.repo
rm -f ./mariadb_repo_setup
Upgrade PHPβ
Centreon 22.04 uses PHP in version 8.0.
- RHEL 8
- Alma / Oracle Linux 8
- 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
sudo subscription-manager repos --enable codeready-builder-for-rhel-8-x86_64-rpms
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:
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
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β
Make sure all users are logged out from the Centreon web interface before starting the upgrade procedure.
If you have installed Business extensions, update the Business repository to version 22.04. Visit the support portal to get its address.
Stop the Centreon Broker process:
systemctl stop cbd
Delete existing retention files:
rm /var/lib/centreon-broker/* -f
Clean yum cache:
yum clean all --enablerepo=*
Then upgrade all the components with the following command:
- Alma / RHEL / Oracle Linux 8
- CentOS 7
yum update centreon\* php-pecl-gnupg
yum update centreon\* php-pecl-gnupg
Accept new GPG keys from the repositories as needed.
- Alma / RHEL / Oracle Linux 8
- CentOS 7
Execute the following commands:
systemctl enable php-fpm
systemctl restart php-fpm
The PHP timezone should be set. Run the command:
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.
Execute the following commands:
systemctl stop rh-php72-php-fpm
systemctl disable rh-php72-php-fpm
systemctl enable php-fpm
systemctl start php-fpm
Or, if you have PHP 7.4:
systemctl stop rh-php74-php-fpm
systemctl disable rh-php74-php-fpm
systemctl enable php-fpm
systemctl start php-fpm
Update your customized Apache configurationβ
This section only applies if you customized your Apache configuration.
- RHEL / Oracle Linux 8
- CentOS 7
When upgrading your platform, the Apache configuration file is not upgraded automatically: the new configuration file brought by the rpm does not replace the old file. You must copy the changes manually to your customized configuration file.
Run a diff between the old and the new Apache configuration files:
diff -u /etc/httpd/conf.d/10-centreon.conf /etc/httpd/conf.d/10-centreon.conf.rpmnew
- 10-centreon.conf (post upgrade): this file contains the custom configuration. It does not contain anthing new brought by the upgrade.
- 10-centreon.conf.rpmnew (post upgrade): this file is provided by the rpm; it does not contain any custom configuration.
For each difference between the files, assess whether you should copy it from 10-centreon.conf.rpmnew to 10-centreon.conf.
In particular, make sure your customized Apache configuration contains the following directive (with authentication).
<LocationMatch ^\${base_uri}/?(authentication|api/(latest|beta|v[0-9]+|v[0-9]+\.[0-9]+))/.*$>
ProxyPassMatch "fcgi://127.0.0.1:9042${install_dir}/api/index.php/$1"
</LocationMatch>
Check that Apache is configured properly by running the following command:
apachectl configtest
The expected result is the following:
Syntax OK
Restart the Apache and PHP processes to take in account the new configuration:
systemctl restart php-fpm httpd
Then check its status:
systemctl status httpd
If everything is ok, you should have:
β httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Drop-In: /usr/lib/systemd/system/httpd.service.d
ββphp-fpm.conf
Active: active (running) since Tue 2020-10-27 12:49:42 GMT; 2h 35min ago
Docs: man:httpd.service(8)
Main PID: 1483 (httpd)
Status: "Total requests: 446; Idle/Busy workers 100/0;Requests/sec: 0.0479; Bytes served/sec: 443 B/sec"
Tasks: 278 (limit: 5032)
Memory: 39.6M
CGroup: /system.slice/httpd.service
ββ1483 /usr/sbin/httpd -DFOREGROUND
ββ1484 /usr/sbin/httpd -DFOREGROUND
ββ1485 /usr/sbin/httpd -DFOREGROUND
ββ1486 /usr/sbin/httpd -DFOREGROUND
ββ1487 /usr/sbin/httpd -DFOREGROUND
ββ1887 /usr/sbin/httpd -DFOREGROUND
When upgrading your platform, the Apache configuration file is not upgraded automatically: the new configuration file brought by the rpm does not replace the old file. You must copy the changes manually to your customized configuration file.
Run a diff between the old and the new Apache configuration files:
diff -u /opt/rh/httpd24/root/etc/httpd/conf.d/10-centreon.conf /opt/rh/httpd24/root/etc/httpd/conf.d/10-centreon.conf.rpmnew
- 10-centreon.conf (post upgrade): this file contains the custom configuration. It does not contain anthing new brought by the upgrade.
- 10-centreon.conf.rpmnew (post upgrade): this file is provided by the rpm; it does not contain any custom configuration.
For each difference between the files, assess whether you should copy it from 10-centreon.conf.rpmnew to 10-centreon.conf.
In particular, make sure your customized Apache configuration contains the following directive (with authentication).
<LocationMatch ^\${base_uri}/?(authentication|api/(latest|beta|v[0-9]+|v[0-9]+\.[0-9]+))/.*$>
ProxyPassMatch "fcgi://127.0.0.1:9042${install_dir}/api/index.php/$1"
</LocationMatch>
Check that Apache is configured properly by running the following command:
/opt/rh/httpd24/root/usr/sbin/apachectl configtest
The expected result is the following:
Syntax OK
Restart the Apache and PHP processes to take in account the new configuration:
systemctl restart php-fpm httpd24-httpd
Then check its status:
systemctl status httpd24-httpd
If everything is ok, you must have:
β httpd24-httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd24-httpd.service; enabled; vendor preset: disabled)
Active: active (running) since mar. 2020-05-12 15:39:58 CEST; 25min ago
Process: 31762 ExecStop=/opt/rh/httpd24/root/usr/sbin/httpd-scl-wrapper $OPTIONS -k graceful-stop (code=exited, status=0/SUCCESS)
Main PID: 31786 (httpd)
Status: "Total requests: 850; Idle/Busy workers 50/50;Requests/sec: 0.547; Bytes served/sec: 5.1KB/sec"
CGroup: /system.slice/httpd24-httpd.service
ββ 1219 /opt/rh/httpd24/root/usr/sbin/httpd -DFOREGROUND
ββ31786 /opt/rh/httpd24/root/usr/sbin/httpd -DFOREGROUND
ββ31788 /opt/rh/httpd24/root/usr/sbin/httpd -DFOREGROUND
ββ31789 /opt/rh/httpd24/root/usr/sbin/httpd -DFOREGROUND
ββ31790 /opt/rh/httpd24/root/usr/sbin/httpd -DFOREGROUND
ββ31802 /opt/rh/httpd24/root/usr/sbin/httpd -DFOREGROUND
ββ31865 /opt/rh/httpd24/root/usr/sbin/httpd -DFOREGROUND
ββ31866 /opt/rh/httpd24/root/usr/sbin/httpd -DFOREGROUND
ββ31882 /opt/rh/httpd24/root/usr/sbin/httpd -DFOREGROUND
ββ31903 /opt/rh/httpd24/root/usr/sbin/httpd -DFOREGROUND
ββ32050 /opt/rh/httpd24/root/usr/sbin/httpd -DFOREGROUND
If you were using OpenID or the Web SSO authentication, some extra configuration steps are required. Refer to the release note.
Upgrade the MariaDB serverβ
The MariaDB components can now be upgraded.
Refer to the official MariaDB documentation to know more about this process:
https://mariadb.com/kb/en/upgrading-between-major-mariadb-versions/
Update the Centreon repositoryβ
This step is required ONLY when your environment features an architecture with a dedicated remote DBMS. If your environment features Centreon Central and MariaDB together on the same server, you SHOULD simply skip this step.
Run the following command on the dedicated DBMS server:
- Alma / RHEL / Oracle Linux 8
- CentOS 7
dnf install -y dnf-plugins-core
dnf config-manager --add-repo https://packages.centreon.com/rpm-standard/22.04/el8/centreon-22.04.repo
yum install -y yum-utils
yum-config-manager --add-repo https://packages.centreon.com/rpm-standard/22.04/el7/centreon-22.04.repo
Upgrading MariaDBβ
You have to uninstall then reinstall MariaDB to upgrade between major versions (i.e. to switch from version 10.3 to version 10.5).
Stop the mariadb service:
systemctl stop mariadb
Uninstall the current version:
rpm --erase --nodeps --verbose MariaDB-server MariaDB-client MariaDB-shared MariaDB-compat MariaDB-common
Install version 10.5:
yum install MariaDB-server-10.5\* MariaDB-client-10.5\* MariaDB-shared-10.5\* MariaDB-compat-10.5\* MariaDB-common-10.5\*
Start the mariadb service:
systemctl start mariadb
Launch the MariaDB upgrade process:
mysql_upgrade
If your database is password-protected, enter:
mysql_upgrade -u <database_admin_user> -p
Example: if your database_admin_user is
root
, enter:mysql_upgrade -u root -p
Refer to the official documentation for more information or if errors occur during this last step.
Enable MariaDB on startupβ
Execute the following command:
systemctl enable mariadb
Finalizing the upgradeβ
- Alma / RHEL / Oracle Linux 8
- CentOS 7
Before starting the web upgrade process, reload the Apache server with the following command:
systemctl reload httpd
Before starting the web upgrade process, reload the Apache server with the following command:
systemctl reload httpd24-httpd
Then log on to the Centreon web interface to continue the upgrade process:
Click on Next:
Click on Next:
The release notes describe the main changes. Click on Next:
This process performs the various upgrades. Click on Next:
Your Centreon server is now up to date. Click on Finish to access the login page:
If the Centreon BAM module is installed, refer to the upgrade procedure.
Post-upgrade actionsβ
Upgrade extensions. From Administration > Extensions > Manager, upgrade all extensions, starting with the following:
- License Manager,
- Plugin Packs Manager,
- Auto Discovery.
Then you can upgrade all other commercial extensions.Set the following rights on Broker and Engine files:
chown apache:apache /etc/centreon-engine/*
chown apache:apache /etc/centreon-broker/*
su - apache -s /bin/bash -c umaskRestart the processes:
systemctl restart cbd centengine centreontrapd gorgoned
Upgrade the Remote Serversβ
This procedure is the same as for upgrading a Centreon Central server.
At the end of the update, configuration should be deployed from the Central server.
Upgrade the Pollersβ
Update the Centreon repositoryβ
Run the following command:
- Alma / RHEL / Oracle Linux 8
- CentOS 7
dnf install -y dnf-plugins-core
dnf config-manager --add-repo https://packages.centreon.com/rpm-standard/22.04/el8/centreon-22.04.repo
yum install -y yum-utils
yum-config-manager --add-repo https://packages.centreon.com/rpm-standard/22.04/el7/centreon-22.04.repo
Upgrade the Centreon solutionβ
Clean yum cache:
yum clean all --enablerepo=*
Upgrade all the components with the following command:
yum update centreon\*
Accept new GPG keys from the repositories as needed.
Start and enable gorgoned:
systemctl start gorgoned
systemctl enable gorgoned
Restart centengine:
systemctl restart centengine