MySQL Server

The opsi config server requires access to a MySQL server. If the MySQL server is hosted on the same machine, the configuration is typically automated through opsiconfd setup (refer to the section The opsiconfd setup Command). opsiconfd setup also takes care of database migrations and clean-up tasks.

In cases where automatic configuration is unsuccessful, or if you opt to use an external MySQL server, manual configuration is required. This can be done using the following command:

opsiconfd setup --configure-mysql

During the process, you will be interactively prompted for the MySQL connection details. The tool then proceeds to create the opsi database on the MySQL server and establishes a user account for access.

Configuration File

As an alternative, you can manually edit the MySQL configuration by modifying the file /etc/opsi/backends/mysql.conf using a text editor. After saving your changes, run the command sudo opsiconfd setup to create or update the opsi database on the MySQL server.

You can also edit the MySQL configuration with a text editor.
Figure 1. You can also edit the MySQL configuration with a text editor.

In most opsi environments, no further adjustments to the MySQL configuration are required. However, in large environments with a high load on the opsi server, it may be useful to optimize the MySQL configuration. The settings for the connection pool are particularly important here. The following parameters can be adjusted in the MySQL configuration:

connectionPoolSize

Number of connections to the MySQL database that are kept permanently open.

connectionPoolMaxOverflow

Number of additional connections that are opened when required. These additional connections are closed again when they are no longer required.

The connection pool settings apply per opsiconfd worker process. The maximum total number of connections to the MySQL database results from this: (connectionPoolSize + connectionPoolMaxOverflow) * workers.

The number of possible connections limits the number of simultaneous queries to the MySQL database.

If this value is set too low, there may be long waiting times for the clients, which can lead to timeouts and errors on the client side.

If the value is set too high, this can lead to a high load on the MySQL server. If this load is too high, the individual queries take a very long time, which in turn can lead to errors occurring on the client side and, in addition, no new connections to the opsiconfd server can be established.

The optimum setting depends on the number of clients, the number of simultaneous client connections and the performance of the MySQL server. You can obtain an overview of the current connections to the MySQL database with the command:

mysql -u root -p -e "show processlist;"