使用yum命令安装
yum install clickhouse-server clickhouse-client
启动
/etc/init.d/clickhouse-server start 日志文件将输出在/var/log/clickhouse-server/文件夹 sudo service clickhouse-server status
连接客户端
clickhouse-client show database;
默认情况下,使用default
用户并不携带密码连接到localhost:9000
。还可以使用--host
参数连接到指定服务器。终端必须使用UTF-8编码。
允许远程访问
# 开放外网访问,vim config.xml 找到 listen_host 标签,修改为以下; #<listen_host>0.0.0.0</listen_host> cd /etc/clickhouse-server/ vim config.xml #只读文件,需要 ==》:wq!
重启:
clickhouse restart
在浏览器输入服务器ip+8123验证一下,出现==》ok
设置或更改clickhouse 用户名密码
获取密码的加密字符串:替换命令中的$PASSWORD为你的密码
# 官方不建议直接写明文密码,可以用以下命令生成密码 PASSWORD=$(base64 < /dev/urandom | head -c8); echo "$PASSWORD"; echo -n "$PASSWORD" | sha256sum | tr -d '-' cd /etc/clickhouse-server ls vi users.xml # 替换找到 users --> default --> 标签下的password修改成password_sha256_hex,并把密文填进去 <password></password> 为 <password_sha256_hex>加密串</password_sha256_hex>
服务启动/停止
状态: service clickhouse-server status systemctl status clickhouse-server 启动: service clickhouse-server start systemctl start clickhouse-server 停止: service clickhouse-server stop systemctl stop clickhouse-server 重启: service clickhouse-server restart systemctl restart clickhouse-server
删除服务
yum list installed | grep clickhouse yum remove -y clickhouse-common-static yum remove -y clickhouse-server-common rm -rf /var/lib/clickhouse rm -rf /etc/clickhouse-* rm -rf /var/log/clickhouse-server标签:service,流程,server,etc,systemctl,yum,安装,clickhouse From: https://www.cnblogs.com/xiaoyuanbk/p/17601268.html