下载连接:
clickhouse-tgz-stable安装包下载_开源镜像站-阿里云 (aliyun.com)
将clickhouse-client-22.2.2.1.tgz clickhouse-common-static-22.2.2.1.tgz
clickhouse-common-static-dbg-22.2.2.1.tgz
clickhouse-server-22.2.2.1.tgz 上传到/opt/software
将clickhouse-client-22.2.2.1.tgz
clickhouse-common-static-22.2.2.1.tgz
clickhouse-common-static-dbg-22.2.2.1.tgz
clickhouse-server-22.2.2.1.tgz 解压到/opt/module
解压clickhouse
tar -zxvf clickhouse-client-22.2.2.1.tgz -C /opt/module
tar -zxvf clickhouse-common-static-22.2.2.1.tgz -C /opt/module
tar -zxvf clickhouse-common-static-dbg-22.2.2.1.tgz -C /opt/module
tar -zxvf clickhouse-server-22.2.2.1.tgz -C /opt/module
运行
cd /opt/module/clickhouse-client-22.2.2.1/install/
./doinst.sh
cd /opt/module/clickhouse-common-static-22.2.2.1/install/
./doinst.sh
cd /opt/module/clickhouse-common-static-dbg-22.2.2.1/install/
./doinst.sh
cd /opt/module/clickhouse-server-22.2.2.1/install/
./doinst.sh
运行./clickhouse-server-21.9.4.35/install/doinst.sh
后,clickhouse会默认创建一个default的用户,让你设置密码,不设置密码可以按回车
启动
#查看命令
clickhouse --help
#启动
clickhouse start
systemctl start clickhouse-server
连接clickhouse
clickhouse-client -u default --password 设置的密码
clickhouse-client --host 192.168.23.60 --port 9000 --database default --user default --password "123456"
clickhouse相关目录
#命令目录
/usr/bin
ll |grep clickhouse
#配置文件目录
cd /etc/clickhouse-server/
#日志目录
cd /var/log/clickhouse-server/
#数据文件目录
cd /var/lib/clickhouse/
允许远程访问
clickhouse 默认不允许远程访问,需要修改配置文件:
cd /opt/moudle/clickhouse-server-22.2.2.1/etc/clickhouse-server/
vi config.xml
注意:只需要把 <listen_host>::</listen_host> 这一个的注释放开即可。
重启clickhouse服务:
clickhouse restart
在浏览器输入服务器ip:8123验证一下,显示OK即代表可远程连接。