Configure ClickHouse

Follow the steps in this guide to configure NGINX Instance Manager to work with ClickHouse if you installed ClickHouse with non-default settings.

Overview

NGINX Instance Manager uses ClickHouse as an analytics time-series database. ClickHouse is required for viewing instance metrics.

This guide explains how to update the nms.conf file to use custom ClickHouse configurations, such as a non-empty username and password, or when using TLS.

Default ClickHouse Values

Unless specified differently in the nms.conf file, Instance Manager uses the following values for ClickHouse by default:

Configuration Default Notes
clickhouse_address tcp://localhost:9000
clickhouse_username
clickhouse_password
clickhouse_tls_mode false
clickhouse_tls_address tcp://localhost:9440
clickhouse_skip_verify false clickhouse_skip_verify should be used only for self-signed certificates and is never recommended for production use. When set to true, certificates are not verified, which exposes the connection to man-in-the-middle attacks.
clickhouse_tls_key_path
clickhouse_tls_cert_path
clickhouse_tls_ca_path /etc/ssl/certs/ca-certificates.crt The default value for clickhouse_tls_ca_path works out-of-the-box for Ubuntu and Debian. You’ll need to configure a different Certificate Authority for other distributions. Refer to your distribution’s documentation for additional information.



Before You Begin




Address, Username, Password

If your ClickHouse installation has a different address, username, or password than the default values, you need to configure Instance Manager to connect to ClickHouse.

To set custom values for the ClickHouse address, username, and password, take the following steps:

  1. On the Instance Manager server, open the /etc/nms/nms.conf file for editing.

  2. Change the following settings to match your ClickHouse configuration:

    clickhouse_address = tcp://localhost:9000
    clickhouse_username = <INSERT USERNAME HERE>
    clickhouse_password = <INSERT PASSWORD HERE>
    
  3. Save the changes and close the file.




TLS

If you configured ClickHouse to work with TLS, take the following steps to update the settings in the Instance Manager nms.conf file:

  1. On the Instance Manager server, open the /etc/nms/nms.conf file for editing.

  2. Set TLS mode to true.

    clickhouse_tls_mode = true
    
  3. Set clickhouse_tls_address to the IP address and port that ClickHouse listens on.

    clickhouse_tls_address = tcp://localhost:9440
    
  4. Specify the paths for the TLS private key and certificate.

    clickhouse_tls_key_path  = /path/to/client/key.key
    clickhouse_tls_cert_path = /path/to/client/cert.crt
    
  5. Configure the Certificate Authority (CA) for certificate verification.

    clickhouse_tls_ca_path = /etc/ssl/certs/ca-certificates.crt
    
  6. Save the changes and close the file.

What’s Next