ETCD database backup and restore

Source: Internet
Author: User
Tags etcd

# Backup ETCD data etcdctl backup--DATA-DIR/VAR/LIB/ETCD/DEFAULT.ETCD--backup-dir/root/etcd71 ETCD backup uses ETCD command etcdctl for etc Backup, the script is as follows: #!/bin/bashdate_time= ' date +%y%m%d ' Etcdctl backup--data-dir/var/lib/etcd/ Default.etcd--backup-dir/root/etcd71-${date_time}.etcdtar cvzf etcd71-${date_time}.tar.gz etcd71-${date_time}. Etcd find/root/*.etcd-ctime +7-exec rm-r {} \;find/root/*.gz-ctime +7-exec rm-r {} \; # Package Backup Data tar cvzf etcdback-recover ETCD Data # Standalone run Etcd--data-dir=/var/lib/etcd/default.etcd--force-new-cluster & # View IDETCD CTL member List1c4358be138c6d94:name=default peerurls=https://192.168.61.71:2380 clienturls=http://localhost:2379 Isleader=true # Data Sync Curl Http://127.0.0.1:2379/v2/members/1c4358be138c6d94-XPUT \-h "Content-type:application/json" -d ' {"Peerurls": ["http://127.0.0.1:2379"]} ' # End single machine run pkill-9 ETCD # Restart service systemctl restart Etcdsystemctl status Etcd

ETCD database backup and restore

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.