Installation

In order to install ClickHouse refer to the official guide by useing the following packages:

Warning

  • Make sure that ClickHouse version 22 or newer is installed. Older versions are not supported as they lack important features such as the MySQL compatibiity layer.
  • In case multiple ntopng instances write to the same ClickHouse database they must have different instance names. By default ntopng uses the hostname as instance name, but in case such names are not unique, please consider using the --instance-name command line option to set the custom instance name to an unique value for all the ntopng instances writing to the same database.

Note

The ClickHouse database (server) can run anywhere, both locally on the machine running ntopng, or on a remote machine. However, the clickhouse client (clickhouse or clickhouse-client) must always be installed locally as it is used by ntopng to connect to the ClickHouse server.

FreeBSD Notes

On FreeBSD please make sure that the clickhouse binary is placed under /usr/local/bin in order to be detected by ntopng.

It is possible to download the binary following the instructions available on the official guide, and install it with ./clickhouse install or manually as follows:

curl https://clickhouse.com/ | sh
mv clickhouse /usr/local/bin/

Cluster Configuration

For large deployments or data replication, a cluster is a better option with respect to a stand-alone database deployment. At this page we share simple configuration notes for deploying a ClickHouse cluster in minutes.

ClickHouse Cloud

In case instead of ClickHouse Cloud, the configuration is quite simple; after creating the service on ClickHouse Cloud, enable the MySQL Connection from the Connect section. Then add to the ntopng configuration file the -F option correctly configured:

clickhouse-cloud;<host[@port]|socket>;<dbname>;<clickhouse-user>,<mysql-user>;<pw>;<cluster name>

For example:

./ntopng -F="clickhouse-cloud;my-cloud-host.clickhouse.org@9440,3306s;ntopng;ch-user,mysql-user;ch-password"

Note

The s after the ports, means to use a secured connection, see for more info.

Note

Even when using ClickHouse Cloud, clickhouse-client is needed in the local machine.