- insecure-fork-wanted
- insecure-setuid-wanted
- issuers-chain-path
+ - localpeer
- log
- log-tag
- log-send-hostname
"issuers-chain-path" directory. All other certificates with the same issuer
will share the chain in memory.
+localpeer <name>
+ Sets the local instance's peer name. It will be ignored if the "-L"
+ command line argument is specified or if used after "peers" section
+ definitions. In such cases, a warning message will be emitted during
+ the configuration parsing.
+
+ This option will also set the HAPROXY_LOCALPEER environment variable.
+ See also "-L" in the management guide and "peers" section below.
+
log <address> [len <length>] [format <format>] [sample <ranges>:<smp_size>]
<facility> [max level [min level]]
Adds a global syslog server. Several global servers can be defined. They
peer <peername> <ip>:<port> [param*]
Defines a peer inside a peers section.
If <peername> is set to the local peer name (by default hostname, or forced
- using "-L" command line option), haproxy will listen for incoming remote peer
- connection on <ip>:<port>. Otherwise, <ip>:<port> defines where to connect to
- to join the remote peer, and <peername> is used at the protocol level to
- identify and validate the remote peer on the server side.
+ using "-L" command line option or "localpeer" global configuration setting),
+ haproxy will listen for incoming remote peer connection on <ip>:<port>.
+ Otherwise, <ip>:<port> defines where to connect to in order to join the
+ remote peer, and <peername> is used at the protocol level to identify and
+ validate the remote peer on the server side.
During a soft restart, local peer <ip>:<port> is used by the old instance to
connect the new one and initiate a complete replication (teaching process).
It is strongly recommended to have the exact same peers declaration on all
- peers and to only rely on the "-L" command line argument to change the local
- peer name. This makes it easier to maintain coherent configuration files
- across all peers.
+ peers and to only rely on the "-L" command line argument or the "localpeer"
+ global configuration setting to change the local peer name. This makes it
+ easier to maintain coherent configuration files across all peers.
You may want to reference some environment variables in the address
parameter, see section 2.3 about environment variables.
#include <haproxy/compression.h>
#include <haproxy/global.h>
#include <haproxy/log.h>
+#include <haproxy/peers.h>
#include <haproxy/tools.h>
/*
else
global.tune.options |= GTUNE_STRICT_LIMITS;
}
+ else if (!strcmp(args[0], "localpeer")) {
+ if (alertif_too_many_args(1, file, linenum, args, &err_code))
+ goto out;
+
+ if (*(args[1]) == 0) {
+ ha_alert("parsing [%s:%d] : '%s' expects a name as an argument.\n",
+ file, linenum, args[0]);
+ err_code |= ERR_ALERT | ERR_FATAL;
+ goto out;
+ }
+
+ if (global.localpeer_cmdline != 0) {
+ ha_warning("parsing [%s:%d] : '%s' ignored since it is already set by using the '-L' "
+ "command line argument.\n", file, linenum, args[0]);
+ err_code |= ERR_WARN;
+ goto out;
+ }
+
+ if (cfg_peers) {
+ ha_warning("parsing [%s:%d] : '%s' ignored since it is used after 'peers' section.\n",
+ file, linenum, args[0]);
+ err_code |= ERR_WARN;
+ goto out;
+ }
+
+ free(localpeer);
+ if ((localpeer = strdup(args[1])) == NULL) {
+ ha_alert("parsing [%s:%d]: cannot allocate memory for '%s'.\n",
+ file, linenum, args[0]);
+ err_code |= ERR_ALERT | ERR_FATAL;
+ goto out;
+ }
+ setenv("HAPROXY_LOCALPEER", localpeer, 1);
+ }
else {
struct cfg_kw_list *kwl;
int index;