Skip to content

Commit

Permalink
perf(trino): enable trino high availability (#17723)
Browse files Browse the repository at this point in the history
  • Loading branch information
hongbo-miao authored Jun 29, 2024
1 parent c86db68 commit 78d6ec5
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,27 @@ module "development_hm_trino_emr" {
source = "../../../../modules/aws/hm_amazon_emr_cluster"
amazon_emr_cluster_name = local.amazon_emr_cluster_name
amazon_emr_version = "emr-7.1.0"
applications = ["Trino"]
primary_instance_target_on_demand_capacity = 1
primary_instance_weighted_capacity = 1
applications = ["HCatalog", "Trino"]
primary_instance_target_on_demand_capacity = 3
primary_instance_type = "c7g.4xlarge"
core_instance_target_on_demand_capacity = 1
core_instance_weighted_capacity = 1
core_instance_type = "r7g.xlarge"
core_instance_target_on_demand_capacity = 4
core_instance_weighted_capacity = 4
core_instance_type = "m7a.4xlarge"
bootstrap_set_up_script_s3_uri = module.development_hm_trino_s3_set_up_script.uri
configurations_json_string = <<EOF
[
{
"Classification": "hive-site",
"Properties": {
"hive.metastore.client.factory.class": "com.amazonaws.glue.catalog.metastore.AWSGlueDataCatalogHiveClientFactory"
}
},
{
"Classification": "trino-connector-hive",
"Properties": {
"hive.metastore": "glue"
}
},
{
"Classification": "trino-config",
"Properties": {
Expand Down Expand Up @@ -107,15 +118,15 @@ module "development_hm_trino_task_instance_fleet" {
providers = { aws = aws.development }
source = "../../../../modules/aws/hm_amazon_emr_cluster_task_instance_fleet"
amazon_emr_cluster_id = module.development_hm_trino_emr.id
task_instance_target_spot_capacity = 38
task_instance_target_spot_capacity = 28
task_instance_configs = [
{
instance_type = "r7g.2xlarge"
weighted_capacity = 2
instance_type = "m7a.4xlarge"
weighted_capacity = 4
},
{
instance_type = "r6g.2xlarge"
weighted_capacity = 2
instance_type = "m6a.4xlarge"
weighted_capacity = 4
}
]
}
Expand Down Expand Up @@ -161,7 +172,6 @@ module "development_hm_sedona_emr" {
amazon_emr_version = "emr-7.1.0"
applications = ["Hadoop", "Hive", "JupyterEnterpriseGateway", "Livy", "Spark"]
primary_instance_target_on_demand_capacity = 1
primary_instance_weighted_capacity = 1
primary_instance_type = "r7g.xlarge"
core_instance_target_on_demand_capacity = 1
core_instance_weighted_capacity = 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,27 @@ module "production_hm_trino_emr" {
source = "../../../../modules/aws/hm_amazon_emr_cluster"
amazon_emr_cluster_name = local.amazon_emr_cluster_name
amazon_emr_version = "emr-7.1.0"
applications = ["Trino"]
primary_instance_target_on_demand_capacity = 1
primary_instance_weighted_capacity = 1
applications = ["HCatalog", "Trino"]
primary_instance_target_on_demand_capacity = 3
primary_instance_type = "c7g.4xlarge"
core_instance_target_on_demand_capacity = 1
core_instance_weighted_capacity = 1
core_instance_type = "r7g.xlarge"
core_instance_target_on_demand_capacity = 4
core_instance_weighted_capacity = 4
core_instance_type = "m7a.4xlarge"
bootstrap_set_up_script_s3_uri = module.production_hm_trino_s3_set_up_script.uri
configurations_json_string = <<EOF
[
{
"Classification": "hive-site",
"Properties": {
"hive.metastore.client.factory.class": "com.amazonaws.glue.catalog.metastore.AWSGlueDataCatalogHiveClientFactory"
}
},
{
"Classification": "trino-connector-hive",
"Properties": {
"hive.metastore": "glue"
}
},
{
"Classification": "trino-config",
"Properties": {
Expand Down Expand Up @@ -107,15 +118,15 @@ module "production_hm_trino_task_instance_fleet" {
providers = { aws = aws.production }
source = "../../../../modules/aws/hm_amazon_emr_cluster_task_instance_fleet"
amazon_emr_cluster_id = module.production_hm_trino_emr.id
task_instance_target_spot_capacity = 38
task_instance_target_spot_capacity = 28
task_instance_configs = [
{
instance_type = "r7g.2xlarge"
weighted_capacity = 2
instance_type = "m7a.4xlarge"
weighted_capacity = 4
},
{
instance_type = "r6g.2xlarge"
weighted_capacity = 2
instance_type = "m6a.4xlarge"
weighted_capacity = 4
}
]
}
Expand Down Expand Up @@ -161,7 +172,6 @@ module "production_hm_sedona_emr" {
amazon_emr_version = "emr-7.1.0"
applications = ["Hadoop", "Hive", "JupyterEnterpriseGateway", "Livy", "Spark"]
primary_instance_target_on_demand_capacity = 1
primary_instance_weighted_capacity = 1
primary_instance_type = "r7g.xlarge"
core_instance_target_on_demand_capacity = 1
core_instance_weighted_capacity = 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ resource "aws_emr_cluster" "hm_amazon_emr_cluster" {
release_label = var.amazon_emr_version
applications = var.applications
termination_protection = false
unhealthy_node_replacement = true
keep_job_flow_alive_when_no_steps = true
log_uri = "s3://hm-production-bucket/amazon-emr/logs/"
ec2_attributes {
Expand All @@ -31,7 +32,7 @@ resource "aws_emr_cluster" "hm_amazon_emr_cluster" {
}
}
instance_type_configs {
weighted_capacity = var.primary_instance_weighted_capacity
weighted_capacity = 1
instance_type = var.primary_instance_type
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ variable "applications" {
variable "primary_instance_target_on_demand_capacity" {
type = number
}
variable "primary_instance_weighted_capacity" {
type = number
}
variable "primary_instance_type" {
type = string
}
Expand Down

0 comments on commit 78d6ec5

Please sign in to comment.