tobychui / zoraxy

A general purpose HTTP reverse proxy and forwarding tool. Now written in Go!
https://zoraxy.aroz.org
GNU Affero General Public License v3.0
3.02k stars 184 forks source link

[ENHANCEMENTS] Load Balancing or actif/Backup #100

Closed barto95100 closed 4 months ago

barto95100 commented 9 months ago

For example, I have proxmox cluster and all the node in cluster responde to access the GUI

if i configure zoraxy to send in backend node A and node A not respond (because is down or other) no access of proxmox gui bedhin zoraxy

Maybe possible to add a mechanism to load balancing or priorize to send backend for url (front) proxmox.localdomain.local to node A first and node B in second or in roud-robin node-A/node-B

mechanism to detect node-A and/or node-B is alive with ping or with http-request (the same of uptime)

tobychui commented 9 months ago

@barto95100 I really have no idea what you mean. Can you use the proper ENHANCEMENT template for raising issues? From what I can understand, you are ask for a load balance options for proxmox? Isn't proxmox a VM supervisor? And why the current setup won't work and what have you tried?

Saik0Shinigami commented 9 months ago

In proxmox you can setup a cluster of multiple nodes.

Every node has the ability to host the full web GUI for the entire cluster.

So if you have pve1.domain.com, pve2.domain.com, pve3.domain.com. they're saying that they want zoraxy to be smart enough to serve pve.domain.com and front any of pve1, pve2, or pve3... So for example try pve1... if it fails try pve2.... Or roundrobin trying all of them. pve1 for first request, pve2 for next...

Now it won't work the way they want it to... cause the states don't track well across the nodes, but it's an example.

The fail over option would be nice... if PVE1 is down then automatically serve to pve2.

barto95100 commented 9 months ago

if there is a testing mechanism (like HAproxy could do) to check whether or not the node responds to the ping or to an Http request with the code 200, then zoraxy could send in load-balancing our with a priority chosen by the 'user on this or that node of the cluster, this is an example, this could also be used for example with docker swarm (since all nodes respond to the ports of all containers/services)

tobychui commented 8 months ago

Hi @barto95100 ,

I have tried proxmox with zoraxy a while back and proxmox always return 501 when I try to start stop the VM. How do you get around that? Are there any solutions other than sitting an Nginx proxy in between zoarxy and proxmox?

I cannot implement this feature if this was not solved, so any inputs will be welcomed. Thanks!

barto95100 commented 8 months ago

HI toby,

hacf time i havé this error and i don't know why and many time work perfectly...

problème arrivée for console or button action. is this url user explain the problem maybe you will understand better that me 😔

https://forum.proxmox.com/threads/http-501-when-using-web-reverse-proxy-cloudflare-argo-tunnel-to-start-vm-but-stopping-vm-works.52643/page-2

I check if i trace the problem with tcpdump or other tool

mosaati commented 7 months ago

I believe this is what the request meant to implement.

https://nginx.org/en/docs/http/ngx_http_upstream_module.html

Tacioandrade commented 5 months ago

So if you have pve1.domain.com, pve2.domain.com, pve3.domain.com. they're saying that they want zoraxy to be smart enough to serve pve.domain.com and front any of pve1, pve2, or pve3... So for example try pve1... if it fails try pve2.... Or roundrobin trying all of them. pve1 for first request, pve2 for next...

Just one correction, the round robin would not work, because Proxmox, despite providing the management interface on all hosts, authentication is only valid for the specific node. If you exit pve01 and try to connect to pve02, it will give an error.

In this case, I believe that zoraxy would have to have the roundrobin and failover option to work with tools like Proxmox and zabbix for example, which work in the same way.

tobychui commented 4 months ago

Load balancer with sticky session is added in v3.0.8.