clickhouse 单机版部署

安装

rpm --import https://repo.clickhouse.tech/CLICKHOUSE-KEY.GPG  
yum install yum-utils  
yum-config-manager --add-repo https://repo.clickhouse.tech/rpm/stable/x86_64  
yum install clickhouse-server clickhouse-client

mkdir -p /data/db/clickhouse/  
mkdir -p /data/logs/clickhouse-server  
mkdir -p /data/db/clickhouse/tmp/  
chown -R clickhouse.clickhouse  /data/db/clickhouse  
chown -R clickhouse.clickhouse /data/logs/clickhouse-server

生成密码

PASSWORD=$(base64 < /dev/urandom | head -c8); echo "$PASSWORD"; echo -n "$PASSWORD" | sha256sum | tr -d '-'

LNeDfdDg  
d258f61e53986927f1a9f6de22229482d6a029e981ebef9db5db9d7d91aec2d  

user.xml配置密码

<password>LNeDfdDg</password>  

启动服务

service clickhouse-server start  

连接

# clickhouse-client
clickhouse-client -h 10.3.100.1 -d default -m -u default --password 'LNeDfdDg'

# 使用mysql接口
mysql -h10.3.100.1 -P9004 -udefault -p'LNeDfdDg'