ClickHouse单节点部署
#环境检测
# grep -q sse4_2 /proc/cpuinfo && echo "SSE 4.2 supported" || echo "SSE 4.2 not supported"
1. #yum安装clickhouse,留意安装时打印的默认日志目录
yum install yum-utils rpm --import https://repo.clickhouse.tech/CLICKHOUSE-KEY.GPG yum-config-manager --add-repo https://repo.clickhouse.tech/rpm/stable/x86_64 yum install clickhouse-server clickhouse-client
#如果没有网络,可以下载rpm进行离线安装
clickhouse-22.2.2.1-2.x86_64.rpm离线安装包-其它文档类资源-CSDN下载
rpm -ivh clickhouse-common-static-22.2.2.1-2.x86_64.rpm
rpm -ivh clickhouse-server-22.2.2.1-2.noarch.rpm
rpm -ivh clickhouse-client-22.2.2.1-2.noarch.rpm
2. #修改/etc/clickhouse-server/config.xml监听
<listen_host>0.0.0.0</listen_host>
3. #修改/etc/clickhouse-server/users.xml在<users>中增加clickhouse及密码设置如下
<clickhouse> <password>clickhouse</password> <networks incl="networks" replace="replace"> <ip>::/0</ip> </networks> <profile>default</profile> <quota>default</quota> </clickhouse>
4. #启动clickhouse
systemctl start clickhouse-server
5. #url连接测试
curl 'http://localhost:8123/' curl -d "show databases;" 'http://localhost:8123/?user=default&password=default'
6. #clickhouse客户端连接
clickhouse-client -h localhost --port=9000 -u clickhouse --password clickhouse