ClickHouse Listen_host force to IPV4 (Address family not supported by protocol [system:97] on port 9444)
search cancel

ClickHouse Listen_host force to IPV4 (Address family not supported by protocol [system:97] on port 9444)

book

Article ID: 386052

calendar_today

Updated On:

Products

WatchTower

Issue/Introduction

How to actually get clickhouse to stop trying to come up with IPv6 since it doesn't seem that listen_host=0.0.0.0 isn't forcing it to just IPv4.

Error :

Getting this traceback when attempting to start Keeper in our on-prem cluster.

2025.01.14 18:47:05.782286 [ 43 ] {} <Error> RaftInstance: got exception: open: Address family not supported by protocol [system:97] on port 9444
2025.01.14 18:47:05.782470 [ 43 ] {} <Error> void DB::KeeperDispatcher::initialize(const Poco::Util::AbstractConfiguration &, bool, bool, const MultiVersion<Macros>::Version &): Code: 568. DB::Exception: Cannot create interserver listener on port 9444. (RAFT_ERROR),

Cause

By default Clickhouse DB will try to connect to IPV6

Resolution

The following steps will address the issue - 

1) We have added the configs enable_ipv6=false, and listen_host=0.0.0.0 under clickhouse -> keeper_server to the keeper.defaultConfigurationOverrides value (which is evaluated as a helm template to create an xml file), which will enable it to connect on clusters using only ipv4. the defaultConfigurationOverrides value becomes an xml file, which the user must provide in full in the values. So to add a config, the user must provide the entire file as a value. So the upgrade-values.yaml is the default file plus the 2 lines to add the new config properties

Like below 

 <tcp_port>{{ $.Values.containerPorts.keeper }}</tcp_port>
          <enable_ipv6>false<enable_ipv6>
          <listen_host>0.0.0.0</listen_host>

 

2) Exact command is like below - 

helm -n <namespace> upgrade common-service-clickhouse <path to watchtower helm tar> --reset-then-reuse-values -f upgrade-values.yaml
 
3)  The user may need to  set interserver_listen_host=0.0.0.0 in the same way as the other 2 values.