Can't listen on ipv4

134 views
Skip to first unread message

joan.ba...@gmail.com

unread,
Mar 6, 2023, 9:22:42 AM3/6/23
to ClickHouse
Hi,

Just installed ClickHouse server version 23.3.1 revision 54461

In config.xml I setup to listen on all ipv4 interfaces:
<!-- Same for hosts without support for IPv6: -->
<listen_host>0.0.0.0</listen_host>

If I try a telnet to the public ip address on port 9000, it works. But when I try to perform a CH connection, I get a timeout.

We see below, it seems only ipv6 is being used:

root@clickhouse-backup:~# lsof -p $(pgrep clickhouse) -i -Pan
COMMAND    PID       USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
clickhous 1581 clickhouse   44u  IPv6  15122      0t0  TCP *:9005 (LISTEN)
clickhous 1581 clickhouse   50u  IPv6  15118      0t0  TCP *:9000 (LISTEN)
clickhous 1581 clickhouse   51u  IPv6  15124      0t0  TCP *:9009 (LISTEN)
clickhous 1581 clickhouse   52u  IPv6  15116      0t0  TCP *:8123 (LISTEN)
clickhous 1581 clickhouse   53u  IPv6  15120      0t0  TCP *:9004 (LISTEN)

What am I missing?

Thanks,

Joan.

Vladimir

unread,
Mar 6, 2023, 11:16:06 AM3/6/23
to ClickHouse
Hi, Joan

Do you have lines like
```
2023.03.06 16:14:23.219410 [ 2668858 ] {} <Information> Application: Listening for http://0.0.0.0:8123
2023.03.06 16:14:23.219482 [ 2668858 ] {} <Information> Application: Listening for native protocol (tcp): 0.0.0.0:9000
2023.03.06 16:14:23.219540 [ 2668858 ] {} <Information> Application: Listening for native protocol (tcp) with PROXY: 0.0.0.0:9010
2023.03.06 16:14:23.219599 [ 2668858 ] {} <Information> Application: Listening for MySQL compatibility protocol: 0.0.0.0:9004
2023.03.06 16:14:23.219664 [ 2668858 ] {} <Information> Application: Listening for PostgreSQL compatibility protocol: 0.0.0.0:9005
2023.03.06 16:14:23.219722 [ 2668858 ] {} <Information> Application: Listening for replica communication (interserver): http://0.0.0.0:9009
``` in the log?
Are there any Error or Warning? Also you may provide the full config.
Message has been deleted

joan.ba...@gmail.com

unread,
Mar 6, 2023, 1:35:53 PM3/6/23
to ClickHouse
Hi Vladimir,

># grep "Listening" *.log
clickhouse-server.log:2023.03.06 18:17:06.605287 [ 909 ] {} <Information> Application: Listening for http://[::]:8123
clickhouse-server.log:2023.03.06 18:17:06.605347 [ 909 ] {} <Information> Application: Listening for native protocol (tcp): [::]:9000
clickhouse-server.log:2023.03.06 18:17:06.605394 [ 909 ] {} <Information> Application: Listening for MySQL compatibility protocol: [::]:9004
clickhouse-server.log:2023.03.06 18:17:06.605432 [ 909 ] {} <Information> Application: Listening for PostgreSQL compatibility protocol: [::]:9005
clickhouse-server.log:2023.03.06 18:17:06.605474 [ 909 ] {} <Information> Application: Listening for replica communication (interserver): http://[::]:9009


It seems to be listening on [::], but I have the following in the config.xml:

    <!-- Listen specified address.
         Use :: (wildcard IPv6 address), if you want to accept connections both with IPv4 and IPv6 from everywhere.
         Notes:
         If you open connections from wildcard address, make sure that at least one of the following measures applied:
         - server is protected by firewall and not accessible from untrusted networks;
         - all users are restricted to subset of network addresses (see users.xml);
         - all users have strong passwords, only secure (TLS) interfaces are accessible, or connections are only made via TLS interfaces.
         - users without password have readonly access.
         See also: https://www.shodan.io/search?query=clickhouse
      -->
    <!-- <listen_host>::</listen_host> -->



    <!-- Same for hosts without support for IPv6: -->
    <listen_host>0.0.0.0</listen_host>

    <!-- Default values - try listen localhost on IPv4 and IPv6. -->
    <!--
    <listen_host>::1</listen_host>
    <listen_host>127.0.0.1</listen_host>
    -->

    <!-- <interserver_listen_host>::</interserver_listen_host> -->
    <!-- Listen host for communication between replicas. Used for data exchange -->
    <!-- Default values - equal to listen_host -->

    <!-- Don't exit if IPv6 or IPv4 networks are unavailable while trying to listen. -->
    <!-- <listen_try>0</listen_try> -->

    <!-- Allow multiple servers to listen on the same address:port. This is not recommended.
      -->
    <!-- <listen_reuse_port>0</listen_reuse_port> -->

    <!-- <listen_backlog>4096</listen_backlog> -->


Here my net config:

># ifconfig
enp7s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1450
        inet 10.0.0.9  netmask 255.255.255.255  broadcast 10.0.0.9
        inet6 fe80::8400:ff:fe3a:df9c  prefixlen 64  scopeid 0x20<link>
        ether 86:00:00:3a:df:9c  txqueuelen 1000  (Ethernet)
        RX packets 1  bytes 350 (350.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 13  bytes 1278 (1.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 95.216.203.192  netmask 255.255.255.255  broadcast 95.216.203.192
        inet6 fe80::9400:1ff:fef7:8cfb  prefixlen 64  scopeid 0x20<link>
        inet6 2a01:4f9:c010:d027::1  prefixlen 64  scopeid 0x0<global>
        ether 96:00:01:f7:8c:fb  txqueuelen 1000  (Ethernet)
        RX packets 1457  bytes 130150 (127.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1410  bytes 676782 (660.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 80  bytes 6000 (5.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 80  bytes 6000 (5.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


I also see this in the stderr.log:

> # more stderr.log
Logging trace to /var/log/clickhouse-server/clickhouse-server.log
Logging errors to /var/log/clickhouse-server/clickhouse-server.err.log
Processing configuration file '/etc/clickhouse-server/config.xml'.
Merging configuration file '/etc/clickhouse-server/config.d/data-paths.xml'.
Merging configuration file '/etc/clickhouse-server/config.d/listen.xml'.
Merging configuration file '/etc/clickhouse-server/config.d/logger.xml'.
Merging configuration file '/etc/clickhouse-server/config.d/openssl.xml'.
Merging configuration file '/etc/clickhouse-server/config.d/user-directories.xml'.
Saved preprocessed configuration to '/var/lib/clickhouse/preprocessed_configs/config.xml'.
Processing configuration file '/etc/clickhouse-server/users.xml'.
Merging configuration file '/etc/clickhouse-server/users.d/default-password.xml'.
Include not found: networks
Include not found: networks
Include not found: networks
Include not found: networks
Saved preprocessed configuration to '/var/lib/clickhouse/preprocessed_configs/users.xml'.


Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
0 new messages