Deployment Overview of ClickHouse on Server¶
Prerequisites and Basic Requirements¶
The deployment of ClickHouse requires a Linux environment with specific operating system versions and administrative privileges. The system must meet the following criteria:
-
Operating System: Ubuntu (versions prior to 24.04 or specifically 24.04).
-
Privileges: Root access or
sudoprivileges are required to execute installation scripts and manage services. -
Network: The server must have outbound internet access to download the ClickHouse installation script from
https://clickhouse.com/. -
Ports: The default ClickHouse port must be accessible for connections.
Application Installation Process¶
The ClickHouse application is installed using the official installation script provided by the vendor. The process involves downloading the script, executing it to install the software, and configuring the default user password.
-
Update Package Cache: The system updates its package index to ensure all dependencies are current.
-
Download Installation Script: The official ClickHouse installation script is downloaded to the
/rootdirectory usingcurl. -
Execute Installation: The script located at
/root/clickhouseis executed. During this process:-
The password for the default user is set using the root password.
-
The server is configured to accept incoming connections.
-
-
Start Service: Upon successful installation, the ClickHouse service is started immediately.
Databases¶
ClickHouse functions as the primary database engine in this deployment.
-
Connection Method: Connections are established via the default ClickHouse port.
-
Storage Location: Data is stored in the default ClickHouse data directories managed by the service.
-
Default User: A default user account is created during installation with a password set to match the root password.
Available Ports for Connection¶
The following port is utilized for client connections to the ClickHouse server:
- 9000: Default TCP port for ClickHouse native protocol.
Starting, Stopping, and Updating¶
Service management for ClickHouse is handled using the native clickhouse command-line utility.
-
Start Service:
-
Stop Service:
-
Restart Service:
File and Directory Structure¶
The installation places the ClickHouse binary and configuration files in standard system locations.
-
Installation Script:
/root/clickhouse -
Configuration Files: Located in
/etc/clickhouse-server/(standard ClickHouse configuration path). -
Data Directory: Located in
/var/lib/clickhouse/(standard ClickHouse data path). -
Log Files: Located in
/var/log/clickhouse-server/(standard ClickHouse log path).
Access Rights and Security¶
Security configurations are applied during the installation phase to ensure the server operates correctly within the network environment.
-
Connection Acceptance: The server is explicitly configured to accept connections from external clients during the installation prompt.
-
User Authentication: The default user is secured with a password set during the installation process.
-
Firewall: Ensure that the firewall rules on the server allow inbound traffic on port
9000.