HDFGroup / hsds

Cloud-native, service based access to HDF data
https://www.hdfgroup.org/solutions/hdf-kita/
Apache License 2.0
126 stars 52 forks source link

Connection refused when running with docker on Azure VM #204

Closed wiwski closed 1 year ago

wiwski commented 1 year ago

Hi,

I am having some issues trying to setup hsds on an Azure VM following this guide : https://github.com/HDFGroup/hsds/blob/master/docs/docker_install_azure.md

I just can't access $HSDS_ENDPOINT/about as I am getting the following error :

curl: (7) Failed to connect to euphro-stg-hsds.westeurope.cloudapp.azure.com port 80 after 8 ms: Connection refused

Port 80 is opened in networking rules, DNS name is set as well.

Here is the ouput of docker ps :

CONTAINER ID   IMAGE           COMMAND                  CREATED          STATUS          PORTS                                                                NAMES
0f313bf0e070   hdfgroup/hsds   "/bin/bash -c /entry…"   11 seconds ago   Up 9 seconds    5100-5999/tcp, 0.0.0.0:49158->6101/tcp, :::49158->6101/tcp           hsds_dn_1
0b6f50bd55ec   hdfgroup/hsds   "/bin/bash -c /entry…"   11 seconds ago   Up 9 seconds    5100-5999/tcp, 0.0.0.0:49157->6101/tcp, :::49157->6101/tcp           hsds_dn_3
bf05f21c11ae   hdfgroup/hsds   "/bin/bash -c /entry…"   11 seconds ago   Up 9 seconds    5100-5999/tcp, 0.0.0.0:49156->6101/tcp, :::49156->6101/tcp           hsds_dn_2
012f3162bdfb   hdfgroup/hsds   "/bin/bash -c /entry…"   11 seconds ago   Up 9 seconds    5100-5999/tcp, 0.0.0.0:49155->6101/tcp, :::49155->6101/tcp           hsds_dn_4
c8ef38713535   hdfgroup/hsds   "/bin/bash -c /entry…"   12 seconds ago   Up 11 seconds   5100-5999/tcp, 0.0.0.0:49154->6900/tcp, :::49154->6900/tcp           hsds_rangeget_1
f5ed03ee426b   hdfgroup/hsds   "/bin/bash -c /entry…"   12 seconds ago   Up 11 seconds   5100/tcp, 5102-5999/tcp, 0.0.0.0:5101->5101/tcp, :::5101->5101/tcp   hsds_sn_1
7a17f5eb3174   hdfgroup/hsds   "/bin/bash -c /entry…"   13 seconds ago   Up 12 seconds   5101-5999/tcp, 0.0.0.0:49153->5100/tcp, :::49153->5100/tcp           hsds_head_1

I am not sure which service is supposed to take care of the http request ? It is probably a config error on my side, maybe you will spot it right away ?

Thanks !

wiwski commented 1 year ago

Oh, I added port 5101 to inbound port rules and I could connect to http://euphro-stg-hsds.westeurope.cloudapp.azure.com:5101/about. Is it the desired behavior ? I had the impression following the article I should access it via port 80 / 443.

jreadey commented 1 year ago

Hi @wiwski, looks like you figured it out! The SN container is that one that handles client requests, the other containers are handle requests dispatched from the SN container.

You can change the port used by the SN container by setting the SN_PORT environment variable before starting the service. By default, it doesn't use port 80 just to make it less likely that there will be a port conflict.

I've updated the docs here: https://github.com/HDFGroup/hsds/blob/dockerdocs/docs/docker_install_azure.md. Does that seem more clear?

wiwski commented 1 year ago

Makes sense. Yep, doc is clearer and it shows the user tweak the port configuration easily.

Open port 80 to web traffic: az vm open-port --port 80 --resource-group $RESOURCEGROUP --name $VMNAME

I would just have changed this line, to use SN_PORT or set port to 5101. Otherwise it won't work out of the box, isn't it ?

jreadey commented 1 year ago

Good catch! I've updated that line.

jreadey commented 1 year ago

Closing...