5

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)

dsr301
  • 759
  • 3
  • 7
  • 21

4 Answers4

2

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
Vladislav
  • 37
  • 2
0

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

dsr301
  • 759
  • 3
  • 7
  • 21
0

I had the same error when mixing https://clickhouse-driver.readthedocs.io/en/latest/quickstart.html#streaming-results with other queries.

It has nothing to do with other services listening on the same port.

Federico
  • 722
  • 12
  • 12
0

I had to add user name default when connecting to clickhouse.

Ayudh
  • 1,673
  • 1
  • 22
  • 55