From d7711d63d70aae21e66dcae5fba041da840ea04a Mon Sep 17 00:00:00 2001 From: Austin Rutherford Date: Fri, 19 Apr 2024 12:00:36 -0500 Subject: [PATCH 01/28] Update scylladb-cloud.tf updated block->blocks and put the CIDR into a [list] --- scylladb-cloud.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scylladb-cloud.tf b/scylladb-cloud.tf index 1b864df..0929416 100644 --- a/scylladb-cloud.tf +++ b/scylladb-cloud.tf @@ -39,7 +39,7 @@ resource "scylladbcloud_vpc_peering" "scylladbcloud" { cluster_id = scylladbcloud_cluster.scylladbcloud.id datacenter = scylladbcloud_cluster.scylladbcloud.datacenter peer_vpc_id = aws_vpc.custom_vpc.id - peer_cidr_block = var.custom_vpc + peer_cidr_blocks = [var.custom_vpc] peer_region = data.aws_region.current.name peer_account_id = data.aws_caller_identity.current.account_id allow_cql = true From d33dbb358d4dfe5b6fb6d1523b6aefe4dca153ad Mon Sep 17 00:00:00 2001 From: Austin Rutherford Date: Fri, 19 Apr 2024 12:03:09 -0500 Subject: [PATCH 02/28] Update variables.tf --- variables.tf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/variables.tf b/variables.tf index c3ab4af..e6fb3e5 100644 --- a/variables.tf +++ b/variables.tf @@ -36,6 +36,12 @@ variable "aws_creds" { default = "/home/user/.aws/credentials" } +# AWS Profile to Use +variable "aws_profile" { + description = "AWS Profile to Use" + type = string + default = "DeveloperAccessRole" +} ################################################ # From 185a9ef49d68278d7ff6fb64d90ada657aa9d898 Mon Sep 17 00:00:00 2001 From: Austin Rutherford Date: Fri, 19 Apr 2024 12:04:15 -0500 Subject: [PATCH 03/28] Update provider.tf updated with variable vs static value --- provider.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/provider.tf b/provider.tf index ace31bb..d77c124 100644 --- a/provider.tf +++ b/provider.tf @@ -1,5 +1,5 @@ provider "aws" { region = var.scylla_cloud_region shared_credentials_files = ["${var.aws_creds}"] - profile = "DeveloperAccessRole" -} \ No newline at end of file + profile = ["${var.aws_profile}"] +} From bbdf302f6331e8654d15ceea8406441aa5b13383 Mon Sep 17 00:00:00 2001 From: Austin Rutherford Date: Fri, 19 Apr 2024 12:10:50 -0500 Subject: [PATCH 04/28] Update provider.tf removed [ ] - profile is a string, not list --- provider.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provider.tf b/provider.tf index d77c124..feb7022 100644 --- a/provider.tf +++ b/provider.tf @@ -1,5 +1,5 @@ provider "aws" { region = var.scylla_cloud_region shared_credentials_files = ["${var.aws_creds}"] - profile = ["${var.aws_profile}"] + profile = "${var.aws_profile}" } From 1e0f20aa5b7002b87ec7703af66b913da8aea6cf Mon Sep 17 00:00:00 2001 From: Austin Rutherford Date: Fri, 19 Apr 2024 12:28:22 -0500 Subject: [PATCH 05/28] Update scylladb-cloud.tf added dns names as output --- scylladb-cloud.tf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scylladb-cloud.tf b/scylladb-cloud.tf index 0929416..10cb8d3 100644 --- a/scylladb-cloud.tf +++ b/scylladb-cloud.tf @@ -55,6 +55,11 @@ output "scylladbcloud_cluster_ips" { value = scylladbcloud_cluster.scylladbcloud.node_private_ips } +// Output the dns names of the nodes +output "scylladbcloud_dns_names" { + value = scylladbcloud_cluster.scylladbcloud.node_dns_names +} + // Output the CQL password output "scylladbcloud_cql_password" { value = data.scylladbcloud_cql_auth.scylla.password # Get the CQL password for the cluster From 68ffbe0d147506fe19c9248b90ef202a3546ef96 Mon Sep 17 00:00:00 2001 From: Austin Rutherford Date: Fri, 19 Apr 2024 12:40:24 -0500 Subject: [PATCH 06/28] Update scylladb-loaders.tf --- scylladb-loaders.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scylladb-loaders.tf b/scylladb-loaders.tf index 1a200b9..67634be 100644 --- a/scylladb-loaders.tf +++ b/scylladb-loaders.tf @@ -67,7 +67,7 @@ resource "aws_eip" "eip" { count = length(aws_instance.instance.*.id) # Create an Elastic IP for each EC2 instance instance = element(aws_instance.instance.*.id, count.index) # Associate the Elastic IP with the current EC2 instance public_ipv4_pool = "amazon" # Use the Amazon pool for public IPv4 addresses - vpc = true # Create a VPC Elastic IP address + domain = "vpc" # Create a VPC Elastic IP address tags = { # Add tags to the Elastic IP resource "Name" = "${var.custom_name}-EIP-${count.index}" From 3b3b8e1afd430199042e8edd89f444793f7b0b57 Mon Sep 17 00:00:00 2001 From: Austin Rutherford Date: Fri, 19 Apr 2024 12:53:42 -0500 Subject: [PATCH 07/28] Update scylladb-loaders.tf --- scylladb-loaders.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scylladb-loaders.tf b/scylladb-loaders.tf index 67634be..3e041ac 100644 --- a/scylladb-loaders.tf +++ b/scylladb-loaders.tf @@ -67,7 +67,7 @@ resource "aws_eip" "eip" { count = length(aws_instance.instance.*.id) # Create an Elastic IP for each EC2 instance instance = element(aws_instance.instance.*.id, count.index) # Associate the Elastic IP with the current EC2 instance public_ipv4_pool = "amazon" # Use the Amazon pool for public IPv4 addresses - domain = "vpc" # Create a VPC Elastic IP address + domain = "vpc" # Create a VPC Elastic IP address tags = { # Add tags to the Elastic IP resource "Name" = "${var.custom_name}-EIP-${count.index}" From 7cda69614aa12158d2c691af219abe4bd14140cb Mon Sep 17 00:00:00 2001 From: Austin Rutherford Date: Fri, 19 Apr 2024 13:23:32 -0500 Subject: [PATCH 08/28] Update output.tf Move output to output.tf --- output.tf | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/output.tf b/output.tf index 3fd5b22..22277ba 100644 --- a/output.tf +++ b/output.tf @@ -4,4 +4,25 @@ output "PublicIP" { output "CQL_PASS" { value = data.scylladbcloud_cql_auth.scylla.password sensitive = true -} \ No newline at end of file +} + +# Output the VPC peering connection ID +output "scylladbcloud_vpc_peering_connection_id" { + value = scylladbcloud_vpc_peering.scylladbcloud.connection_id +} + +// Output the private IP addresses of the nodes +output "scylladbcloud_cluster_ips" { + value = scylladbcloud_cluster.scylladbcloud.node_private_ips +} + +// Output the dns names of the nodes +output "scylladbcloud_dns_names" { + value = scylladbcloud_cluster.scylladbcloud.node_dns_names +} + +// Output the CQL password +output "scylladbcloud_cql_password" { + value = data.scylladbcloud_cql_auth.scylla.password # Get the CQL password for the cluster + sensitive = true # Mark the output as sensitive so it won't be shown in logs or output +} From bbb2a6374dffee049d7ab64ceca75dd33d0fbb37 Mon Sep 17 00:00:00 2001 From: Austin Rutherford Date: Fri, 19 Apr 2024 13:24:10 -0500 Subject: [PATCH 09/28] Update scylladb-cloud.tf removed Output after moving to output.tf --- scylladb-cloud.tf | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/scylladb-cloud.tf b/scylladb-cloud.tf index 10cb8d3..280b7b6 100644 --- a/scylladb-cloud.tf +++ b/scylladb-cloud.tf @@ -45,23 +45,3 @@ resource "scylladbcloud_vpc_peering" "scylladbcloud" { allow_cql = true } -# Output the VPC peering connection ID -output "scylladbcloud_vpc_peering_connection_id" { - value = scylladbcloud_vpc_peering.scylladbcloud.connection_id -} - -// Output the private IP addresses of the nodes -output "scylladbcloud_cluster_ips" { - value = scylladbcloud_cluster.scylladbcloud.node_private_ips -} - -// Output the dns names of the nodes -output "scylladbcloud_dns_names" { - value = scylladbcloud_cluster.scylladbcloud.node_dns_names -} - -// Output the CQL password -output "scylladbcloud_cql_password" { - value = data.scylladbcloud_cql_auth.scylla.password # Get the CQL password for the cluster - sensitive = true # Mark the output as sensitive so it won't be shown in logs or output -} From 4e0f9059497f6eabb780e4084a8fd7df8e902b0e Mon Sep 17 00:00:00 2001 From: Austin Rutherford Date: Fri, 19 Apr 2024 14:07:45 -0500 Subject: [PATCH 10/28] Update stress-0.yml --- profile/stress-0.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/profile/stress-0.yml b/profile/stress-0.yml index a4c8049..eea7262 100644 --- a/profile/stress-0.yml +++ b/profile/stress-0.yml @@ -3,7 +3,7 @@ keyspace: pet_store_iot # Create the keyspace keyspace_definition: | - CREATE KEYSPACE pet_store_iot WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; + CREATE KEYSPACE pet_store_iot WITH replication = {'class': 'NetworkStrategy', 'replication_factor': 3}; # The name of the table table: sensor_data @@ -21,8 +21,7 @@ table_definition: | AND compaction = { 'class': 'TimeWindowCompactionStrategy', 'compaction_window_size': '1', - 'compaction_window_unit': 'DAYS', - 'max_sstable_age_days': '365', + 'compaction_window_unit': 'DAYS', 'timestamp_resolution': 'MICROSECONDS' }; @@ -63,4 +62,4 @@ queries: fields: samerow add_sensor_data: cql: INSERT INTO sensor_data (device_id, sensor_type, bucket, timestamp, value) VALUES (?, ?, ?, ?, ?); - fields: samerow \ No newline at end of file + fields: samerow From 6c2b04ec862a01512d73e99fe451e471b4580d56 Mon Sep 17 00:00:00 2001 From: Austin Rutherford Date: Fri, 19 Apr 2024 14:08:21 -0500 Subject: [PATCH 11/28] Update stress-1.yml --- profile/stress-1.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/profile/stress-1.yml b/profile/stress-1.yml index a4c8049..829eb9a 100644 --- a/profile/stress-1.yml +++ b/profile/stress-1.yml @@ -3,7 +3,7 @@ keyspace: pet_store_iot # Create the keyspace keyspace_definition: | - CREATE KEYSPACE pet_store_iot WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; + CREATE KEYSPACE pet_store_iot WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 3}; # The name of the table table: sensor_data @@ -22,7 +22,6 @@ table_definition: | 'class': 'TimeWindowCompactionStrategy', 'compaction_window_size': '1', 'compaction_window_unit': 'DAYS', - 'max_sstable_age_days': '365', 'timestamp_resolution': 'MICROSECONDS' }; @@ -63,4 +62,4 @@ queries: fields: samerow add_sensor_data: cql: INSERT INTO sensor_data (device_id, sensor_type, bucket, timestamp, value) VALUES (?, ?, ?, ?, ?); - fields: samerow \ No newline at end of file + fields: samerow From d005a119b784f3989d232626b0e2f7d34325c3fd Mon Sep 17 00:00:00 2001 From: Austin Rutherford Date: Fri, 19 Apr 2024 14:08:41 -0500 Subject: [PATCH 12/28] Update stress-0.yml --- profile/stress-0.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/profile/stress-0.yml b/profile/stress-0.yml index eea7262..dae7f00 100644 --- a/profile/stress-0.yml +++ b/profile/stress-0.yml @@ -3,7 +3,7 @@ keyspace: pet_store_iot # Create the keyspace keyspace_definition: | - CREATE KEYSPACE pet_store_iot WITH replication = {'class': 'NetworkStrategy', 'replication_factor': 3}; + CREATE KEYSPACE pet_store_iot WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 3}; # The name of the table table: sensor_data From fbd92a01a747c9ca7399e561353581797b7a5500 Mon Sep 17 00:00:00 2001 From: Austin Rutherford Date: Fri, 19 Apr 2024 14:09:55 -0500 Subject: [PATCH 13/28] Update stress-2.yml --- profile/stress-2.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/profile/stress-2.yml b/profile/stress-2.yml index a4c8049..5fbc061 100644 --- a/profile/stress-2.yml +++ b/profile/stress-2.yml @@ -3,7 +3,7 @@ keyspace: pet_store_iot # Create the keyspace keyspace_definition: | - CREATE KEYSPACE pet_store_iot WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; + CREATE KEYSPACE pet_store_iot WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 3}; # The name of the table table: sensor_data @@ -21,8 +21,7 @@ table_definition: | AND compaction = { 'class': 'TimeWindowCompactionStrategy', 'compaction_window_size': '1', - 'compaction_window_unit': 'DAYS', - 'max_sstable_age_days': '365', + 'compaction_window_unit': 'DAYS', 'timestamp_resolution': 'MICROSECONDS' }; @@ -63,4 +62,4 @@ queries: fields: samerow add_sensor_data: cql: INSERT INTO sensor_data (device_id, sensor_type, bucket, timestamp, value) VALUES (?, ?, ?, ?, ?); - fields: samerow \ No newline at end of file + fields: samerow From 049b0d3dce172dfff05aaf71381b7352f5649e06 Mon Sep 17 00:00:00 2001 From: Austin Rutherford Date: Fri, 19 Apr 2024 14:12:15 -0500 Subject: [PATCH 14/28] Update output.tf --- output.tf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/output.tf b/output.tf index 22277ba..5746584 100644 --- a/output.tf +++ b/output.tf @@ -21,6 +21,10 @@ output "scylladbcloud_dns_names" { value = scylladbcloud_cluster.scylladbcloud.node_dns_names } +output "scylladbcloud_datacenter" { + value = scylladbcloud_cluster.scylladbcloud.datacenter +} + // Output the CQL password output "scylladbcloud_cql_password" { value = data.scylladbcloud_cql_auth.scylla.password # Get the CQL password for the cluster From 38d0315857a38e63b1314e4cb79f22e5d4f9b7ba Mon Sep 17 00:00:00 2001 From: Austin Rutherford Date: Fri, 19 Apr 2024 14:49:11 -0500 Subject: [PATCH 15/28] Update variables.tf --- variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variables.tf b/variables.tf index e6fb3e5..0ba91c5 100644 --- a/variables.tf +++ b/variables.tf @@ -60,7 +60,7 @@ variable "num_threads" { variable "num_of_ops" { description = "Total number of operations to run" type = string - default = "1000M" + default = "5M" } # Throttling for the Cassandra stress tool From c7c13198659799810a7574482bf9b567e053e41c Mon Sep 17 00:00:00 2001 From: Austin Rutherford Date: Fri, 19 Apr 2024 15:50:50 -0500 Subject: [PATCH 16/28] Update stress-1.yml --- profile/stress-1.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/profile/stress-1.yml b/profile/stress-1.yml index 829eb9a..bef464f 100644 --- a/profile/stress-1.yml +++ b/profile/stress-1.yml @@ -3,7 +3,7 @@ keyspace: pet_store_iot # Create the keyspace keyspace_definition: | - CREATE KEYSPACE pet_store_iot WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 3}; + CREATE KEYSPACE pet_store_iot WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}; # The name of the table table: sensor_data @@ -23,6 +23,7 @@ table_definition: | 'compaction_window_size': '1', 'compaction_window_unit': 'DAYS', 'timestamp_resolution': 'MICROSECONDS' + AND speculative_retry = 'NONE'; }; # Define the columns for the table From 3654dc4912bc9b58ba5ce89022809c11cafe0458 Mon Sep 17 00:00:00 2001 From: Austin Rutherford Date: Fri, 19 Apr 2024 15:51:51 -0500 Subject: [PATCH 17/28] Update stress-0.yml --- profile/stress-0.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/profile/stress-0.yml b/profile/stress-0.yml index dae7f00..10a6e8c 100644 --- a/profile/stress-0.yml +++ b/profile/stress-0.yml @@ -3,7 +3,7 @@ keyspace: pet_store_iot # Create the keyspace keyspace_definition: | - CREATE KEYSPACE pet_store_iot WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 3}; + CREATE KEYSPACE pet_store_iot WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}; # The name of the table table: sensor_data @@ -22,8 +22,9 @@ table_definition: | 'class': 'TimeWindowCompactionStrategy', 'compaction_window_size': '1', 'compaction_window_unit': 'DAYS', - 'timestamp_resolution': 'MICROSECONDS' - }; + 'timestamp_resolution': 'MICROSECONDS' + } + AND speculative_retry = 'NONE';; # Define the columns for the table columnspec: From b40fc695c4b5fbcd9bd28109157afc8d8b4eb7f2 Mon Sep 17 00:00:00 2001 From: Austin Rutherford Date: Fri, 19 Apr 2024 15:52:26 -0500 Subject: [PATCH 18/28] Update stress-1.yml --- profile/stress-1.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/profile/stress-1.yml b/profile/stress-1.yml index bef464f..aa68bd3 100644 --- a/profile/stress-1.yml +++ b/profile/stress-1.yml @@ -23,8 +23,8 @@ table_definition: | 'compaction_window_size': '1', 'compaction_window_unit': 'DAYS', 'timestamp_resolution': 'MICROSECONDS' - AND speculative_retry = 'NONE'; - }; + } + AND speculative_retry = 'NONE';; # Define the columns for the table columnspec: From 622d7565b8a291099f06a52065c0f94a7a86eff0 Mon Sep 17 00:00:00 2001 From: Austin Rutherford Date: Fri, 19 Apr 2024 15:52:58 -0500 Subject: [PATCH 19/28] Update stress-2.yml --- profile/stress-2.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/profile/stress-2.yml b/profile/stress-2.yml index 5fbc061..7ab6e14 100644 --- a/profile/stress-2.yml +++ b/profile/stress-2.yml @@ -3,7 +3,7 @@ keyspace: pet_store_iot # Create the keyspace keyspace_definition: | - CREATE KEYSPACE pet_store_iot WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 3}; + CREATE KEYSPACE pet_store_iot WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}; # The name of the table table: sensor_data @@ -23,7 +23,8 @@ table_definition: | 'compaction_window_size': '1', 'compaction_window_unit': 'DAYS', 'timestamp_resolution': 'MICROSECONDS' - }; + } + AND speculative_retry = 'NONE'; # Define the columns for the table columnspec: From d0d2a551ae693a77767f5f11f637b46216e5c39a Mon Sep 17 00:00:00 2001 From: Austin Rutherford Date: Fri, 19 Apr 2024 15:53:19 -0500 Subject: [PATCH 20/28] Update stress-1.yml --- profile/stress-1.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/profile/stress-1.yml b/profile/stress-1.yml index aa68bd3..10f3bf3 100644 --- a/profile/stress-1.yml +++ b/profile/stress-1.yml @@ -24,7 +24,7 @@ table_definition: | 'compaction_window_unit': 'DAYS', 'timestamp_resolution': 'MICROSECONDS' } - AND speculative_retry = 'NONE';; + AND speculative_retry = 'NONE'; # Define the columns for the table columnspec: From fe2c8431f0ede613ef60e2e02752e9aff499ff7b Mon Sep 17 00:00:00 2001 From: Austin Rutherford Date: Fri, 19 Apr 2024 15:53:53 -0500 Subject: [PATCH 21/28] Update stress-0.yml --- profile/stress-0.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/profile/stress-0.yml b/profile/stress-0.yml index 10a6e8c..46146c3 100644 --- a/profile/stress-0.yml +++ b/profile/stress-0.yml @@ -24,7 +24,7 @@ table_definition: | 'compaction_window_unit': 'DAYS', 'timestamp_resolution': 'MICROSECONDS' } - AND speculative_retry = 'NONE';; + AND speculative_retry = 'NONE'; # Define the columns for the table columnspec: From 3780ce70da6e37799ee0ce0e49be611b685e81aa Mon Sep 17 00:00:00 2001 From: Austin Rutherford Date: Fri, 19 Apr 2024 15:58:29 -0500 Subject: [PATCH 22/28] Update scylladb-loaders.tf --- scylladb-loaders.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scylladb-loaders.tf b/scylladb-loaders.tf index 3e041ac..8689086 100644 --- a/scylladb-loaders.tf +++ b/scylladb-loaders.tf @@ -41,7 +41,7 @@ resource "aws_instance" "instance" { inline = [ "sudo systemctl stop scylla-server |tee scylla.log", "echo '/usr/bin/cassandra-stress user profile=./stress.yml n=${var.num_of_ops} cl=local_quorum no-warmup \"ops(insert=1)\" -rate threads=${var.num_threads} fixed=450000/s -mode native cql3 user=${var.scylla_user} password=${local.scylla_pass} -log file=populating.log -node ${local.scylla_ips}' > start.sh", - "echo '/usr/bin/cassandra-stress user profile=./stress.yml duration=24h no-warmup cl=local_quorum \"ops(insert=4,simple1=2)\" -rate threads=${var.num_threads} fixed=${var.throttle} -mode native cql3 user=${var.scylla_user} password=${local.scylla_pass} -log file=benchmarking.log -node ${local.scylla_ips}' > benchmark.sh", + "echo '/usr/bin/cassandra-stress user profile=./stress.yml duration=24h no-warmup cl=local_quorum \"ops(add_sensor_data=1,get_sensor_data=3)\" -rate threads=${var.num_threads} fixed=${var.throttle} -mode native cql3 user=${var.scylla_user} password=${local.scylla_pass} -log file=benchmarking.log -node ${local.scylla_ips}' > benchmark.sh", "sudo chmod +x start.sh benchmark.sh", "sudo mv /home/scyllaadm/cassandra-stress.service /etc/systemd/system/cassandra-stress.service ", "sudo mv /home/scyllaadm/cassandra-stress-benchmark.service /etc/systemd/system/cassandra-stress-benchmark.service ", "sudo systemctl daemon-reload ", From 2fbf4ec31dbbc5267c0808711c3ec22b10a4a544 Mon Sep 17 00:00:00 2001 From: Austin Rutherford Date: Fri, 19 Apr 2024 18:58:24 -0500 Subject: [PATCH 23/28] Update scylladb-loaders.tf --- scylladb-loaders.tf | 1 + 1 file changed, 1 insertion(+) diff --git a/scylladb-loaders.tf b/scylladb-loaders.tf index 8689086..1df9695 100644 --- a/scylladb-loaders.tf +++ b/scylladb-loaders.tf @@ -43,6 +43,7 @@ resource "aws_instance" "instance" { "echo '/usr/bin/cassandra-stress user profile=./stress.yml n=${var.num_of_ops} cl=local_quorum no-warmup \"ops(insert=1)\" -rate threads=${var.num_threads} fixed=450000/s -mode native cql3 user=${var.scylla_user} password=${local.scylla_pass} -log file=populating.log -node ${local.scylla_ips}' > start.sh", "echo '/usr/bin/cassandra-stress user profile=./stress.yml duration=24h no-warmup cl=local_quorum \"ops(add_sensor_data=1,get_sensor_data=3)\" -rate threads=${var.num_threads} fixed=${var.throttle} -mode native cql3 user=${var.scylla_user} password=${local.scylla_pass} -log file=benchmarking.log -node ${local.scylla_ips}' > benchmark.sh", "sudo chmod +x start.sh benchmark.sh", + "echo '/home/scyllaadm/benchmark.sh' >> /home/scyllaadm/start.sh", "sudo mv /home/scyllaadm/cassandra-stress.service /etc/systemd/system/cassandra-stress.service ", "sudo mv /home/scyllaadm/cassandra-stress-benchmark.service /etc/systemd/system/cassandra-stress-benchmark.service ", "sudo systemctl daemon-reload ", "sudo systemctl start cassandra-stress.service", From 2a0885ac4f448c6d1c822a4b05a05aa66eb41f91 Mon Sep 17 00:00:00 2001 From: Austin Rutherford Date: Fri, 19 Apr 2024 18:59:14 -0500 Subject: [PATCH 24/28] Update cassandra-stress.service --- service/cassandra-stress.service | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/service/cassandra-stress.service b/service/cassandra-stress.service index c4183a9..c316550 100644 --- a/service/cassandra-stress.service +++ b/service/cassandra-stress.service @@ -4,7 +4,7 @@ Description="Start Cassandra-stress to populate ScyllaDB" [Service] User=scyllaadm WorkingDirectory=/home/scyllaadm/ -ExecStart=/usr/bin/bash /home/scyllaadm/start.sh & wait && /usr/bin/bash /home/scyllaadm/benchmark.sh +ExecStart=/usr/bin/bash /home/scyllaadm/start.sh Type=simple [Install] -WantedBy=multi-user.target \ No newline at end of file +WantedBy=multi-user.target From 237877aba41e77d7b5334820734ff5cd8c04f7d6 Mon Sep 17 00:00:00 2001 From: Austin Rutherford Date: Sat, 20 Apr 2024 11:45:12 -0500 Subject: [PATCH 25/28] Update variables.tf replaced IP's with node names to send to loaders --- variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variables.tf b/variables.tf index 0ba91c5..1242001 100644 --- a/variables.tf +++ b/variables.tf @@ -127,6 +127,6 @@ variable "scylla_node_count" { } locals { - scylla_ips = (join(",", [for s in scylladbcloud_cluster.scylladbcloud.node_private_ips : format("%s", s)])) + scylla_ips = (join(",", [for s in scylladbcloud_cluster.scylladbcloud.node_dns_names : format("%s", s)])) scylla_pass = data.scylladbcloud_cql_auth.scylla.password } From 1410433b6bd74aedc5369652952a1db6b729a0a8 Mon Sep 17 00:00:00 2001 From: Austin Rutherford Date: Sat, 20 Apr 2024 11:51:41 -0500 Subject: [PATCH 26/28] Update variables.tf --- variables.tf | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/variables.tf b/variables.tf index 1242001..a779f71 100644 --- a/variables.tf +++ b/variables.tf @@ -77,9 +77,16 @@ variable "instance_type" { default = "i4i.8xlarge" } +# Number of Loader instances to create +variable "loader_node_count" { + description = "Number of Loader instances to create" + type = string + default = "3" +} + # ScyllaDB Cloud instance type variable "scylla_node_type" { - description = "Type of ScyllaDB Cloud instance" + description = "Type of ScyllaDB Cloud instance (3,6,9,12,15,18,21)" type = string default = "i4i.4xlarge" } From 4e6e92ee98a0c255cab91d1e4efba72a803a17c3 Mon Sep 17 00:00:00 2001 From: Austin Rutherford Date: Sat, 20 Apr 2024 11:53:05 -0500 Subject: [PATCH 27/28] Update scylladb-loaders.tf added in var.loader_node_count so # of loaders could be parameter driven --- scylladb-loaders.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scylladb-loaders.tf b/scylladb-loaders.tf index 1df9695..d17f7ee 100644 --- a/scylladb-loaders.tf +++ b/scylladb-loaders.tf @@ -2,7 +2,7 @@ # Create tags to identify the instances and sets timeouts for creating the instances. resource "aws_instance" "instance" { - count = length(aws_subnet.public_subnet.*.id) + count = var.loader_node_count ami = var.ami_id instance_type = var.instance_type subnet_id = element(aws_subnet.public_subnet.*.id, count.index) From b49fe391ac9311719c20581fc8dd887384a08cd6 Mon Sep 17 00:00:00 2001 From: Austin Rutherford Date: Sat, 20 Apr 2024 11:53:55 -0500 Subject: [PATCH 28/28] Create stress-3.yml --- profile/stress-3.yml | 66 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 profile/stress-3.yml diff --git a/profile/stress-3.yml b/profile/stress-3.yml new file mode 100644 index 0000000..7ab6e14 --- /dev/null +++ b/profile/stress-3.yml @@ -0,0 +1,66 @@ +# The name of the keyspace +keyspace: pet_store_iot + +# Create the keyspace +keyspace_definition: | + CREATE KEYSPACE pet_store_iot WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 1}; + +# The name of the table +table: sensor_data + +# The CQL command to create the table +table_definition: | + CREATE TABLE sensor_data ( + device_id text, + sensor_type text, + bucket timestamp, + timestamp timestamp, + value double, + PRIMARY KEY ((device_id, sensor_type, bucket), timestamp) + ) WITH CLUSTERING ORDER BY (timestamp DESC) + AND compaction = { + 'class': 'TimeWindowCompactionStrategy', + 'compaction_window_size': '1', + 'compaction_window_unit': 'DAYS', + 'timestamp_resolution': 'MICROSECONDS' + } + AND speculative_retry = 'NONE'; + +# Define the columns for the table +columnspec: + - name: device_id + size: FIXED(10) + population: uniform(1..10000) + - name: sensor_type + size: FIXED(10) + population: uniform(1..10) + - name: bucket + size: FIXED(10) + # Set the population of the bucket column to a sequence of timestamps from 1619798400 to the current time + population: seq(1640995200..1683013974) + - name: timestamp + size: FIXED(10) + # Set the population of the timestamp column to a sequence of timestamps from 1619798400 to the current time + population: seq(1640995200..1683013974) + - name: value + size: FIXED(10) + # Set the population of the value column to a Gaussian distribution with a mean of 50 and a standard deviation of 10 + population: gaussian(10..50) + +# Define the insertion profile +insert: + partitions: fixed(1) + batchtype: UNLOGGED + select: fixed(1)/1 + +# Define the CQL queries for the stress test +queries: + get_sensor_data: + cql: SELECT * FROM sensor_data WHERE device_id = ? AND sensor_type = ? AND bucket = ? AND timestamp >= ? AND timestamp <= ? LIMIT 100; + fields: samerow + get_latest_sensor_data: + cql: SELECT * FROM sensor_data WHERE device_id = ? AND sensor_type = ? AND bucket = ? LIMIT 1; + fields: samerow + add_sensor_data: + cql: INSERT INTO sensor_data (device_id, sensor_type, bucket, timestamp, value) VALUES (?, ?, ?, ?, ?); + fields: samerow