启动系统服务clickhouse报错clickhouse

发布时间:2024-11-07 02:15

错误:

使用 

systemctl start clickhouse-server

启动失败,报错信息如下:

[root@hantest mysql]# systemctl status clickhouse-server

● clickhouse-server.service - ClickHouse Server (analytic DBMS for big data)

Loaded: loaded (/etc/systemd/system/clickhouse-server.service; enabled; vendor preset: disabled)

Active: activating (auto-restart) (Result: exit-code) since Wed 2021-06-30 10:03:22 CST; 2s ago

Process: 5711 ExecStart=/usr/bin/clickhouse-server --config=/etc/clickhouse-server/config.xml --pid-file=/run/clickhouse-server/clickhouse-server.pid (code=exited, status=232/ADDRESS_FAMILIES)

Main PID: 5711 (code=exited, status=232/ADDRESS_FAMILIES)

Jun 30 10:03:22 hantest.com systemd[1]: clickhouse-server.service: main process exited, code=exited, status=232/ADDRESS_FAMILIES

Jun 30 10:03:22 hantest.com systemd[1]: Unit clickhouse-server.service entered failed state.

Jun 30 10:03:22 hantest.com systemd[1]: clickhouse-server.service failed.

解决:

journalctl -xe

Jun 30 10:03:21 hantest.com polkitd[751]: Unregistered Authentication Agent for unix-process:5673:185017 (system bus name :1.164, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en

Jun 30 10:03:22 hantest.com clickhouse-server[5711]: Processing configuration file '/etc/clickhouse-server/config.xml'.

Jun 30 10:03:22 hantest.com clickhouse-server[5711]: Logging trace to /var/log/clickhouse-server/clickhouse-server.log

Jun 30 10:03:22 hantest.com clickhouse-server[5711]: Poco::Exception. Code: 1000, e.code() = 13, e.displayText() = Access to file denied: /var/log/clickhouse-server/clickhouse-server.log, Stack trace

注意这行报错:

e.displayText() = Access to file denied: /var/log/clickhouse-server/clickhouse-server.log, Stack trace

查看日志:

[root@hantest mysql]# cat /var/log/clickhouse-server/clickhouse-server.log

2021.06.30 09:28:20.685110 [ 2596 ] {} <Information> SentryWriter: Sending crash reports is disabled

2021.06.30 09:28:20.928173 [ 2596 ] {} <Trace> Pipe: Pipe capacity is 1.00 MiB

2021.06.30 09:28:21.153625 [ 2596 ] {} <Information> : Starting ClickHouse 21.6.4.26 with revision 54451, build id: 12B138DBA4B3F1480CE8AA18884EA895F9EAD439, PID 2596

2021.06.30 09:28:21.153735 [ 2596 ] {} <Information> Application: starting up

2021.06.30 09:28:21.153751 [ 2596 ] {} <Information> Application: OS Name = Linux, OS Version = 3.10.0-1160.el7.x86_64, OS Architecture = x86_64

2021.06.30 09:28:25.684603 [ 2596 ] {} <Information> Application: Calculated checksum of the binary: 26864E69BE34BA2FCCE2BD900CF631D4, integrity check passed.

2021.06.30 09:28:25.684733 [ 2596 ] {} <Trace> Application: Will do mlock to prevent executable memory from being paged out. It may take a few seconds.

2021.06.30 09:28:25.690613 [ 2596 ] {} <Trace> Application: The memory map of clickhouse executable has been mlock'ed, total 186.64 MiB

2021.06.30 09:28:25.755594 [ 2596 ] {} <Error> Application: DB::Exception: Effective user of the process (root) does not match the owner of the data (clickhouse). Run under 'sudo -u clickhouse'.

2021.06.30 09:28:25.782973 [ 2596 ] {} <Information> Application: shutting down

2021.06.30 09:28:25.782986 [ 2596 ] {} <Debug> Application: Uninitializing subsystem: Logging Subsystem

2021.06.30 09:28:25.783825 [ 2597 ] {} <Trace> BaseDaemon: Received signal -2

2021.06.30 09:28:25.783848 [ 2597 ] {} <Information> BaseDaemon: Stop SignalListener thread

使用命令:

[root@hantest mysql]# sudo -u clickhouse clickhouse-server --config-file=/etc/clickhouse-server/config.xml

Processing configuration file '/etc/clickhouse-server/config.xml'.

Logging trace to /var/log/clickhouse-server/clickhouse-server.log

Poco::Exception. Code: 1000, e.code() = 13, e.displayText() = Access to file denied: /var/log/clickhouse-server/clickhouse-server.log, Stack trace (when copying this message, always include the lines below):

发现是log文件的权限错误。查看文件权限:

[root@hantest mysql]# ll /var/log/clickhouse-server/clickhouse-server.log

-rwxrwxrwx. 1 root root 1566 Jun 30 09:28 /var/log/clickhouse-server/clickhouse-server.log

查看服务的用户权限:

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

[Unit]

Description=ClickHouse Server (analytic DBMS for big data)

Requires=network-online.target

After=network-online.target

[Service]

Type=simple

User=clickhouse

Group=clickhouse

更改权限:

[root@hantest mysql]# chown clickhouse:clickhouse /var/log/clickhouse-server/clickhouse-server.log

[root@hantest mysql]# ll /var/log/clickhouse-server/clickhouse-server.log

-rwxrwxrwx. 1 clickhouse clickhouse 1566 Jun 30 09:28 /var/log/clickhouse-server/clickhouse-server.log

 对于err_log文件同理。

重新启动,启动成功

systemctl start clickhouse-server

systemctl status clickhouse-server

原因:

疑似因为清理/var./og目录导致日志文件被误删

网址:启动系统服务clickhouse报错clickhouse https://www.yuejiaxmz.com/news/view/13637

相关内容

维修服务系统,解决家居小问题
基于javaweb个人财务管理系统
Springboot宠物网站系统6v03x(程序+源码+数据库+调试部署+开发环境)系统界面在最后面。
个人财务管理系统的设计
【开题报告】基于SSM的健康饮食系统设计与实现
基于java web个人财务管理系统
JAVA全民到家同城服务按摩养生系统小程序源码
家务劳动报告(通用15篇)
奋进新征程 运动促健康——全民健身志愿服务系列活动蓬勃开展
【开题报告】springboot大学生个人财务管理系统13bek计算机毕业设计

随便看看