1.下载安装包
官方下载地址:https://packages.clickhouse.com/tgz/stable
阿里云下载地址:clickhouse-tgz-stable安装包下载_开源镜像站-阿里云
共需要下载四个文件
clickhouse-common-static-20.3.10.75.tgz
clickhouse-common-static-dbg-20.3.10.75.tgz
clickhouse-server-20.3.10.75.tgz
clickhouse-client-20.3.10.75.tgz
2.解压压缩包并且执行安装脚本
新建目录/opt/software/并且进入
mkdir -p /opt/software/
cd /opt/software/
使用xftp将tgz包上传到目录/opt/software/
2.1 clickhouse-common-static-20.3.10.75.tgz
tar -zxvf clickhouse-common-static-20.3.10.75.tgz
./clickhouse-common-static-20.3.10.75/install/doinst.sh
2.2 clickhouse-common-static-dbg-20.3.10.75.tgz
tar -zxvf clickhouse-common-static-dbg-20.3.10.75.tgz
./clickhouse-common-static-dbg-20.3.10.75/install/doinst.sh
2.3 clickhouse-server-20.3.10.75.tgz
tar -zxvf clickhouse-server-20.3.10.75.tgz
./clickhouse-server-20.3.10.75/install/doinst.sh
2.4 clickhouse-client-20.3.10.75.tgz
tar -zxvf clickhouse-client-20.3.10.75.tgz
./clickhouse-client-20.3.10.75/install/doinst.sh
2.5 启动clickhouse
因为我的服务器是ubuntu所有启动命令是
systemctl status clickhouse-server
如果是其他的则为
clickhouse start
查看是否启动成功若启动失败如下则继续
使用命令查看错误,进入后使用shift+g到最底层
journalctl -u clickhouse-server
发现缺失了目录/var/log/clickhouse-server,我们直接创建目录并且赋权限
mkdir -p /var/log/clickhouse-server
sudo chown -R clickhouse:clickhouse /var/log/clickhouse-server
再次使用journalctl -u clickhouse-server查看是否有错误,发现又缺个目录
mkdir -p /var/lib/clickhouse
sudo chown -R clickhouse:clickhouse /var/lib/clickhouse
查看发现无问题