Incorrect hostname with private networking
I've set
mongo-2.railway.internal
(or mongo-2) as the endpoint name for private networking on the UI, however, upon running hostname
returns railway
Service ID: 46c01986-5e99-4fd6-a662-f79de7b4dd67
Deployment ID: 1732be1e-b0c3-443f-a7cc-de8808e6cf434 Replies
Project ID:
46c01986-5e99-4fd6-a662-f79de7b4dd67,1732be1e-b0c3-443f-a7cc-de8808e6cf43
totally normal, you want to read from
RAILWAY_PRIVATE_DOMAIN
mongo relies on hostname to initiate replica setup.
ah okay you didn't say it needed to be
HOSTNAME
just set a variable HOSTNAME=${{RAILWAY_PRIVATE_DOMAIN}}
https://utilities.up.railway.app/env-vars?prefix=HOST