How to Solve ClickHouse Connect Error: Connection refuse

When using code to connect Clickhouse, you encounter an error connection reference, the following solutions are available.

Method 1: close the firewall

#Stop firewall
systemctl stop firewalld.service

#Stop firewall start     
systemctl disable firewalld.service

Method 2: modify the configuration file config.xml

Edit the configuration file /etc/Clickhouse server/config.XML, open the comment on line 156

<listen_host>::1</listen_host>

Method 3: there is a problem with the port number

Read More: