1. 启动报错

     clickhouse-server --config-file=/etc/clickhouse-server/config.xml
     报错:
     <Error> Application: DB::Exception: Effective user of the process (root) does not match the owner of the data (clickhouse). Run under 'sudo -u clickhouse'.
    
     journalctl -xe -u clickhouse-server
     报错:
     Oct 14 02:57:10 153 systemd[1]: clickhouse-server.service: main process exited, code=exited, status=218/CAPABILITIES
     Oct 14 02:57:10 153 systemd[1]: Failed to start ClickHouse Server (analytic DBMS for big data).
    

解决方案:
表面是权限报错,先检查权限,其实有可能是centos某些内核版本不支持启动参数导致

vi /usr/lib/systemd/system/clickhouse-server.service

#把这两行注释掉
CapabilityBoundingSet=CAP_NET_ADMIN CAP_IPC_LOCK CAP_SYS_NICE CAP_NET_BIND_SERVICE
AmbientCapabilities=CAP_NET_ADMIN CAP_IPC_LOCK CAP_SYS_NICE CAP_NET_BIND_SERVICE CAP_SYS_RESOURCE
Logo

码道开发者社区,聚焦华为云码道 CodeArts 代码智能体,沉淀 Agent、Skill、鸿蒙开发实战内容,供开发者查阅资料、交流技术、分享工程实践

更多推荐