diff --git a/.travis/apisix_cli_test.sh b/.travis/apisix_cli_test.sh index d5898e796cb6..906fbb51eee4 100755 --- a/.travis/apisix_cli_test.sh +++ b/.travis/apisix_cli_test.sh @@ -115,4 +115,4 @@ fi set -ex -echo "rollback to the default admin config" +echo "passed: rollback to the default admin config" diff --git a/bin/apisix b/bin/apisix index 94848d608421..312813021bc6 100755 --- a/bin/apisix +++ b/bin/apisix @@ -781,6 +781,17 @@ local function init_etcd(show_output) local host_count = #(yaml_conf.etcd.host) + -- check whether the user has enabled etcd v2 protocol + for index, host in ipairs(yaml_conf.etcd.host) do + uri = host .. "/v2/keys" + local cmd = "curl -i -m ".. timeout * 2 .. " -o /dev/null -s -w %{http_code} " .. uri + local res = excute_cmd(cmd) + if res == "404" then + io.stderr:write(string.format("failed: please make sure that you have enabled the v2 protocol of etcd on %s.\n", host)) + return + end + end + local etcd_ok = false for index, host in ipairs(yaml_conf.etcd.host) do