A basic setup of a StarRocks cluster using an S3 backend on AWS EC2. You can scale up compute nodes as needed and they will join the front end servers. New front end servers need to join the cluster manually. New instances are automatically added to Grafana and Prometheus, although deleted instances are not removed from Prometheus for a while.
This currently only deploys an internal NLB to a single subnet, uses private DNS, and only allows traffic from within the VPC to encourage security by default. It does not create an authenticated mySQL user, instead only using creating the user root with all privileges and no password.
You can connect to your Star Rocks instance by using the SSM proxy command:
aws ssm start-session --debug --target "$INSTANCE_ID" \
--document-name AWS-StartPortForwardingSession \
--parameters "{\"portNumber\":[\"$PORT\"],\"localPortNumber\":[\"$PORT\"]}"
where the default for PORT is 9030. After that, you can access Star Rocks using a mysql client:
mysql -h 127.0.0.1 -P 9030 -u root
We do a modified canary process for upgrades.
- Ensure the SSM parameter for the leader IP is up to date.
- Change the value for
starrocks_upgrade_versioninvariables.tfvarsfor your environment. Create a PR, get reviews, and merge. - This will add 2 new nodes to the cluster, both upgraded. They will join the cluster and syncronize their data.
- Make sure the new FE nodes join the old cleanly. You can query
SHOW FRONTENDS;on the old FE. - Verify new CNs joined the old FE correctly.
- Verify new FEs have data in their databases.
- Make a new PR with
starrocks_versionmatching the upgraded version, get reviews, and merge. - This will delete the old leader, forcing a leader election. Watch for the new leader and update the SSM parameter accordingly.
- Depending on where in the new instance initialization you updated the SSM parameter, you may need to restart the systemd service on the new instance.
- Go through the database and delete any terminated CNs and FE nodes.
- You may now scale down the FEs to 1 if desired. If you delete FEs, be sure to remove them from the MySQL database first (
ALTER SYSTEM DROP FOLLOWER '{IP}:9010') before terminating the instances.
No requirements.
| Name | Version |
|---|---|
| aws | n/a |
| random | n/a |
No modules.
| Name | Description | Type | Default | Required |
|---|---|---|---|---|
| cn_volume_size_gb | n/a | string |
"950" |
no |
| compute_node_heap_size | n/a | string |
"124000" |
no |
| compute_node_instance_count | n/a | string |
"3" |
no |
| compute_node_instance_type | n/a | string |
"r6id.4xlarge" |
no |
| domain_name | n/a | any |
n/a | yes |
| environment | n/a | any |
n/a | yes |
| frontend_heap_size | n/a | string |
"28000" |
no |
| frontend_instance_count | n/a | string |
"1" |
no |
| frontend_instance_type | n/a | string |
"m6i.2xlarge" |
no |
| frontend_volume_size_gb | n/a | string |
"150" |
no |
| monitoring_instance_type | n/a | string |
"m6i.large" |
no |
| project | n/a | string |
"star-rocks" |
no |
| region | n/a | string |
"us-east-1" |
no |
| root_volume_size_gb | n/a | string |
"30" |
no |
| ssh_key_name | n/a | string |
"devops" |
no |
| star_rocks_version | n/a | string |
"3.3.11" |
no |
| starrocks_bucket | n/a | any |
n/a | yes |
| starrocks_data_path | n/a | string |
"/opt/starrocks/" |
no |
| subnet_id | n/a | any |
n/a | yes |
| vpc_id | n/a | any |
n/a | yes |
| Name | Description |
|---|---|
| fe_dns_name | n/a |
| grafana_address | n/a |