This message was deleted.
# rke2
a
This message was deleted.
g
Did you do something like:
Copy code
sudo ETCDCTL_API=3 etcdctl --cert /var/lib/rancher/rke2/server/tls/etcd/server-client.crt --key /var/lib/rancher/rke2/server/tls/etcd/server-client.key --endpoints <https://127.0.0.1:2379> --cacert /var/lib/rancher/rke2/server/tls/etcd/server-ca.crt member list -w table
r
Hi, non, I didn't do these steps but the command etcdctl doesn't seem to exist when I ssh into the Linux machine Am I mising something?
Or should I run that command inside the pod?
g
ah you’ll want to install etcdctl into the machine for that command
c
We don’t generally recommend poking at rke2's etcd cluster, especially if you’re not familiar with how to use etcdctl. rke2 should manage etcd fairly effectively without any action needed by the user. what are you trying to accomplish with etcdctl?
r
I'm getting reports that the etcd is heavily fragmented though my cluster is currently not yet in production
c
that’s fine. leave it alone. There are some monitoring packages that ship with an alert for datastore fragmentation that has an unrealistic threshold. defragmentation is a disruptive operation as it halts all request processing while the files are reorganized on disk. RKE2 defragments the datastore every time it starts, it shouldn’t be necessary to do it manually while it’s running.
fragmentation doesn’t negatively affect performance, it just uses a little extra disk space
m
HI @rapid-house-67417 I recently explored etcdctl and its working for me, Steps below
VERSION="3.5.0"
curl -L <https://github.com/etcd-io/etcd/releases/download/v${VERSION}/etcd-v${VERSION}-linux-amd64.tar.gz> -o etcd-v${VERSION}-linux-amd64.tar.gz
tar xvf etcd-v${VERSION}-linux-amd64.tar.gz
cd etcd-v${VERSION}-linux-amd64
sudo mv etcdctl /usr/local/bin
export ETCDCTL_API=3
export ETCDCTL_CACERT="/var/lib/rancher/rke2/server/tls/etcd/server-ca.crt"
export ETCDCTL_CERT="/var/lib/rancher/rke2/server/tls/etcd/client.crt"
export ETCDCTL_KEY="/var/lib/rancher/rke2/server/tls/etcd/client.key"
export ETCDCTL_ENDPOINTS="<https://10.0.1.7:2379>,<https://10.0.1.4:2379>,<https://10.0.1.6:2379>"
etcdctl endpoint status --write-out=table
r
Hi, Thanks to all, I have now solved my issue. In fact, all seems to be working fine and @creamy-pencil-82913 I fully agree with you that I should not need to interact with etcd. Though, Prometheus is reporting high fragmentation on all my clusters 😞 @gray-lawyer-73831 and @magnificent-dream-65664 thank you for your scripts. I did not run them directly but they gave me insight on the env variables that were missing. Setting the env variables solves my issues, as simple as it gets. 🙏 fast and precise reply is really apreciated.
🧗‍♂️ 1