diff --git a/etc/emqx.conf b/etc/emqx.conf index 7b27f100c..65d8ec58b 100644 --- a/etc/emqx.conf +++ b/etc/emqx.conf @@ -109,6 +109,13 @@ cluster.autoclean = 5m ## Value: String ## cluster.etcd.server = "http://127.0.0.1:2379" +## Etcd api version +## +## Value: Enum +## - v2 +## - v3 +## cluster.etcd.version = v3 + ## The prefix helps build nodes path in etcd. Each node in the cluster ## will create a path in etcd: v2/keys/// ## diff --git a/priv/emqx.schema b/priv/emqx.schema index f107798a2..37679cf59 100644 --- a/priv/emqx.schema +++ b/priv/emqx.schema @@ -103,6 +103,10 @@ {datatype, string} ]}. +{mapping, "cluster.etcd.version", "ekka.cluster_discovery", [ + {datatype, {enum, [v2, v3]}} +]}. + {mapping, "cluster.etcd.prefix", "ekka.cluster_discovery", [ {datatype, string} ]}. @@ -180,6 +184,7 @@ end, Options) end, [{server, string:tokens(cuttlefish:conf_get("cluster.etcd.server", Conf), ",")}, + {version, cuttlefish:conf_get("cluster.etcd.version", Conf, v3)}, {prefix, cuttlefish:conf_get("cluster.etcd.prefix", Conf, "emqcl")}, {node_ttl, cuttlefish:conf_get("cluster.etcd.node_ttl", Conf, 60)}, {ssl_options, SslOpts(Conf)}]; diff --git a/rebar.config b/rebar.config index 2059854dd..2ee94ff04 100644 --- a/rebar.config +++ b/rebar.config @@ -41,7 +41,7 @@ , {jiffy, {git, "https://github.com/emqx/jiffy", {tag, "1.0.5"}}} , {cowboy, {git, "https://github.com/emqx/cowboy", {tag, "2.8.2"}}} , {esockd, {git, "https://github.com/emqx/esockd", {tag, "5.8.0"}}} - , {ekka, {git, "https://github.com/emqx/ekka", {tag, "0.8.1"}}} + , {ekka, {git, "https://github.com/emqx/ekka", {tag, "0.9.0"}}} , {gen_rpc, {git, "https://github.com/emqx/gen_rpc", {tag, "2.5.1"}}} , {cuttlefish, {git, "https://github.com/emqx/cuttlefish", {tag, "v4.0.0"}}} , {minirest, {git, "https://github.com/emqx/minirest", {tag, "0.3.5"}}}