force-persist - - X X
filter - X X X
fullconn X - X X
+guid - X X X
hash-balance-factor X - X X
hash-key X - X X
hash-type X - X X
See also : "maxconn", "server"
+guid <string>
+ Specify a case-sensitive global unique ID for this proxy. This must be unique
+ accross all haproxy configuration on every object types. Format is left
+ unspecified to allow the user to select its naming policy. The only
+ restriction is its length which cannot be greater than 127 characters. All
+ alphanumerical values and '.', ':', '-' and '_' characters are valid.
+
+
hash-balance-factor <factor>
Specify the balancing factor for bounded-load consistent hashing
#include <haproxy/compression-t.h>
#include <haproxy/counters-t.h>
#include <haproxy/freq_ctr-t.h>
+#include <haproxy/guid-t.h>
#include <haproxy/obj_type-t.h>
#include <haproxy/queue-t.h>
#include <haproxy/server-t.h>
*/
struct list filter_configs; /* list of the filters that are declared on this proxy */
+ struct guid_node guid; /* GUID global tree node */
+
EXTRA_COUNTERS(extra_counters_fe);
EXTRA_COUNTERS(extra_counters_be);
};
#include <import/ebistree.h>
#include <haproxy/obj_type.h>
+#include <haproxy/proxy.h>
#include <haproxy/tools.h>
/* GUID global tree */
}
switch (obj_type(objt)) {
+ case OBJ_TYPE_PROXY:
+ guid = &__objt_proxy(objt)->guid;
+ break;
+
default:
/* No guid support for this objtype. */
ABORT_NOW();
*/
char *guid_name(const struct guid_node *guid)
{
+ char *msg = NULL;
+ struct proxy *px;
+
switch (obj_type(guid->obj_type)) {
+ case OBJ_TYPE_PROXY:
+ px = __objt_proxy(guid->obj_type);
+ return memprintf(&msg, "%s %s", proxy_cap_str(px->cap), px->id);
+
default:
break;
}
#include <haproxy/fd.h>
#include <haproxy/filters.h>
#include <haproxy/global.h>
+#include <haproxy/guid.h>
#include <haproxy/http_ana.h>
#include <haproxy/http_htx.h>
#include <haproxy/http_ext.h>
free_acl_cond(cond);
}
+ guid_remove(&p->guid);
+
EXTRA_COUNTERS_FREE(p->extra_counters_fe);
EXTRA_COUNTERS_FREE(p->extra_counters_be);
}
#endif
+static int proxy_parse_guid(char **args, int section_type, struct proxy *curpx,
+ const struct proxy *defpx, const char *file, int line,
+ char **err)
+{
+ const char *guid;
+ char *guid_err = NULL;
+
+ if (curpx->cap & PR_CAP_DEF) {
+ ha_alert("parsing [%s:%d] : '%s' not allowed in 'defaults' section.\n", file, line, args[0]);
+ return -1;
+ }
+
+ if (!*args[1]) {
+ memprintf(err, "'%s' : expects an argument", args[0]);
+ return -1;
+ }
+
+ guid = args[1];
+ if (guid_insert(&curpx->obj_type, guid, &guid_err)) {
+ memprintf(err, "'%s': %s", args[0], guid_err);
+ ha_free(&guid_err);
+ return -1;
+ }
+
+ return 0;
+}
+
/* This function inserts proxy <px> into the tree of known proxies (regular
* ones or defaults depending on px->cap & PR_CAP_DEF). The proxy's name is
* used as the storing key so it must already have been initialized.
/* Default to only allow L4 retries */
p->retry_type = PR_RE_CONN_FAILED;
+ guid_init(&p->guid);
+
p->extra_counters_fe = NULL;
p->extra_counters_be = NULL;
{ CFG_LISTEN, "clitcpka-intvl", proxy_parse_tcpka_intvl },
{ CFG_LISTEN, "srvtcpka-intvl", proxy_parse_tcpka_intvl },
#endif
+ { CFG_LISTEN, "guid", proxy_parse_guid },
{ 0, NULL, NULL },
}};