Welcome to the Linux Foundation Forum!

Can't take snapshot from etcd

Hello,

I get the following error when I try to take snapshot from etcd
ETCDCTL_API=3 etcdctl snapshot save ~/etcd.backup --endpoints=https://127.0.0.1:2379 --cacert=/etc/etcd/ca.pem --cert=/etc/etcd/kubernetes.pem --key=/etc/etcd/kubernetes-key.pem
No help topic for 'snapshot'

Comments

  • Hi @AmAb,
    Based on the ETCDCTL major/minor version, some commands may not be available. My guess is that your version does not support the 'snapshot' command.
    Check the etcdctl help menu to see what commands are supported by your version.
    Below are the links to etcdctl documentation:

    https://kubernetes.io/docs/tasks/administer-cluster/configure-upgrade-etcd/

    https://github.com/etcd-io/etcd/tree/master/etcdctl

    https://github.com/etcd-io/etcd/blob/master/etcdctl/READMEv2.md

    Regards,
    -Chris

  • Hi,

    I came across with the same issue, and actually the solution was a bit different, than proposed by chrispokorni.
    It turned out the issue was not with 'unsupported' etc version, rather

    # etcdctl
    NAME:
      etcdctl - A simple command line client for etcd.
    
    WARNING:`
       Environment variable ETCDCTL_API is not set; defaults to etcdctl v2.
       Set environment variable ETCDCTL_API=3 to use v3 API or ETCDCTL_API=2 to use v2 API.
    [...]
    

    ETCDCTL_API set to v2 (or, not set at all, which for my version = default v2)
    Once I executed

    # export ETCDCTL_API=3
    # etcdctl
    

    suddenly snapshot save was available. I hope that will be helpful for people who found this thread with similar issue.

Categories

Upcoming Training