Playbook
Module:
Categories:
There’s a built-in playbook: etcd.yml
for installing etcd cluster. But you have to define it first.
Playbook
To create a new etcd cluster, run the following playbook:
./etcd.yml # install etcd cluster on group 'etcd'
Here are available sub tasks:
etcd_assert
: generate etcd identityetcd_install
: install etcd rpm packagesetcd_clean
: cleanup existing etcdetcd_check
: check etcd instance is runningetcd_purge
: remove running etcd instance & data
etcd_dir
: create etcd data & conf diretcd_config
: generate etcd configetcd_conf
: generate etcd main configetcd_cert
: generate etcd ssl cert
etcd_launch
: launch etcd serviceetcd_register
: register etcd to prometheus
There’s no dedicated uninstall playbook for etcd. If you want to uninstall etcd, you can use etcd_clean
subtask:
./etcd.yml -t etcd_clean
Commands
Some shortcuts and common commands:
./etcd.yml # init etcd cluster
./etcd.yml -t etcd_launch # restart etcd cluster
./etcd.yml -t etcd_clean # remove etcd cluster
./etcd.yml -t etcd_purge # remove etcd cluster with brute force
./etcd.yml -t etcd_conf # refreshing /etc/etcd/etcd.conf
./etcd.yml -l 10.10.10.12 -e etcd_init=existing # add new member to existing etcd cluster
./etcd.yml -l 10.10.10.12 -t etcd_purge # remove member from existing etcd cluster
Safeguard
Pigsty has safeguard mechanism for etcd module to prevent accidental purge.
etcd_clean
:true
by default, which will clean existing etcd instances during initetcd_safeguard
:false
by default, will not prevent purge etcd cluster.
The default setting is useful for development, testing, and emergency rebuild of etcd cluster in production.
If you wish to prevent accidental purge, you can enable safeguard by setting etcd_clean
to false
and etcd_safeguard
to true
.
And you can always override this setting by using -e etcd_clean=true
and -e etcd_safeguard=false
in command line.
If you wish to remove existing cluster:
./etcd.yml -l <cls> -e etcd_clean=true -t etcd_clean
The final brutal way to remove etcd cluster is using the etcd_purge
subtask, which will ignore the safeguard:
./etcd.yml -l <cls> -t etcd_purge
Demo
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.