Choix de la base de données
Choisir un backend de base de données pour Zabbix
Une décision critique dans la gestion des installations Zabbix est la sélection du backend de la base de données. Zabbix supporte plusieurs options de base de données : MySQL/Percona, MariaDB, PostgreSQL (y compris TimescaleDB) et Oracle (jusqu'à Zabbix 7.0).
Dépréciation de la base de données Oracle
Zabbix 7.0 marks the final release to offer support for Oracle Database. Consequently, systems running Zabbix 7.0 or any prior version must undertake a database migration to either PostgreSQL, MySQL, or a compatible fork such as MariaDB before upgrading to a later Zabbix release. This migration is a mandatory step to ensure continued functionality and compatibility with future Zabbix versions.
Toutes les bases de données prises en charge ont des performances similaires dans les charges de travail typiques de Zabbix, et Zabbix les traite de la même manière en termes de fonctionnalités. En tant que tel, le choix dépend principalement de votre familiarité ou de celle de votre équipe avec un système de base de données particulier. Une exception notable est TimescaleDB, une extension de PostgreSQL optimisée pour les données de séries temporelles. Elle est donc particulièrement bien adaptée aux applications de surveillance telles que Zabbix, qui traitent d'importants volumes de données horodatées.
Dans les environnements à grande échelle avec une collecte de données à haute fréquence, TimescaleDB peut offrir des avantages significatifs en termes de performances, y compris des vitesses de requêtes améliorées et une compression intégrée pour réduire les besoins en stockage. Cependant, ces avantages s'accompagnent d'une complexité accrue lors de l'installation et de quelques restrictions sur la conservation des données historiques.
TimescaleDB installation
Given its advanced nature, TimescaleDB is not essential for most Zabbix users. As such, its installation is beyond the scope of this chapter. If you plan to use TimescaleDB, refer to Partitioning PostgreSQL with TimescaleDB for detailed guidance after installing PostgreSQL.
Choosing the Source for Database Installation
In this chapter we will focus on installing MariaDB and PostgreSQL, as they are the most commonly used databases with Zabbix. For MySQL or Percona installations, except for the package installation commands, the steps are very similar to MariaDB.
When installing MariaDB or PostgreSQL you must determine the source from which you will want to install the database server. Two primary options are available:
- Vendor-Provided Packages
-
These are included in the software repositories of most Linux distributions and are maintained by the distribution vendor.
Advantages:
- Simplified installation: Packages are readily available via the distribution’s package manager.
- Vendor support: For enterprise distributions (e.g., RHEL, SLES), active subscriptions include official support.
- Compatibility: Guaranteed integration with other system packages and dependencies.
- Distribution-specific optimizations: Includes tailored configurations (e.g., logrotate, bash completion,...).
- Long-term maintenance: Security and bug fixes are backported by the vendor for the duration of the distribution’s support lifecycle.
Disadvantages:
- Version lock-in: Major distribution upgrades may automatically introduce newer database versions, potentially requiring compatibility checks with Zabbix.
- Vendor modifications: Default configurations, log directories, and data paths may be altered to align with distribution-specific standards.
- Official MariaDB/PostgreSQL Repositories
-
These repositories provide packages directly from MariaDB/PostgreSQL and offer access to the latest stable releases.
Advantages:
- Up-to-date versions: Immediate access to the latest features, security patches, and bug fixes. However, make sure Zabbix is compatible with the chosen version.
- Enterprise support: Option to purchase MariaDB Enterprise or Enterprise DB respectively, which includes professional support and additional features.
Disadvantages:
- Manual version management: Users must proactively monitor and upgrade to new major versions to ensure continued security and bug fix coverage.
Database version compatibility
Whether you plan to use the OS vendor-provided packages or the official database-vendor packages, ensure that the database version is supported by your Zabbix version to avoid potential integration issues. Check the Zabbix documentation for the latest supported versions.
Before installing the database software, ensure that the server meets the configuration requirements and is prepared as outlined in the previous chapter: Getting started.
Conclusion
We have discussed the various database backends supported by Zabbix. We've also examined the advantages and disadvantages of using vendor-provided packages versus official repositories for installing MariaDB and PostgreSQL.
Armed with this knowledge, you are now ready to proceed with the installation of your chosen database backend. In the following chapters, we will guide you through the installation process for MariaDB or PostgreSQL, ensuring that your Zabbix instance is equipped with a robust and efficient database system.
Now that you have a clear understanding of the database options available, let's move on to the installation of your preferred database backend.
Questions
- Should I choose MySQL or PostgreSQL as the database back-end? Why?
- Should I use the packages provided by the OS vendor, or should I install database-vendor official packages? Why?