Skip to content

Instantly share code, notes, and snippets.

@sb1975
Created May 8, 2018 06:50
Show Gist options
  • Save sb1975/87c7fbe3387665a5ad76c47d6dc6fe63 to your computer and use it in GitHub Desktop.
Save sb1975/87c7fbe3387665a5ad76c47d6dc6fe63 to your computer and use it in GitHub Desktop.
ETCD Version: 3 issue : Unable to use the ETCD API Version :3 CLI - like I want to use ETCDCTL_API=3 etcdctl --endpoints $ENDPOINT snapshot save snapshotdb
esudbat@master:~$ kubectl version
Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.2", GitCommit:"81753b10df112992bf51bbc2c2f85208aad78335", GitTreeState:"clean", BuildDate:"2018-04-27T09:22:21Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.2", GitCommit:"81753b10df112992bf51bbc2c2f85208aad78335", GitTreeState:"clean", BuildDate:"2018-04-27T09:10:24Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}
esudbat@master:~$
esudbat@master:~$ etcdctl -v
The program 'etcdctl' is currently not installed. To run 'etcdctl' please ask your administrator to install the package 'etcd'
esudbat@master:~$ kubectl exec -it etcd-master -n kube-system -- /bin/sh
/ # etcd -v
2018-05-08 06:33:13.073896 W | pkg/flags: flag "-v" is no longer supported - ignoring.
2018-05-08 06:33:13.074123 I | etcdmain: etcd Version: 3.1.12
2018-05-08 06:33:13.074134 I | etcdmain: Git SHA: 918698add
2018-05-08 06:33:13.074170 I | etcdmain: Go Version: go1.8.7
2018-05-08 06:33:13.074179 I | etcdmain: Go OS/Arch: linux/amd64
2018-05-08 06:33:13.074187 I | etcdmain: setting maximum number of CPUs to 2, total number of available CPUs is 2
2018-05-08 06:33:13.074206 W | etcdmain: no data-dir provided, using default data-dir ./default.etcd
2018-05-08 06:33:13.094806 C | etcdmain: listen tcp 127.0.0.1:2380: bind: address already in use
/ # etcdctl -v
etcdctl version: 3.1.12
API version: 2
esudbat@master:~$ kubectl get pods --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system calico-etcd-jkdvl 1/1 Running 0 34m
kube-system calico-kube-controllers-5977fdb8c4-f4lk4 1/1 Running 0 34m
kube-system calico-node-7r5xx 2/2 Running 1 32m
kube-system calico-node-dfnd4 2/2 Running 0 34m
kube-system etcd-master 1/1 Running 0 35m
kube-system kube-apiserver-master 1/1 Running 0 36m
kube-system kube-controller-manager-master 1/1 Running 0 37m
kube-system kube-dns-86f4d74b45-mqlt7 3/3 Running 0 36m
kube-system kube-proxy-742xv 1/1 Running 0 32m
kube-system kube-proxy-9fl64 1/1 Running 0 36m
kube-system kube-scheduler-master 1/1 Running 0 36m
esudbat@master:~$ kubectl get componentstatus
NAME STATUS MESSAGE ERROR
controller-manager Healthy ok
scheduler Healthy ok
etcd-0 Healthy {"health": "true"}
/ # etcdctl --endpoint='http://127.0.0.1:2380/' cluster-health
cluster may be unhealthy: failed to list members
Error: unexpected status code 404
/ # etcdctl cluster-health
cluster may be unhealthy: failed to list members
Error: client: etcd cluster is unavailable or misconfigured; error #0: malformed HTTP response "\x15\x03\x01\x00\x02\x02"
; error #1: dial tcp 127.0.0.1:4001: getsockopt: connection refused
error #0: malformed HTTP response "\x15\x03\x01\x00\x02\x02"
error #1: dial tcp 127.0.0.1:4001: getsockopt: connection refused
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment