1. 程式人生 > 其它 >Another server instance in same directory is already running

Another server instance in same directory is already running

when i run a query. Service restart. And then I see the error log. Message:

2019.05.08 22:09:40.754275 [ 1 ] {} Application: DB::Exception: Cannot lock file /data/clickhouse/data/status. Another server instance in same directory is already running.
2019.05.08 22:10:11.005677 [ 1 ] {} Application: DB::Exception: Cannot lock file /data/clickhouse/data/status. Another server instance in same directory is already running.
2019.05.08 22:20:04.191684 [ 1 ] {} Application: DB::Exception: Cannot lock file /data/clickhouse/data/status. Another server instance in same directory is already running.
2019.05.08 22:20:34.507849 [ 1 ] {} Application: DB::Exception: Cannot lock file /data/clickhouse/data/status. Another server instance in same directory is already running.

I meet this question too.the real reason is that we had started one more clickhouse-server.
if you " ps -ef | grep clickhouse-server " and "service clickhouse-server status" you will find
the pid is different.so you just need kill the started pid and restart clickhouse-server
this is my solution
cat ./status
ps -ef | grep clickhouse-server
kill -9 $pid
service clickhouse-server start

sudo systemctl status clickhouse-server