Article directory
1.Installation
使用Deb安装包
// 添加证书
sudo apt-get install -y apt-transport-https ca-certificates dirmngr
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 8919F6BD2B48D754
// 更新软件源
echo "deb https://packages.clickhouse.com/deb stable main" | sudo tee \
/etc/apt/sources.list.d/clickhouse.list
sudo apt-get update
// 下载ck
sudo apt-get install -y clickhouse-server clickhouse-client
# Enter password for default user: 123456 // 我的密码设为123456,初始用户default
// 启动ck
sudo service clickhouse-server start
clickhouse-client # or "clickhouse-client --password"
使用离线包
https://packages.clickhouse.com/deb/pool/main/c/clickhouse-server/
2.Configuration
- Run the external connection and uncomment this line
- Restart service
sudo service clickhouse-server restart
3. External connection test
Enable DBeaver to manage ck
- Enter the remote host address, user name default, password 123456
- Click Test Connection to automatically download the driver for the first time
- Then it shows that the connection is successful
4. Related concepts
- The difference between clickhouse8123 and 9000 ports:
1.1. 8123 port (HTTP port) [jdbc mode]:
used to interact with the ClickHouse database through the HTTP protocol.
Supports RESTful API and HTTP query syntax.
You can use browsers, curl and other tools to send HTTP requests and receive responses.
Usually used to execute queries, obtain data and manage ClickHouse clusters.
1.2. Port 9000 (TCP port) [Interconnection of two machines]:
used to interact with the ClickHouse database through the TCP/IP protocol.
Communicates using ClickHouse custom binary protocol.
Supports higher concurrency and performance.
Usually used in high-performance scenarios such as large-scale data import, data writing, and data processing.