Consul add remove node: различия между версиями
Материал из noname.com.ua
Перейти к навигацииПерейти к поискуSirmax (обсуждение | вклад) |
Sirmax (обсуждение | вклад) |
||
Строка 58: | Строка 58: | ||
--subnet=kohl-ecom-nonprod-network01 \ |
--subnet=kohl-ecom-nonprod-network01 \ |
||
--private-network-ip=10.206.249.132 \ |
--private-network-ip=10.206.249.132 \ |
||
+ | --image=consul-v1 \ |
||
+ | --image-project=kohls-ecom-nonprod \ |
||
+ | --no-address |
||
+ | </PRE> |
||
+ | |||
+ | |||
+ | <PRE> |
||
+ | gcloud compute instances \ |
||
+ | create consul-tf-3 \ |
||
+ | --tags=consul-tf \ |
||
+ | --machine-type=n1-standard-1 \ |
||
+ | --zone=us-central1-f \ |
||
+ | --subnet=kohl-ecom-nonprod-network01 \ |
||
+ | --private-network-ip=10.206.249.129 \ |
||
--image=consul-v1 \ |
--image=consul-v1 \ |
||
--image-project=kohls-ecom-nonprod \ |
--image-project=kohls-ecom-nonprod \ |
Версия 19:37, 20 февраля 2017
Consul Remove node and add new again
Current State
# consul members Node Address Status Type Build Protocol DC consul-tf-0 10.206.249.130:8301 alive server 0.7.4 2 dc1 consul-tf-1 10.206.249.131:8301 alive server 0.7.4 2 dc1 consul-tf-2 10.206.249.132:8301 alive server 0.7.4 2 dc1
Remove one node
# consul leave Graceful leave complete
# consul members Error connecting to Consul agent: dial tcp 127.0.0.1:8400: getsockopt: connection refused
# consul members Node Address Status Type Build Protocol DC consul-tf-0 10.206.249.130:8301 alive server 0.7.4 2 dc1 consul-tf-1 10.206.249.131:8301 alive server 0.7.4 2 dc1 consul-tf-2 10.206.249.132:8301 left server 0.7.4 2 dc1
Instance group=
gcloud compute instance-groups unmanaged list-instances consul-ig NAME STATUS consul-tf-0 RUNNING consul-tf-1 RUNNING consul-tf-2 RUNNING
gcloud compute instance-groups unmanaged remove-instances consul-ig --instances=consul-tf-2 Updated [https://www.googleapis.com/compute/v1/projects/kohls-ecom-nonprod/zones/us-central1-b/instanceGroups/consul-ig].
gcloud compute instance-groups unmanaged list-instances consul-ig NAME STATUS consul-tf-0 RUNNING consul-tf-1 RUNNING
Create instance
gcloud compute instances \ create consul-tf-2 \ --tags=consul-tf \ --machine-type=n1-standard-1 \ --zone=us-central1-c \ --subnet=kohl-ecom-nonprod-network01 \ --private-network-ip=10.206.249.132 \ --image=consul-v1 \ --image-project=kohls-ecom-nonprod \ --no-address
gcloud compute instances \ create consul-tf-3 \ --tags=consul-tf \ --machine-type=n1-standard-1 \ --zone=us-central1-f \ --subnet=kohl-ecom-nonprod-network01 \ --private-network-ip=10.206.249.129 \ --image=consul-v1 \ --image-project=kohls-ecom-nonprod \ --no-address