Configure external databases for ADB Control

For production environments, it is recommended to configure external PostgreSQL and ClickHouse databases to store ADB Control data (see Query DB and Metrics DB in Arenadata DB Control overview) for a number of reasons:

  • You will be able to set up external storages on hosts of required size for desired performance and configure high availability for them.

  • The ADB Control recovery process will be easier and consist mainly of the service configuration steps.

Starting with ADB Control 4.7.5, to configure external databases, you need to follow the steps that are described below.

PostgreSQL

  1. Perform the following queries in PostgreSQL. The queries should be run under the default user postgres with the superuser rights:

    CREATE ROLE <user_name> LOGIN PASSWORD '<user_password>' SUPERUSER; (1)
    CREATE DATABASE <database_name> WITH owner <user_name>; (2)
    CREATE SCHEMA adcc;
    CREATE EXTENSION pgcrypto WITH schema adcc; (3)
    CREATE EXTENSION btree_gin WITH schema adcc;
    CREATE EXTENSION pg_trgm WITH schema adcc;
    GRANT SELECT ON pg_extension TO <user_name>;
    1 Create the <user_name> user with appropriate rights for connecting to the external database.
    2 Create the <database_name> database with the adcc schema for ADB Control data migration.
    3 Create extensions in the adcc schema and grant of their usage to the <user_name> user.
    NOTE
    The SUPERUSER option is used temporarily and will be removed in the next releases.
  2. Optionally, you can run the additional query to increase performance by disabling synchronous writes to WAL files:

    ALTER DATABASE <database_name> SET synchronous_commit = OFF;

    where <database_name> is a name of the created database.

  3. Provide the ADB Control access to the external PostgreSQL database by adding the following record to the pg_hba.conf file on the PostgreSQL server:

    host    <database_name>  <user_name>       <adbc_address>      trust

    where:

    • <database_name> — a name of the created database.

    • <user_name> — a name of the created user.

    • <adbc_address> — an IP address of ADB Control with a subnet number.

  4. On the ADB Control service configuration page, activate the External database parameters toggle and fill in all parameters in the list that opens. The assignment of parameters is described in the Configuration parameters → ADB Control → External database parameters section.

    Parameters for connecting to the external PostgreSQL DB
    Parameters for connecting to the external PostgreSQL DB
  5. Click Save to save the ADB Control configuration.

  6. Install the ADB Control service using the Install service action or apply the Reconfigure & Restart action to the ADB Control service if it is already installed.

ClickHouse

  1. Run the following queries to create a user with appropriate permissions in ClickHouse:

    CREATE USER <user_name> NOT IDENTIFIED;
    GRANT SELECT, INSERT, ALTER, CREATE, DROP, TRUNCATE ON *.* TO <user_name>
  2. On the ADB Control service configuration page, activate the External ADQM parameters toggle and fill in all parameters in the list that opens. The assignment of parameters is described in the Configuration parameters → ADB Control → External ADQM parameters section.

    Parameters for connecting to the external ClickHouse DB
    Parameters for connecting to the external ClickHouse DB
  3. Click Save to save the ADB Control configuration.

  4. Install the ADB Control service using the Install service action or apply the Reconfigure & Restart action to the ADB Control service if it is already installed.

Found a mistake? Seleсt text and press Ctrl+Enter to report it