etcd 基础7

2022-01-20 10:41:01 浏览数 (1)

响应头

代码语言:javascript复制
[root@docker ~]# curl http://127.0.0.1:2379/v2/keys/foo -vv
* About to connect() to 127.0.0.1 port 2379 (#0)
*   Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 2379 (#0)
> GET /v2/keys/foo HTTP/1.1
> User-Agent: curl/7.29.0
> Host: 127.0.0.1:2379
> Accept: */*
> 
< HTTP/1.1 200 OK
< Content-Type: application/json
< X-Etcd-Cluster-Id: 7e27652122e8b2ae
< X-Etcd-Index: 54
< X-Raft-Index: 11440
< X-Raft-Term: 6
< Date: Tue, 02 Feb 2016 02:49:21 GMT
< Content-Length: 90
< 
{"action":"get","node":{"key":"/foo","value":"abc","modifiedIndex":54,"createdIndex":54}}
* Connection #0 to host 127.0.0.1 left intact
[root@docker ~]# 

Item

Comment

X-Etcd-Cluster-Id

集群ID

X-Etcd-Index

当前的etcd index ,用来记录变更,类似于SCN,watch操作就是依此值判断,watch事件会发生在当前值之后

X-Raft-Index

为底层的raft协议标记序列,和 X-Etcd-Index 一样递增

X-Raft-Term

master选举发生的次数,发生一次递增一,如果递增速度太快,说明选举发生的太频繁,有必要进行timeout的调整

0 人点赞