chore(cluster): add new type for dns auto cluster

Signed-off-by: zhanghongtong <rory-z@outlook.com>
This commit is contained in:
zhanghongtong 2021-10-28 09:19:30 +08:00
parent d305111929
commit f46084438b
2 changed files with 12 additions and 1 deletions

View File

@ -101,6 +101,11 @@ cluster.autoclean = 5m
## Value: String ## Value: String
## cluster.dns.app = emqx ## cluster.dns.app = emqx
## Type of dns record.
##
## Value: Value: a | srv
## cluster.dns.type = a
##-------------------------------------------------------------------- ##--------------------------------------------------------------------
## Cluster using etcd ## Cluster using etcd

View File

@ -96,6 +96,11 @@
{datatype, string} {datatype, string}
]}. ]}.
{mapping, "cluster.dns.type", "ekka.cluster_discovery", [
{datatype, {enum, [a, srv]}},
{default, a}
]}.
%%-------------------------------------------------------------------- %%--------------------------------------------------------------------
%% Cluster using etcd %% Cluster using etcd
@ -171,7 +176,8 @@
{loop, cuttlefish:conf_get("cluster.mcast.loop", Conf, true)}]; {loop, cuttlefish:conf_get("cluster.mcast.loop", Conf, true)}];
(dns) -> (dns) ->
[{name, cuttlefish:conf_get("cluster.dns.name", Conf)}, [{name, cuttlefish:conf_get("cluster.dns.name", Conf)},
{app, cuttlefish:conf_get("cluster.dns.app", Conf)}]; {app, cuttlefish:conf_get("cluster.dns.app", Conf)},
{type, cuttlefish:conf_get("cluster.dns.type", Conf)}];
(etcd) -> (etcd) ->
SslOpts = fun(Conf) -> SslOpts = fun(Conf) ->
Options = cuttlefish_variable:filter_by_prefix("cluster.etcd.ssl", Conf), Options = cuttlefish_variable:filter_by_prefix("cluster.etcd.ssl", Conf),