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

WGD HA setup - Queries and Ideas. #372

Open
mzs114 opened this issue Sep 6, 2024 · 5 comments
Open

WGD HA setup - Queries and Ideas. #372

mzs114 opened this issue Sep 6, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@mzs114
Copy link

mzs114 commented Sep 6, 2024

Is your feature request related to a problem? Please describe.
It seems we have have a HA setup with some cloud like AWS, and WGD can support this if the state(DB) sharing is taken care of.

Refer the below setup:
https://www.procustodibus.com/blog/2021/02/ha-wireguard-on-aws/

Describe the solution you'd like

Can WGD support PostgreSQL, so that one can setup AWS Aurora for shared state between multiple WGD VMs?

@mzs114 mzs114 added the enhancement New feature or request label Sep 6, 2024
@DaanSelen
Copy link
Collaborator

You mean support an SQLike database such as Postgres or MySQL/MariaDB?

@donaldzou
Copy link
Owner

Theoretically... it can be done.. since the SQL statement I used works across different flavours of SQL DBs. One thing I would like to know is, if I understand HA WireGuard setup correctly:

  1. It uses multiple servers but assign them by load balancer
  2. You will need identical WG configurations across servers
  3. Deploy WGDashboard on each servers
    • If you use one database across all WGDashboard instances, some records in databse will get override such as:
      • ServerA => Peer1 recorded using 4.4GB total
      • ServerB => Peer1 recorded using 1GB total
      • In this case, you will see different data usage whenever each server update

Correct me if I'm wrong. But using PostgreSQL, MySQL, SQL Server is possible with WGDashboard.

@mzs114
Copy link
Author

mzs114 commented Oct 8, 2024

You mean support an SQLike database such as Postgres or MySQL/MariaDB?

Yes, any other FLOSS RDBMS, that supports external HA setup.

Theoretically... it can be done.. since the SQL statement I used works across different flavours of SQL DBs. One thing I would like to know is, if I understand HA WireGuard setup correctly:

An ORM may help, but not sure how Flask handles this.

1. It uses multiple servers but assign them by load balancer

Yes.

2. You will need identical WG configurations across servers

Correct.

3. Deploy WGDashboard on each servers

Correct, and they all connect to the same DB.

   * If you use **one** database across all WGDashboard instances, some records in databse will get override such as:
     
     * ServerA => Peer1 recorded using 4.4GB total
     * ServerB => Peer1 recorded using 1GB total
     * **In this case, you will see different data usage whenever each server update**

This could be a problem, but I think if we use sticky sessions the connection will be routed to the same backend node, however, this is still not a perfect setup, as the peer can switch after idle timeout to a new backend node behind the load balancer, need to see how other FLOSS products are handling this.

https://cloudar.be/awsblog/why-aws-nlb-stickiness-is-not-always-sticky/

@donaldzou
Copy link
Owner

This could be a problem, but I think if we use sticky sessions the connection will be routed to the same backend node, however, this is still not a perfect setup, as the peer can switch after idle timeout to a new backend node behind the load balancer, need to see how other FLOSS products are handling this.

I see, but I'm thinking if we use sticky session, isn't it kinda defeated the purpose of using NLB lol.. Currently WGDashboard support cross server access on its Desktop app, maybe this would be a better solution?

@mzs114
Copy link
Author

mzs114 commented Oct 9, 2024

I see, but I'm thinking if we use sticky session, isn't it kinda defeated the purpose of using NLB lol.. Currently WGDashboard support cross server access on its Desktop app, maybe this would be a better solution?

Some Wireguard uses UDP, even if the back node is lost, the connection routes through some other node, ideally the user would not notice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants