Home > Software design >  Is my network port available to the outside world?
Is my network port available to the outside world?

Time:10-14

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?

CodePudding user response:

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.

  • Related