Parcourir la source

chore: ekka support etcd v3

DDDHuang il y a 4 ans
Parent
commit
9d1f6ccc4b
3 fichiers modifiés avec 13 ajouts et 1 suppressions
  1. 7 0
      etc/emqx.conf
  2. 5 0
      priv/emqx.schema
  3. 1 1
      rebar.config

+ 7 - 0
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/<prefix>/<cluster.name>/<node.name>
 ##

+ 5 - 0
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)}];

+ 1 - 1
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"}}}