2
votes

I have installed clickhouse as per the instructions here https://github.com/Altinity/clickhouse-rpm-install.

I have also enabled :: in /etc/clickhouse-server/config.xml.

It started fine as below:

sudo /etc/init.d/clickhouse-server restart Start clickhouse-server service: Path to data directory in /etc/clickhouse-server/config.xml: /var/lib/clickhouse/ DONE

But, when i start client it fails as below:

sudo clickhouse-client ClickHouse client version 1.1.54383. Connecting to localhost:9000. Code: 102. DB::NetException: Unexpected packet from server localhost:9000, ::1 (expected Hello or Exception, got Unknown packet)

2

2 Answers

4
votes

Having the following error:

Code: 102. DB::NetException: Unexpected packet from server localhost:9000, ::1 (expected Hello or Exception, got Unknown packet)

means that clickhouse-client got an answer, but an incorrect one, which means that another software (not ClickHouse) is listening on localhost:9000 Highly likely it is php-fpm, because it also has port 9000 as a default one.

You can check what software is listening on port 9000 with the following command:

sudo netstat -antp|grep LIST|grep 9000

As a solution too the issue, you can do something like:

  • change port to listen to for clickhouse
  • change port to listen to for the software, which is currently listening on port 9000
  • shutdown software, which is currently listening on port 9000
1
votes

I had to change port in /etc/clickhouse-server/config.xml and pass it as a parameter when launching client as below:

clickhouse-client --port 9011