Skip to content

LozanoMatheus/etcd_with_unhealthy_check

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ETCD - Checking and removing old/unhealthy nodes


Index


Description

The intention of this project is to check and remove old and unhealthy nodes on ETCD cluster.

This project is an evaluation for ETCD auto-health cluster.

Dependencies

Note: This feature is just for a "fresh" cluster, not for add/remove/refresh nodes.

How to use

By default, it will start etcd cluster.

Checking the ETCD version or getting etcd command help

docker run --rm -it etcd_with_unhealthy_check --version
docker run --rm -it etcd_with_unhealthy_check --help

Running the ETCD

By default, you can set up three variable. They're MY_CLUSTER_TOKEN, MY_DISCOVERY_TOKEN and MY_IP. The most important to bootstrap the cluster is MY_DISCOVERY_TOKEN, basically it will generate an URL to other nodes can communicate and find each other.

docker run --rm -d -e 'MY_DISCOVERY_TOKEN=https://discovery.etcd.io/<YOUR_DISCOVERY_TOKE>' etcd_with_unhealthy_check

Note: If you don't pass the var MY_DISCOVERY_TOKEN, each node will be a single node/cluster.

Using your own configurations

It's also possible to run the ETCD without the default configurations.

docker run --rm etcd_with_unhealthy_check \
    --listen-peer-urls "http://127.0.0.1:2380" \
    --listen-client-urls "http://127.0.0.1:2379,http://127.0.0.1:2379" \
    --name "node_mxh2e2-my-etcd" \
    --initial-cluster-token node_mxh2e2 \
    --initial-advertise-peer-urls "http://127.0.0.1:2380" \
    --advertise-client-urls "http://127.0.0.1:2379" \
    --discovery "https://discovery.etcd.io/<YOUR_DISCOVERY_TOKE>" \
    --discovery-fallback exit

Note: It will replace all default configurations, it's not possible to mix them. For more configuration, please check the official ETCD documentation.