本文主要是介绍Clickhouse报错:DB::Exception: Cannot lock file /var/lib/clickhouse/status,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
一、问题描述
clickhouse启动后,本身也可以访问没有问题,而且外部也可以访问,但是查看其error日志,发现一直有报错
tail -f clickhouse-server/clickhouse-server.err.log
结果:
2020.10.07 19:05:32.720350 [ 8150 ] {} <Error> Application: DB::Exception: Cannot lock file /var/lib/clickhouse/status. Another server instance in same directory is already running.
2020.10.07 19:06:02.970577 [ 8217 ] {} <Error> Application: DB::Exception: Cannot lock file /var/lib/clickhouse/status. Another server instance in same directory is already running.
2020.10.07 19:06:33.220827 [ 8632 ] {} <Error> Application: DB::Exception: Cannot lock file /var/lib/clickhouse/status. Another server instance in same directory is already running.
2020.10.07 19:07:03.471225 [ 8706 ] {} <Error> Application: DB::Exception: Cannot lock file /var/lib/clickhouse/status. Another server instance in same directory is already running.
2020.10.07 19:07:33.720339 [ 8880 ] {} <Error> Application: DB::Exception: Cannot lock file /var/lib/clickhouse/status. Another server instance in same directory is already running.
...
一直不停止,所以这个很尬尴。
二、问题解决
经过探查,可能是因为之前有clickhouse-server启动2次导致,所以,直接依据日志目录,查看这个status文件
cat /var/lib/clickhouse/status
ps -ef | grep clickhouse-server
删除对应clickhouse-server
kill -9 $pid
systemctl start clickhouse-server
然后,重新查看错误日志,就ok了
tail -f clickhouse-server/clickhouse-server.err.log
这篇关于Clickhouse报错:DB::Exception: Cannot lock file /var/lib/clickhouse/status的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!