Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NOOB Question: How To Connect to Cluster (Hetzner)? #824

Closed
nelsonic opened this issue Nov 30, 2024 · 4 comments
Closed

NOOB Question: How To Connect to Cluster (Hetzner)? #824

nelsonic opened this issue Nov 30, 2024 · 4 comments
Labels
question Further information is requested

Comments

@nelsonic
Copy link
Contributor

Hi @vitabaks, 👋
We've deployed a Postgres cluster to Hetzner using autobase. 🚀
Following your docs: https://autobase.tech/docs/deployment/hetzner 📖 👌
(good work on the re-brand BTW 😉)

autobase-cluster

But it's unclear how to connect to the cluster ... 🤷‍♂️
It doesn't appear as though there is a single entry point (load balancer). 🤔

These are the servers:
image

And load balancers:

image

But they say "Public network is disabled" when we hover over the IP:
image

So it's unclear how to connect ...

Reading the docs: https://autobase.tech/docs/management/basic-commands#postgresql
image

We can connect to Postgres by ssh-ing into the VM e.g:
image

And run the command (from your docs):

psql -h 127.0.0.1 -p 5432 -U postgres -d postgres -c "select version()"

We get the following output:

image

But obvs we don't want to have to ssh into a VM to connect to the Postgres DB on it ...

If we ssh into the VM that has the autobase console running on it:

image

and then attempt to connect to one of the VM/nodes that was deployed/configured by autobase:

export PGPASSWORD='thepasswordinconfig';
psql -h 10.0.1.1 -p 5432 -U postgres -d postgres

Same for attempting to connect via the loadbalancer internal IP:

export PGPASSWORD='thepasswordinconfig';
psql -h 10.0.1.4 -p 6432 -U postgres -d postgres

Both just hang and time-out:

image

Have tried all combinations of IP address (public/internal) & Port Number and no result.

What am I doing wrong? 🤷‍♂️
Any help much appreciated. Thanks! 🙏

@vitabaks
Copy link
Owner

vitabaks commented Nov 30, 2024

Hi @nelsonic

good work on the re-brand BTW

Thanks!

But it's unclear how to connect to the cluster

Our solution is configured by default for production environment, which is why public access is disabled by default. To connect to the database, your application must be on the same network as the database cluster.

If you require access to the database from the internet, enable public access in the load balancer settings. And configure the Firewall rules accordingly.

@vitabaks vitabaks added the question Further information is requested label Nov 30, 2024
@vitabaks
Copy link
Owner

In a future version, the ability to configure public access will be added in the UI - #756

image

@nelsonic
Copy link
Contributor Author

Yeah, wasn't expecting the cluster to be publicly accessible ...
Just trying to access from within the same private network.

But looking at the hetzner Networks page it appears there are two Networks:
image

One which I had created when deploying the initial VM to run the autobase console:

image

And the other that was created by autobase for the cluster:

image

I detached the original server from the private-network:

image image

And then deleted the no longer needed network:

image

Now there is only one network:
image

Detail:
image

Attached the VM to the postgres-cluster-network-eu-central Network:

image

Now there are 6 resources in the net:
image

And now we can connect!!

psql -h 10.0.1.4 -p 6432 -U postgres -d postgres -c "select version()"
image

@vitabaks
Copy link
Owner

vitabaks commented Nov 30, 2024

Great! I’m glad to hear that you can now connect to the database. Next, just make sure to place the application servers on the same network.

We also plan to add the ability to specify the name of an existing network directly in the UI.

@vitabaks vitabaks changed the title NOOB Question: How To Connect to Cluster? NOOB Question: How To Connect to Cluster (Hetzner)? Nov 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants