program directive to specify an external program that should run as a child process under Haproxy Enterprise.
program section in your configuration is a set of directives that define the program to be run, its command-line options and flags, as well as user, group, and restart options.
echo command to print Hello World! when HAProxy Enterprise starts:
program echo command echo "Hello, World!"
A functionally equivalent example that sets the
program echo command echo "Hello, World!" user
When you restart HAProxy Enterprise, you can see that the
echo command executed then exited without error. You can use the Process Manager to execute long-running programs that live alongside HAProxy Enterprise too. Programs will restart and reload when HAProxy Enterprise does, unless you specify
no option start-on-reload.
$ sudo systemctl restart hapee-2.2-lb $ sudo systemctl status hapee-2.2-lb systemd: Starting HAPEE Load Balancer... hapee-lb: [NOTICE] 324/184322 (3330) : New program 'echo' (3351) forked hapee-lb: [NOTICE] 324/184322 (3330) : New worker #1 (3352) forked systemd: Started HAPEE Load Balancer. hapee-lb: Hello, World! hapee-lb: [ALERT] 324/184322 (3330) : Current program 'echo' (3351) exited with code 0 (Exit)
An HAProxy Enterprise
program section is made up of the following directives:
| || |
The command to be run, with flags and options.
| || |
The user to run the command as, if different than HAProxy Enterprise user.
HAProxy Enterprise user, e.g. hapee-lb.
| || |
The group to run the command as, if different than HAProxy Enterprise group.
HAProxy Enterprise group, e.g. hapee
| || |
HAProxy Enterprise stops and recreates child programs at reload. Disable this by setting
Below we demonstrate more examples of using the Process Manager
program section in your configuration.
Data Plane API
Start the Data Plane API with HAProxy Enterprise, but do not restart it when HAProxy Enterprise reloads:
program dataplaneapi command /usr/local/bin/dataplaneapi --host 0.0.0.0 --port 5555 --haproxy-bin /opt/hapee-2.2/sbin/hapee-lb --config-file /etc/hapee-2.2/hapee-lb.cfg --reload-cmd "systemctl reload hapee-2.2" --reload-delay 5 --userlist haproxy-dataplaneapi no option start-on-reload
no option start-on-reload dictates that a new node of the program should not be started upon reload of the master.
Stream Processing Offload Agent
Start Stream Processing Offload Agent programs such as the Traffic Mirror agent:
program mirror command spoa-mirror --runtime 0 --mirror-url
http://test.localuser myusernamegroup mygroupname
You can specify a
group to use when executing the command.
Next upService Discovery