Bug 1464401 - etcd restore clarifications
Summary: etcd restore clarifications
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Documentation
Version: 3.5.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Kathryn Alexander
QA Contact: Wang Haoran
Vikram Goyal
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-06-23 10:59 UTC by Eduardo Minguez
Modified: 2021-06-10 12:29 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-06-05 12:52:07 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Eduardo Minguez 2017-06-23 10:59:20 UTC
Document URL: https://docs.openshift.com/container-platform/3.5/admin_guide/backup_restore.html#cluster-restore-multiple-member-etcd-clusters

Section Number and Name: admin_guide/backup_restore

Describe the issue: Restore procedure should be explained better and remove the hardcoded values for etcd ips to clarify what they mean or where you can find them.

Like:
--8<--
etcdctl --cert-file=/etc/etcd/peer.crt \
    --key-file=/etc/etcd/peer.key \
    --ca-file=/etc/etcd/ca.crt \
    --peers="https://172.16.4.18:2379,https://172.16.4.27:2379" \
    ls /
-->8--

IPs should be explained...

Or:
--8<--
Update the value of peerURLs using the etcdctl member update command by passing the member ID obtained from the previous step:

# etcdctl --cert-file=/etc/etcd/peer.crt \
    --key-file=/etc/etcd/peer.key \
    --ca-file=/etc/etcd/ca.crt \
    --peers="https://172.18.1.18:2379,https://172.18.9.202:2379,https://172.18.0.75:2379" \
    member update 511b7fb6cc0001 https://172.18.1.18:2380
-->8--

But then you add an IP which is not explained where it came from. Something like telling it is the IP where etcd will listen for cluster peers and how to get it (like "ss -l4n | grep 2380")

Or:
--8<--
For each member, add it to the cluster using the values that can be found in that system’s etcd.conf file:

# etcdctl --cert-file=/etc/etcd/peer.crt \
    --key-file=/etc/etcd/peer.key \
    --ca-file=/etc/etcd/ca.crt \
    --peers="https://172.16.4.18:2379,https://172.16.4.27:2379" \
    member add 10.3.9.222 https://172.16.4.27:2380

Added member named 10.3.9.222 with ID 4e1db163a21d7651 to cluster

ETCD_NAME="10.3.9.222"
ETCD_INITIAL_CLUSTER="10.3.9.221=https://172.16.4.18:2380,10.3.9.222=https://172.16.4.27:2380"
ETCD_INITIAL_CLUSTER_STATE="existing"
-->8--

But if it is an existing cluster, ETCD_NAME can be different in /etc/etcd/etcd.conf so it would be nice to check it first, and explain ETCD_INITIAL_CLUSTER variable can be different in /etc/etcd/etcd.conf of an existing host (it happened to me as I had 3 hosts so I assumed it will work...)

Suggestions for improvement: 

Additional information: 

It would be nice to have an alias for etcdctl as it requires a lot of parameters... something like:

alias oetcdctl='etcdctl --cert-file=/etc/etcd/peer.crt --key-file=/etc/etcd/peer.key --ca-file=/etc/etcd/ca.crt --peers="https://10.0.0.5:2379,https://10.0.0.6:2379,https://10.0.0.7:2379"'

Comment 1 Eduardo Minguez 2017-06-23 11:09:34 UTC
I forgot to mention, that as current instructions are for ETCDv2, maybe it would be nice to add a warning note saying that even if OCP installs etcd version 3, it uses etcd version 2 mechanisms in the backup section, because otherwise it can be confusing if you check the official etcd documentation for etcd version 3.

Comment 5 ge liu 2018-06-04 06:51:09 UTC
LGTM,thx

Comment 6 Kathryn Alexander 2018-06-04 13:05:47 UTC
Thank you! I'm getting a peer review before I merge.

Comment 7 openshift-github-bot 2018-06-04 13:41:07 UTC
Commits pushed to master at https://github.com/openshift/openshift-docs

https://github.com/openshift/openshift-docs/commit/4d6049540195eb03881b941c0d8dd623813996de
bug 1464401 etcd restore clarifications

https://github.com/openshift/openshift-docs/commit/f1d4a9d24d90a3afbb75768d6c293ffb9351cafc
Merge pull request #9600 from kalexand-rh/BZ1464401

bug 1464401 etcd restore clarifications


Note You need to log in before you can comment on or make changes to this bug.