Command Line Interface
An HAProxy Enterprise Command Line Interface is available from the package hapee-2.2r1-cli
and allows you to:
Report information about the current HAProxy Enterprise deployment
Manage HAProxy Enterprise processes
Interact with
hapee-2.2-lb
stats socket to report statistics, current sessions, errorsOpen a shell on running
hapee-2.2-lb
Print help
Install HAProxy Enterprise CLI
-
To install the HAProxy Enterprise CLI package run:
$ # On Debian/Ubuntu $ sudo apt-get install hapee-2.2r1-cli
$ # On CentOS/RedHat/Oracle/Photon OS $ sudo yum install hapee-2.2r1-cli
$ # On SUSE $ sudo zypper install hapee-2.2r1-cli
$ # On FreeBSD $ sudo pkg install hapee-2.2r1-cli
-
Optional: If your default shell is not Bash, you can change your shell to Bash in order to make use of command completion.
The package adds a bash completion script at
/etc/bash_completion.d/hapee-2.2-completion.sh
. This script enables a new command calledhapee
.Run
chsh
to set bash as your default shell, as shown here:$ chsh
Changing the login shell for root Enter the new value, or press ENTER for the default
The
hapee
command becomes available at the next login. To use it immediately after installation, run:$ source /etc/bash_completion.d/hapee-2.2-completion.sh
You can then use the
hapee
command to see options:$ hapee
Usage: /opt/hapee-2.2/bin/hapee-2.2 {start|stop|status|restart|try-restart|reload|force-reload} /opt/hapee-2.2/bin/hapee-2.2 {lb-info|lb-stat|lb-sess|lb-errors|lb-stdio} /opt/hapee-2.2/bin/hapee-2.2 {ctl|version|help}
Retrieve an information report
To get an information report, enter the HAProxy Enterprise version for the CLI reports your want to retrieve:
The HAProxy Enterprise version
Installed HAProxy Enterprise packages
Installed HAProxy Enterprise packages versions
On Debian/Ubuntu
$ hapee version
HAPEE version 2.2r1
ii hapee-2.2r1-base 2.2... all HAPEE BASE : Common dependencies
ii hapee-2.2r1-cli 2.2... amd64 HAPEE CLI : Command line interfac
dpkg-query: no packages found matching hapee-2.2r1-cli-lb
ii hapee-2.2r1-lb 2.2... amd64 HAPEE LB : Layer 7 load-balancing
dpkg-query: no packages found matching hapee-2.2r1-lb-sanitize
dpkg-query: no packages found matching hapee-2.2r1-lb-update
dpkg-query: no packages found matching hapee-2.2r1-log
dpkg-query: no packages found matching hapee-2.2r1-rhi
dpkg-query: no packages found matching hapee-2.2r1-route
dpkg-query: no packages found matching hapee-2.2r1-snmp
dpkg-query: no packages found matching hapee-2.2r1-vrrp
On CentOS/RedHat
$ hapee version
HAPEE version 2.2
hapee-2.2r1-base-2.2....noarch
hapee-2.2r1-cli-2.2....x86_64
package hapee-2.2r1-cli-lb is not installed
hapee-2.2r1-lb-2.2....x86_64
package hapee-2.2r1-lb-sanitize is not installed
package hapee-2.2r1-lb-update is not installed
package hapee-2.2r1-log is not installed
package hapee-2.2r1-rhi is not installed
package hapee-2.2r1-route is not installed
package hapee-2.2r1-snmp is not installed
package hapee-2.2r1-vrrp is not installed
Manage HAProxy Enterprise processes
You can manage HAProxy Enterprise processes with the command: hapee <action> [<service name>]
.
CLI can execute the following actions on any daemon installed by HAProxy Enterprise:
Action | Description |
---|---|
| restart a service only if it was already running |
| reload a service configuration |
| reload service configuration |
| restart a service |
| start a service |
| stop a service |
| like |
If you do not specify a service name, the command executes the action on all HAProxy Enterprise services. It is the shortened version of the service name, such lb
, log
, rhi
, route
, vrrp
, etc.
Start all services:
$ hapee start
Reload hapee-2.2-lb
configuration:
$ hapee reload lb
Check HAProxy Enterprise status
The HAProxy Enterprise CLI can report on the status of each daemon with the command hapee status [<service name>]
If you do not specify the service name, the command reports on all statuses of all daemons.
Display the status of HAProxy:
$ hapee status lb
$ hapee status lb
hapee-2.2r1-lb (pid 1136) is running...
Display the status of all HAProxy Enterprise services:
$ hapee status
$ hapee status
hapee-2.2r1-vrrp (pid 1120) is running...
hapee-2.2r1-lb (pid 1136) is running...
rsyslogd (pid 1145) is running...
hapee-2.2r1-rhi is not installed
hapee-2.2r1-route is not installed
hapee-2.2r1-route6 is not installed
hapee-2.2r1-snmp is not installed
Get Help
You can also use the HAProxy Enterprise CLI to get help about installed components, such as:
Daemon options
Configuration
Use cases
To use this command: enter hapee help <service name>
, then press [TAB] key to get the list of available help.
Read HAProxy Enterprise documentation:
$ hapee help lb config
Read VRRP configuration:
$ hapee help lb config
Next up
Data Plane API