summaryrefslogtreecommitdiff
path: root/priv
diff options
context:
space:
mode:
authorMichael Klishin <mklishin@pivotal.io>2016-10-25 17:50:02 +0300
committerMichael Klishin <mklishin@pivotal.io>2016-10-25 17:50:02 +0300
commit672d0c156b036047010feda8ba787bbad4c699e9 (patch)
tree8835f6721c894a1f0ee31d89f8ac83b900a32958 /priv
parent3ad0b674caaa7a898f525933590acfd4f0d99d3c (diff)
downloadrabbitmq-server-git-672d0c156b036047010feda8ba787bbad4c699e9.tar.gz
Initial DNS backend config schema support; decouple autocluster node type key
Since node type won't vary from backend to backend we should pull it up to `autocluster.node_type`.
Diffstat (limited to 'priv')
-rw-r--r--priv/schema/rabbitmq.schema46
1 files changed, 39 insertions, 7 deletions
diff --git a/priv/schema/rabbitmq.schema b/priv/schema/rabbitmq.schema
index 687101dd74..1e2fd6473a 100644
--- a/priv/schema/rabbitmq.schema
+++ b/priv/schema/rabbitmq.schema
@@ -757,6 +757,27 @@ end}.
{mapping, "mirroring_sync_batch_size", "rabbit.mirroring_sync_batch_size",
[{datatype, bytesize}, {validators, ["size_less_than_2G"]}]}.
+%% Own node type used by autoclustering.
+%%
+
+{mapping, "autocluster.node_type", "rabbit.autocluster.node_type", [
+ {datatype, {enum, [disc, disk, ram]}}
+]}.
+
+{translation, "rabbit.autocluster.node_type",
+fun(Conf) ->
+ case cuttlefish:conf_get("autocluster.node_type", Conf) of
+ undefined ->cuttlefish:unset();
+ disc -> disc;
+ %% Always cast to `disc`
+ disk -> disc;
+ ram -> ram;
+ _Other -> disc
+ end
+end}.
+
+%% Classic config-driven autocluster backend.
+%%
%% Make clustering happen *automatically* at startup - only applied
%% to nodes that have just been reset or started for the first time.
%% See http://www.rabbitmq.com/clustering.html#auto-config for
@@ -767,11 +788,6 @@ end}.
{mapping, "autocluster.classic_config.nodes.$node", "rabbit.cluster_nodes",
[{datatype, atom}]}.
-{mapping, "autocluster.classic_config.node_type", "rabbit.cluster_nodes", [
- {datatype, {enum, [disc, disk, ram]}},
- {default, disc}
-]}.
-
{translation, "rabbit.cluster_nodes",
fun(Conf) ->
Nodes = [V || {_, V} <- cuttlefish_variable:filter_by_prefix("autocluster.classic_config.nodes", Conf)],
@@ -779,15 +795,29 @@ fun(Conf) ->
case Nodes of
[] -> cuttlefish:unset();
Other ->
- case cuttlefish:conf_get("autocluster.classic_config.node_type", Conf, disc) of
+ case cuttlefish:conf_get("autocluster.node_type", Conf, disc) of
disc -> {Other, disc};
- % Always cast to `disc`
+ %% Always cast to `disc`
disk -> {Other, disc};
ram -> {Other, ram}
end
end
end}.
+%% DNS (A records and reverse lookups)-based peer discovery.
+%%
+
+{mapping, "autocluster.dns.hostname", "rabbit.peer_discovery_dns.hostname",
+ [{datatype, string}]}.
+
+{translation, "rabbit.peer_discovery_dns.hostname",
+fun(Conf) ->
+ case cuttlefish:conf_get("autocluster.dns.hostname", Conf) of
+ undefined -> cuttlefish:unset();
+ Value -> list_to_binary(Value)
+ end
+end}.
+
%% Interval (in milliseconds) at which we send keepalive messages
%% to other cluster members. Note that this is not the same thing
@@ -799,6 +829,8 @@ end}.
{mapping, "cluster_keepalive_interval", "rabbit.cluster_keepalive_interval",
[{datatype, integer}]}.
+%% Queue master locator
+%%
{mapping, "queue_master_locator", "rabbit.queue_master_locator",
[{datatype, string}]}.