default port of clickhouse did not change after I modify config.xml

Viewed 1887

I'm new to clickhouse.

Because my hadoop use the port 9000,conflict with clickhouse's default port

Here's my steps to modify the port:

①sudo gedit /etc/clickhouse-server/config.xml change all 9000 to 9500

②sudo service clickhouse-server restart

③clickhouse-client -u default --password

Connecting to localhost:9000 as user default. Code: 210. DB::NetException: Connection refused (localhost:9000)

④clickhouse-client -u default --port 9500 --password

then connection is OK

-------------------------------------

My question is:

In the future,there will be other needs to modify the config.xml

why my modification did not take effect after I restart clickhouse sevice?

Thanks for for your reading and help~

1 Answers

clickhouse-client -- different application and it's a client and it has own configuration /etc/clickhouse-client/

By default it tries to connect to localhost:9000 . It has no information that clickhouse-server uses the port 9500

You can override default port for the client

cat /etc/clickhouse-client/config.xml

<config>
    <port>9500</port>
....
Related