From ecc31f252775f132f106d12597c4c6e9a0e481d4 Mon Sep 17 00:00:00 2001 From: Aylei Date: Tue, 15 Oct 2019 16:43:46 +0800 Subject: [PATCH 1/3] Suspend process for AWS tikv auto-scaling-group --- deploy/aws/variables.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy/aws/variables.tf b/deploy/aws/variables.tf index 48c4ff45da..10c7d11e98 100644 --- a/deploy/aws/variables.tf +++ b/deploy/aws/variables.tf @@ -4,12 +4,12 @@ variable "region" { # US: us-east-1, us-east-2, us-west-2 # Asia Pacific: ap-south-1, ap-northeast-2, ap-southeast-1, ap-southeast-2, ap-northeast-1 # Europe: eu-central-1, eu-west-1, eu-west-2, eu-west-3, eu-north-1 - default = "us-west-2" + default = "ap-northeast-1" } variable "eks_name" { description = "Name of the EKS cluster. Also used as a prefix in names of related resources." - default = "my-cluster" + default = "aylei-cluster" } variable "eks_version" { From 4eb403d76f41624e8e8a063ffecce1d50f42da04 Mon Sep 17 00:00:00 2001 From: Aylei Date: Tue, 15 Oct 2019 16:44:06 +0800 Subject: [PATCH 2/3] Suspend ReplaceUnhealthy process for AWS tikv auto-scaling-group --- deploy/modules/aws/tidb-cluster/local.tf | 1 + deploy/modules/aws/tidb-cluster/workers.tf | 1 + 2 files changed, 2 insertions(+) diff --git a/deploy/modules/aws/tidb-cluster/local.tf b/deploy/modules/aws/tidb-cluster/local.tf index 7a92d2a75f..0b96c67937 100644 --- a/deploy/modules/aws/tidb-cluster/local.tf +++ b/deploy/modules/aws/tidb-cluster/local.tf @@ -74,6 +74,7 @@ locals { asg_max_size = var.tikv_count + 2 pre_userdata = file("${path.module}/pre_userdata") # additional_userdata = file("userdata.sh") + suspended_processes = ["ReplaceUnhealthy"] }, { name = "${var.cluster_name}-tidb" diff --git a/deploy/modules/aws/tidb-cluster/workers.tf b/deploy/modules/aws/tidb-cluster/workers.tf index 1fab065160..4c02e9cdb8 100644 --- a/deploy/modules/aws/tidb-cluster/workers.tf +++ b/deploy/modules/aws/tidb-cluster/workers.tf @@ -29,6 +29,7 @@ resource "aws_autoscaling_group" "workers" { protect_from_scale_in = false count = local.worker_group_count placement_group = "" # The name of the placement group into which to launch the instances, if any. + suspended_processes = lookup(local.tidb_cluster_worker_groups[count.index], "suspended_processes", []) tags = concat( [ From 53ff67e602066ddae122c496086c04eaf9cd451c Mon Sep 17 00:00:00 2001 From: Aylei Date: Tue, 15 Oct 2019 16:52:43 +0800 Subject: [PATCH 3/3] Revert variables.tf Signed-off-by: Aylei --- deploy/aws/variables.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy/aws/variables.tf b/deploy/aws/variables.tf index 10c7d11e98..48c4ff45da 100644 --- a/deploy/aws/variables.tf +++ b/deploy/aws/variables.tf @@ -4,12 +4,12 @@ variable "region" { # US: us-east-1, us-east-2, us-west-2 # Asia Pacific: ap-south-1, ap-northeast-2, ap-southeast-1, ap-southeast-2, ap-northeast-1 # Europe: eu-central-1, eu-west-1, eu-west-2, eu-west-3, eu-north-1 - default = "ap-northeast-1" + default = "us-west-2" } variable "eks_name" { description = "Name of the EKS cluster. Also used as a prefix in names of related resources." - default = "aylei-cluster" + default = "my-cluster" } variable "eks_version" {