Haproxy programmable config file

Is there any java program or api to modify the contents of the haproxy configuration file? for example, to add / remove multiple configurations dynamically.

+4
source share
2 answers

Launch the thalassa server on the same machine as HAProxy and call its http api from your Java program. It defines the supported POST and DELETE interfaces for registrations , which are dynamically configured backends.

+3
source

Inspired by the answer of allonhadaya, I tried thalassa.

Pearson Eduction, which are the main ones, contributes to creating a full stack around: https://github.com/PearsonEducation

So, in your example, you would probably use your three components

  • Thalassa (service catalog service)
  • Thalassa http client
  • Aqueduct of Thalassa

The service catalog is the central service manager. With the application itself (if this node application has predefined components) or with the Thalassa HTTP client, you register your service (application) in the service directory. In your case, you can use the handy standalone HTTP client with your existing java application.

Thalassa Aquaduct is the bridge to the HA-Proxy. It associates the service catalog with the HA-Proxy configuration. He currently has (only) some REST methods to configure Front-A-Proxy Frontend and Backend as well. But a pretty handy web interface to see how many connections are being processed and balanced right now.

+2
source

Source: https://habr.com/ru/post/1502795/


All Articles