Created
April 21, 2021 20:40
-
-
Save filewalkwithme/0bc1debbcd88e9b24f17b17bc4eefd49 to your computer and use it in GitHub Desktop.
etcd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TOKEN=token-01 | |
CLUSTER_STATE=new | |
NAME_1=machine-1 | |
NAME_2=machine-2 | |
NAME_3=machine-3 | |
HOST_1=10.240.0.17 | |
HOST_2=10.240.0.18 | |
HOST_3=10.240.0.19 | |
CLUSTER=${NAME_1}=http://${HOST_1}:2380,${NAME_2}=http://${HOST_2}:2380,${NAME_3}=http://${HOST_3}:2380 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For machine 1 | |
THIS_NAME=${NAME_1} | |
THIS_IP=${HOST_1} | |
etcd --data-dir=data.etcd --name ${THIS_NAME} \ | |
--initial-advertise-peer-urls http://${THIS_IP}:2380 --listen-peer-urls http://${THIS_IP}:2380 \ | |
--advertise-client-urls http://${THIS_IP}:2379 --listen-client-urls http://${THIS_IP}:2379 \ | |
--initial-cluster ${CLUSTER} \ | |
--initial-cluster-state ${CLUSTER_STATE} --initial-cluster-token ${TOKEN} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For machine 2 | |
THIS_NAME=${NAME_2} | |
THIS_IP=${HOST_2} | |
etcd --data-dir=data.etcd --name ${THIS_NAME} \ | |
--initial-advertise-peer-urls http://${THIS_IP}:2380 --listen-peer-urls http://${THIS_IP}:2380 \ | |
--advertise-client-urls http://${THIS_IP}:2379 --listen-client-urls http://${THIS_IP}:2379 \ | |
--initial-cluster ${CLUSTER} \ | |
--initial-cluster-state ${CLUSTER_STATE} --initial-cluster-token ${TOKEN} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For machine 3 | |
THIS_NAME=${NAME_3} | |
THIS_IP=${HOST_3} | |
etcd --data-dir=data.etcd --name ${THIS_NAME} \ | |
--initial-advertise-peer-urls http://${THIS_IP}:2380 --listen-peer-urls http://${THIS_IP}:2380 \ | |
--advertise-client-urls http://${THIS_IP}:2379 --listen-client-urls http://${THIS_IP}:2379 \ | |
--initial-cluster ${CLUSTER} \ | |
--initial-cluster-state ${CLUSTER_STATE} --initial-cluster-token ${TOKEN} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment