无法在本地卷曲键值以在领事中进行备份
Can't curl key values locally for backup in consul
我正在为 consul 使用单个实例。一切正常,web-ui、ACL 等。但是当我尝试使用 curl
命令在本地访问所有键值时,响应是 404 not found
,即使键值是已经存在并且可以在 web-ui
.
中看到
Config.json
文件
{
"bootstrap": true,
"server": true,
"log_level": "DEBUG",
"enable_syslog": true,
"datacenter": "dc1",
"addresses" : {
"http": "P.P.P.P"
},
"bind_addr": "P.P.P.P",
"node_name": "P.P.P.P",
"data_dir": "/home/ubuntu/consuldata",
"ui_dir": "~/dist",
"acl_datacenter": "dc1",
"acl_master_token": "xxxxxxxxxxxxxxxxxxxxx",
"acl_default_policy": "deny",
"encrypt": "pXoaLOJ816mO+da8y8zrsg=="
}
其中 P.P.P.P
是私有 IP,xxxxxxxxxxxxxxxxxxx
是 master token
。
我已经通过以下命令启动了 consul
consul agent -config-dir ~/server -ui-dir ~/dist -bootstrap true -client=P.P.P.P
在 运行 之后 web-ui
工作正常,我可以创建 ACL
和 key-value
现在我试图通过以下命令获取所有键值对
curl -v http://P.P.P.P:8500/v1/kv/?recurse
输出如下
* Hostname was NOT found in DNS cache
* Trying P.P.P.P...
* Connected to P.P.P.P (P.P.P.P) port 8500 (#0)
> GET /v1/kv/?recurse HTTP/1.1
> User-Agent: curl/7.35.0
> Host: P.P.P.P:8500
> Accept: */*
>
< HTTP/1.1 404 Not Found
< X-Consul-Index: 488
< X-Consul-Knownleader: true
< X-Consul-Lastcontact: 0
< Date: Tue, 10 May 2016 13:08:44 GMT
< Content-Length: 0
< Content-Type: text/plain; charset=utf-8
<
* Connection #0 to host P.P.P.P left intact
其中 P.P.P.P
是 consul 实例的私有 IP。
以下是netstat -tlpn
的输出
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:8600 0.0.0.0:* LISTEN 1339/consul
tcp 0 0 P.P.P.P:8300 0.0.0.0:* LISTEN 1339/consul
tcp 0 0 P.P.P.P:8301 0.0.0.0:* LISTEN 1339/consul
tcp 0 0 P.P.P.P:8302 0.0.0.0:* LISTEN 1339/consul
tcp 0 0 127.0.0.1:8400 0.0.0.0:* LISTEN 1339/consul
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN -
tcp 0 0 P.P.P.P:8500 0.0.0.0:* LISTEN 1339/consul
tcp6 0 0 :::22 :::* LISTEN -
我已经在 consul 正在侦听的每个地址上尝试了 curl
命令,但出现了相同的错误。
我正在为 consul 使用单个实例。一切正常,web-ui、ACL 等。但是当我尝试使用 curl
命令在本地访问所有键值时,响应是 404 not found
,即使键值是已经存在并且可以在 web-ui
.
Config.json
文件
{
"bootstrap": true,
"server": true,
"log_level": "DEBUG",
"enable_syslog": true,
"datacenter": "dc1",
"addresses" : {
"http": "P.P.P.P"
},
"bind_addr": "P.P.P.P",
"node_name": "P.P.P.P",
"data_dir": "/home/ubuntu/consuldata",
"ui_dir": "~/dist",
"acl_datacenter": "dc1",
"acl_master_token": "xxxxxxxxxxxxxxxxxxxxx",
"acl_default_policy": "deny",
"encrypt": "pXoaLOJ816mO+da8y8zrsg=="
}
其中 P.P.P.P
是私有 IP,xxxxxxxxxxxxxxxxxxx
是 master token
。
我已经通过以下命令启动了 consul
consul agent -config-dir ~/server -ui-dir ~/dist -bootstrap true -client=P.P.P.P
在 运行 之后 web-ui
工作正常,我可以创建 ACL
和 key-value
现在我试图通过以下命令获取所有键值对
curl -v http://P.P.P.P:8500/v1/kv/?recurse
输出如下
* Hostname was NOT found in DNS cache
* Trying P.P.P.P...
* Connected to P.P.P.P (P.P.P.P) port 8500 (#0)
> GET /v1/kv/?recurse HTTP/1.1
> User-Agent: curl/7.35.0
> Host: P.P.P.P:8500
> Accept: */*
>
< HTTP/1.1 404 Not Found
< X-Consul-Index: 488
< X-Consul-Knownleader: true
< X-Consul-Lastcontact: 0
< Date: Tue, 10 May 2016 13:08:44 GMT
< Content-Length: 0
< Content-Type: text/plain; charset=utf-8
<
* Connection #0 to host P.P.P.P left intact
其中 P.P.P.P
是 consul 实例的私有 IP。
以下是netstat -tlpn
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:8600 0.0.0.0:* LISTEN 1339/consul
tcp 0 0 P.P.P.P:8300 0.0.0.0:* LISTEN 1339/consul
tcp 0 0 P.P.P.P:8301 0.0.0.0:* LISTEN 1339/consul
tcp 0 0 P.P.P.P:8302 0.0.0.0:* LISTEN 1339/consul
tcp 0 0 127.0.0.1:8400 0.0.0.0:* LISTEN 1339/consul
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN -
tcp 0 0 P.P.P.P:8500 0.0.0.0:* LISTEN 1339/consul
tcp6 0 0 :::22 :::* LISTEN -
我已经在 consul 正在侦听的每个地址上尝试了 curl
命令,但出现了相同的错误。