Standalone ClickHouse Deployment
Collector ClickHouse can run on a dedicated server.
The example uses IP address 10.0.0.10 and TCP port 9001 to connect to the
ClickHouse server. Replace them with the server interface address and an
available port. Both the collector and backend services must be able to
reach this address. Allow access to the port only from the Collector host and
protect the connection.
Run commands as root. Install the
container runtime and Compose on the
database server. On the Collector host, follow the
main installation procedure.
Deploy ClickHouse
Create the working directory and download the Compose file on the database server:
Create .env in the same directory:
Use the same version as Collector.
Set memory limits in this .env file according to the
ClickHouse settings.
Account for the memory required by other applications on the server.
Choose CPUs for ClickHouse
Set COLLECTOR_CLICKHOUSE_CPUS in .env to the CPUs allocated to the database.
For example, if logical CPUs 2 and 3 are allocated to it:
Create docker-compose.override.yml in the same directory:
The cpuset setting allows all container threads to run only on the selected
CPUs.
Start the Database
On the ClickHouse server:
Connect Collector
On the Collector host, set the following values in /srv/collector/.env:
Both address variables refer to the TCP port of the standalone database.
Create or update docker-compose.override.yml in the same directory to disable
the embedded ClickHouse and its port mapping:
Apply the settings on the Collector host: