etcdctl: command not found

10.9k Views Asked by At

Hi I am using etcd version as follows

{"etcdserver":"3.2.7","etcdcluster":"3.2.0"}

I need to get the version history of the key but for me only curl command are working if I do

etcdctl get --prefix --rev=4 foo

I get:

-bash: etcdctl: command not found

I am able to run the etcdctl with v2 but with v3 I am getting this error.

2

There are 2 best solutions below

0
On

You need to install etcd Binaries

]# wget "https://github.com/coreos/etcd/releases/download/v3.3.9/etcd-v3.3.9-linux-amd64.tar.gz"
]# tar -xvf etcd-v3.3.9-linux-amd64.tar.gz
]# sudo mv etcd-v3.3.9-linux-amd64/etcd* /usr/local/bin/
]# export ETCDCTL_API=3

Then you can execute your etcdl command

Eg:

]# /usr/local/bin/etcdctl --endpoints <EnpointIP>:<PORT> --cert=/<location>/<crt>.pem --key=/<location>/<keyFile>.pem --cacert=/<location>/ca.pem member list

How can I locate my cert file?

If ETCD running as a container follow the below step.

1. login to instance where ETCD running.
2. docker ps -a | grep etcd
3. docker inspect <ContainerID> | grep etc
0
On

on ubuntu machine run below to get etcdctl :

-- apt install etcd-client