-1

Background

First time working with Azure. I'm deploying a database server (ClickHouse) onto a VM hosted in Azure, and have it started up fine. The VM is running Ubuntu. The database server's default ports are localhost port 9000 for TCP (used by the command line client) and 8123 for HTTP (used by application clients).

Issue

The db server should be listening on the server's default http port (8123). However, when I try to connect, it just hangs. Based on the below steps, I don't think the network request is making it to the server.

Steps I've tried

  • Started the containerized version on my local machine and used the exact same curl command to run a simple SELECT 1 query against it (http://localhost:8123). This succeeds and proves to me that the request is not malformed.
  • Verified that the server is responsive via the local client on the VM (while SSH'ed in)
  • Added my IP address and the port in the VNET's "inbound port rules". I've been able to access my public IP via SSH after adding a similar rule for that.

image my ip is valid irl

  • $ telnet my.public.ip.address 8123 <- obviously with the actual ip in there. this hangs as well
  • While SSH'ed in, I've run $ ss -atn | grep 8123 and see:
State       Recv-Q   Send-Q          Local Address:Port          Peer Address:Port
LISTEN      0        4096            127.0.0.1:8123              0.0.0.0:*
LISTEN      0        4096                [::1]:8123                 [::]:*

I'm not an expert at the network component of this. I think this means the server is listening to 8123 on localhost as well as all other addresses. I take that latter part to mean that it should be exposed publicly. I also believe LISTEN means it is ready to accept connections, but no connections are currently open.

Any ideas?

Switch386
  • 454
  • 6
  • 19

1 Answers1

1

LISTEN 0 4096 127.0.0.1:8123
0.0.0.0:*

expected:

LISTEN     0      4096                        *:8123                          *:*

Your Clickhouse listens localhost only

solution:

cat /etc/clickhouse-server/config.d/port.xml
<?xml version="1.0"?>
<yandex>
    <listen_host>::</listen_host>
</yandex>

and restart CH.

Denny Crane
  • 11,574
  • 2
  • 19
  • 30
  • What's the purpose of the second entry in there? `[::1]:8123` – Switch386 Oct 13 '22 at 18:52
  • also, what is the difference between the `yandex` and `clickhouse` root elements in the config files? the config that was autogenerated with the ch install resulted in a root element of `clickhouse` – Switch386 Oct 13 '22 at 19:01
  • [::1]:8123 -- localhost in ipv6 terms https://stackoverflow.com/questions/4611418/what-is-ip-address-1 – Denny Crane Oct 13 '22 at 19:05
  • 1
    originally root tag was ``. Now they changed it to ``. Current stable version supports both. Old versions obviously supported only yandex. You have not provided a version of your Clickhouse, so I decided to use `` – Denny Crane Oct 13 '22 at 19:07
  • got it, i assumed it was something like that. i'm using the latest stable. this was helpful. there's still something at my org level preventing traffic from reaching the VM i think. going to work with them now! thank you for the assistance! – Switch386 Oct 13 '22 at 22:17