doc/src/flow_dump/clickhouse/installation.rst
In order to install ClickHouse refer to the official guide_ by useing the following packages:
.. _guide: https://clickhouse.com/docs/en/getting-started/quick-start/
.. warning::
--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 (:code:clickhouse or :code:clickhouse-client) must always be installed locally as it is used by ntopng to connect to the ClickHouse server.
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 :code:./clickhouse install or manually as follows:
.. code:: bash
curl https://clickhouse.com/ | sh mv clickhouse /usr/local/bin/
For large deployments or data replication, a cluster is a better option with respect to a stand-alone database deployment. At this page <https://github.com/ntop/ntopng/tree/dev/clickhouse>_ we share simple configuration notes for deploying a ClickHouse cluster in minutes.
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:
.. code:: bash
clickhouse-cloud;<host[@port]|socket>;<dbname>;<clickhouse-user>,<mysql-user>;<pw>;<cluster name>
For example:
.. code:: bash
./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.
The defaut ClickHouse service configuration is not optimized in terms of memory and disk utilization.
In order to reduce utilization of such resources please refer to this guide <https://github.com/ntop/ntopng/blob/dev/doc/README.clickhouse.md>_
that explain in detail how to optimize the database configuration.