clickhouse 运维

注意
本文最后更新于 2024-05-13,文中内容可能已过时。

重启服务

1
2
3
4
sudo service clickhouse-server restart

## 可以待配置启动,方便查找问题
sudo -u clickhouse clickhouse-server --config-file=/etc/clickhouse-server/config.xml

修改 default 用户配置

1
2
3
4
5
6
vim /etc/clickhouse-server/users.xml

<access_management>1</access_management>
<named_collection_control>1</named_collection_control>
<show_named_collections>1</show_named_collections>
<show_named_collections_secrets>1</show_named_collections_secrets>

开放远程访问

1
2
3
4
vim /etc/clickhouse-server/config.xml

## 将以下配置行注释去掉,允许所以访问
<listen_host>::</listen_host>

添加用户

1
2
CREATE USER IF NOT EXISTS dataops IDENTIFIED WITH sha256_password BY 'xxxxxxxxxxx';
GRANT ALL ON bardata.* TO dataops;

登录

1
clickhouse-client -h 192.168.2.100  -u dataops  --password
william 支付宝支付宝
william 微信微信
0%