ClickHouse单机版本安装
时间: 2023-05-25 07:04:20 浏览: 189
Clickhouse离线安装包
以下是在Ubuntu系统上安装单机版ClickHouse的步骤:
1. 添加ClickHouse源到Ubuntu镜像中
```
$ sudo apt-get install apt-transport-https ca-certificates dirmngr
$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv E0C56BD4
$ echo "deb https://repo.clickhouse.tech/deb/stable/ main/" | sudo tee \
/etc/apt/sources.list.d/clickhouse.list
```
2. 更新系统和安装ClickHouse
```
$ sudo apt-get update
$ sudo apt-get install clickhouse-server clickhouse-client
```
3. 配置ClickHouse
默认配置文件位于`/etc/clickhouse-server/config.xml`。可以使用以下命令将其拷贝到当前目录以方便编辑:
```
$ sudo cp /etc/clickhouse-server/config.xml .
```
然后,您可以编辑`config.xml`以适应您的需求。有关各种选项的详细信息,请查阅ClickHouse文档。
4. 启动ClickHouse服务
```
$ sudo service clickhouse-server start
```
您现在可以使用ClickHouse客户端连接到服务器并执行查询:
```
$ clickhouse-client
ClickHouse client version 21.5.5.
Connecting to localhost:9000.
Connected to ClickHouse server version 21.5.5.
127.0.0.1:9000 :) SELECT 1+1;
SELECT 1+1
┌─1─┐
│ 2 │
└───┘
1 rows in set. Elapsed: 0.003 sec.
```
阅读全文