Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Backup and restore of etcd database

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

1. Backup etcd1.1 manual backup data etcdctl backup--data-dir / var/lib/etcd/default.etcd-- backup-dir backup directory 1.2 script backup data

Use the etcdctl command that comes with etcd to back up etc with the following script:

#! / 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} .etcd1.3 Delete the historical backup find / root/*.etcd-date + 7-exec rm-r {}\; find / root/*.gz-ctime + 7-exec rm-r {}\; 2. Restore etcd2.1 stand-alone running etcd-- data-dir=/var/lib/etcd/default.etcd-- force-new-cluster & 2.2 View idetcdctl member list1c4358be138c6d94: name=default peerURLs= https://192.168.61.71:2380 clientURLs= http://localhost:2379 isLeader=true2.3 data synchronization curl http://127.0.0.1:2379/v2/members/1c4358be138c6d94-XPUT\-H "Content-Type:application/json"-d'{"peerURLs": ["http://127" .0.0.1: 2379 "]} '2.4 end running pkill-9 etcd2.5 on a stand-alone restart service systemctl restart etcdsystemctl status etcd

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report