当前位置: 首页> 文旅> 美景 > Ubuntu下ClickHouse安装

Ubuntu下ClickHouse安装

时间:2025/7/10 16:47:37来源:https://blog.csdn.net/qq_31805821/article/details/139584430 浏览次数:0次

用 root 身份运行, 注意在install那一步, 不要设置密码

# 使用官方安装源,跳过签名验证。(因为使用 gpg 完全通过代理获取签名的问题至今没有解决。)
echo 'deb [trusted=yes] https://packages.clickhouse.com/deb stable main' > /etc/apt/sources.list.d/clickhouse.list
apt update# 安装最新版
apt install -y clickhouse-{server,client}# 也可以指定安装精确的版本号
apt list -a clickhouse-server | head
apt install -y clickhouse-{server,client}=23.12.2.59# 启动服务并配置开机自动启动
systemctl start clickhouse-server
systemctl enable clickhouse-server

如果不小心设置了密码, 设置/etc/clickhouse-server/users.d/default-password.xml为如下内容

<clickhouse>
<users>
<default>
<password></password>
</default>
</users>
</clickhouse>

另外, 检查/etc/clickhouse-server/config.d/listen.xml文件是否存在

如果没有, 创建该文件, 添加如下内容

<clickhouse>
<listen_host>::</listen_host>
</clickhouse>

再重启clickhouse

systemctl restart clickhouse-server

这样同内网的其他机器即可通过远程9000端口来访问该clickhouse, 否则其只能提供本地访问服务

clickhouse-client --host 10.0.0.X

如果service启动不了, 可以手动启动clickhouse-server --config-file=/etc/clickhouse-server/config.xml查看原因

若遇到报错

Effective user of the process (root) does not match the owner of the data (clickhouse). Run under 'sudo -u clickhouse'

则使用chown -R clickhouse:clickhouse /var/lib/clickhouse可修复问题

关键字:Ubuntu下ClickHouse安装

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: