diff --git a/doc/02-installation.md b/doc/02-installation.md index 10f250c4f..180a2d8ae 100644 --- a/doc/02-installation.md +++ b/doc/02-installation.md @@ -450,7 +450,7 @@ yum install nagios-plugins-all ``` -## Set up Icinga 2 API +## Set up Icinga 2 API Almost every Icinga 2 setup requires the Icinga 2 API as Icinga Web connects to it, Icinga DB requires it, and it enables cluster communication functionality for highly available and distributed setups. @@ -481,6 +481,168 @@ Restart Icinga 2 for these changes to take effect. systemctl restart icinga2 ``` + +## Set up Icinga DB + +Icinga DB is a set of components for publishing, synchronizing and +visualizing monitoring data in the Icinga ecosystem, consisting of: + +* Icinga 2 with its `icingadb` feature enabled, + responsible for publishing monitoring data to a Redis server, i.e. configuration and its runtime updates, + check results, state changes, downtimes, acknowledgements, notifications, and other events such as flapping +* The [Icinga DB daemon](https://icinga.com/docs/icinga-db), + which synchronizes the data between the Redis server and a database +* And Icinga Web with the + [Icinga DB Web](https://icinga.com/docs/icinga-db-web) module enabled, + which connects to both Redis and the database to display and work with the most up-to-date data + +![Icinga DB Architecture](images/installation/icingadb-architecture.png) + +!!! info + + Setting up Icinga 2's Icinga DB feature is only required for Icinga 2 master nodes or single-node setups. + +### Set up Redis Server + +A Redis server from version 6.2 is required. + +!!! info + + This guide sets up the `icingadb-redis` package provided by Icinga, + which ships a current Redis Server version and is preconfigured for the Icinga DB components. + Using own Redis server setups is supported as long as the version requirements are met. + +![Icinga DB Redis](images/installation/icingadb-redis.png) + +!!! tip + + Although the Redis server can run anywhere in an Icinga environment, + we recommend to install it where the corresponding Icinga 2 node is running to + keep latency between the components low. + +#### Install Icinga DB Redis Package + +Use your distribution's package manager to install the `icingadb-redis` package as follows: + + + +##### Amazon Linux 2 + +```bash +yum install icingadb-redis +``` + + + + +##### CentOS + + +!!! info + + Note that installing Icinga DB Redis is only supported on CentOS 7 as CentOS 8 is EOL. + +```bash +yum install icingadb-redis +``` + + + + +##### Debian / Ubuntu + +```bash +apt-get install icingadb-redis +``` + + + +##### RHEL 8 or Later + +```bash +dnf install icingadb-redis +``` + +##### RHEL 7 + +```bash +yum install icingadb-redis +``` + + + + +##### SLES + +```bash +zypper install icingadb-redis +``` + + +#### Run Icinga DB Redis + +The `icingadb-redis` package automatically installs the necessary systemd unit files to run Icinga DB Redis. +Please run the following command to enable and start its service: + +```bash +systemctl enable --now icingadb-redis +``` + +#### Enable Remote Redis Connections + +By default, `icingadb-redis` only listens on `127.0.0.1`. If Icinga Web or Icinga 2 is running on another node, +remote access to the Redis server must be allowed. This requires the following directives to be set in +the `/etc/icingadb-redis/icingadb-redis.conf` configuration file: + +* Set `protected-mode` to `no`, i.e. `protected-mode no` +* Set `bind` to the desired binding interface or bind all interfaces, e.g. `bind 0.0.0.0` + +!!! warning + + By default, Redis has no authentication preventing others from accessing it. + When opening Redis to an external interface, make sure to set a password, set up appropriate firewall rules, + or configure TLS with certificate authentication on Redis and its consumers, + i.e. Icinga 2, Icinga DB and Icinga Web. + +Restart Icinga DB Redis for these changes to take effect: + +```bash +systemctl restart icingadb-redis +``` + +### Enable Icinga DB Feature + +With the [Icinga DB feature](14-features.md#icinga-db) enabled, +Icinga 2 publishes all of its monitoring data to the Redis server. This includes configuration and +its runtime updates via the Icinga 2 API, check results, state changes, downtimes, acknowledgments, notifications and +other events such as flapping. + +![Icinga DB Icinga 2](images/installation/icingadb-icinga2.png) + +Icinga 2 installs the feature configuration file to `/etc/icinga2/features-available/icingadb.conf`, +pre-configured for a local setup. +Update this file in case Redis is running on a different host or to set credentials. +All available settings are explained in the [Icinga DB object](09-object-types.md#icingadb) chapter. + +!!! important + + For single-node and high-availability setups, please read the note about the + [environment ID](https://icinga.com/docs/icinga-db/latest/doc/05-Distributed-Setups/#environment-id), + which is common to all Icinga DB components and generated by the Icinga DB feature. + +To enable the `icingadb` feature use the following command: + +```bash +icinga2 feature enable icingadb +``` + +Restart Icinga 2 for these changes to take effect: + +```bash +systemctl restart icinga2 +``` + + ## Set up Database The IDO (Icinga Data Output) feature for Icinga 2 stores all configuration and status information into a database. @@ -912,45 +1074,6 @@ Restart Icinga 2. systemctl restart icinga2 ``` -### Icinga DB - -Icinga DB is a new data backend currently in development. -It's purpose is to synchronise data between Icinga 2 (Redis) and Icinga Web 2 (MySQL), some day replacing the IDO. -Don't worry, we won't drop support on the IDO any time soon. - -!!! note - - Icinga DB is not ready to be used in production and should only be used for testing purposes. - -#### Configue Icinga DB - -First, make sure to setup Icinga DB itself and its database backends (Redis and MySQL) by following the [installation instructions](https://icinga.com/docs/icingadb/latest/doc/02-Installation/). - -#### Enable Icinga DB feature - -Icinga 2 provides a configuration file that is installed in -`/etc/icinga2/features-available/icingadb.conf`. You can update -the Redis credentials in this file. - -All available attributes are explained in the -[IcingaDB object](09-object-types.md#objecttype-icingadb) -chapter. - -You can enable the `icingadb` feature configuration file using -`icinga2 feature enable`: - -``` -# icinga2 feature enable icingadb -Module 'icingadb' was enabled. -Make sure to restart Icinga 2 for these changes to take effect. -``` - -Restart Icinga 2. - -```bash -systemctl restart icinga2 -``` - ## Install Icinga Web 2 You are now ready to start the installation of Icinga Web 2. Please follow the diff --git a/doc/images/installation/icingadb-architecture.png b/doc/images/installation/icingadb-architecture.png new file mode 100644 index 000000000..3d55ff757 Binary files /dev/null and b/doc/images/installation/icingadb-architecture.png differ diff --git a/doc/images/installation/icingadb-icinga2.png b/doc/images/installation/icingadb-icinga2.png new file mode 100644 index 000000000..7b7aafa70 Binary files /dev/null and b/doc/images/installation/icingadb-icinga2.png differ diff --git a/doc/images/installation/icingadb-redis.png b/doc/images/installation/icingadb-redis.png new file mode 100644 index 000000000..d6eafab58 Binary files /dev/null and b/doc/images/installation/icingadb-redis.png differ