虚拟机:virtualbox7.0
操作系统:ubuntu server 22.04.3
虚拟机硬件:cpu 1,内存 2G, 硬盘 100G
采用默认安装
参照
https://clickhouse.com/docs/en/install#quick-install
安装部署
对于Debian、Ubuntu,建议使用官方预编译的deb包,运行如下命令安装这些包。
以root用户登录,执行
设置repository
apt-get install -y apt-transport-https ca-certificates curl gnupg


curl -fsSL 'https://packages.clickhouse.com/rpm/lts/repodata/repomd.xml.key' | sudo gpg --dearmor -o /usr/share/keyrings/clickhouse-keyring.gpg

echo "deb [signed-by=/usr/share/keyrings/clickhouse-keyring.gpg] https://packages.clickhouse.com/deb stable main" | sudo tee \
/etc/apt/sources.list.d/clickhouse.list

apt-get update

安装服务端客户端
apt-get install -y clickhouse-server clickhouse-client

用户组 clickhouse
用户 clickhouse
用户组 clickhouse-bridge
用户 clickhouse-bridge
为提示的默认用户输入密码:clickhouse

说明:生产环境中,强烈推荐在一个专用节点机器上运行ClickHouse Keeper。在测试环境中,如果是ClickHouse Server和ClickHouse Keeper运行在同一台服务器上,那么不必单独安装ClickHouse Keeper,它已经被包含在ClickHouse Server中了。
|------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 包 | 说明 |
| clickhouse-common-static | 安装ClickHouse编译的二进制文件集合 |
| clickhouse-server | 为clickhouse-server创建一个软连接,并安装默认的服务配置 |
| clickhouse-client | 为clickhouse-client和其他客户端工具创建一个软连接,并安装客户端配置文件集合 |
| clickhouse-common-static-dbg | 安装ClickHouse编译的二进制文件集合,且带有调试信息 |
| clickhouse-keeper | 被用来将ClickHouse Keeper安装在专用的ClickHouse Keeper节点(若干个节点)上。如果已经在ClikcHouse server所在的服务器上运行了ClickHouse Keeper,那么不必在安装这个包。这个包就是用来安装ClickHouse Keeper和默认的ClickHouse Keeper配置文件集合。 |
说明:如果你需要安装特定版本的ClickHouse,那么你安装时所有的包必须版本相同。如apt-get install clickhouse-server=21.8.5.7 clickhouse-client=21.8.5.7 \
clickhouse-common-static=21.8.5.7
启动服务端
service clickhouse-server start ,具体操作截图


查看日志,可以按照如下路径 /var/log/clickhouse-server
如果服务没有被启动,检查配置文件,其路径为 /etc/clickhouse-server/config.xml
启动客户端
clickhouse-client 具体操作截图

按照提示清除文件后,不再需要密码,直接登录客户端

