Skip to content

Commit 17559bb

Browse files
Refactor Cassandra baseline testing instructions for clarity and conciseness
1 parent 8402585 commit 17559bb

1 file changed

Lines changed: 34 additions & 28 deletions

File tree

  • content/learning-paths/servers-and-cloud-computing/cassandra-on-gcp
Lines changed: 34 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
---
2-
title: Apache Cassandra baseline testing on Google Axion C4A Arm Virtual machine
2+
title: Test Cassandra baseline functionality
33
weight: 5
44

55
### FIXED, DO NOT MODIFY
66
layout: learningpathall
77
---
88

9-
10-
Since Cassandra has been successfully installed on your GCP C4A Arm virtual machine, follow these steps to verify that it is running and functioning properly.
11-
12-
## Baseline Testing for Apache Cassandra
13-
14-
This guide helps verify the installation and perform baseline testing of **Apache Cassandra**.
9+
Now that Cassandra is installed on your GCP C4A Arm virtual machine, verify that it's running and functioning properly.
1510

1611
## Start Cassandra
1712

@@ -21,20 +16,23 @@ Run Cassandra in the background:
2116
cassandra -R
2217
```
2318

24-
The `-R` flag allows Cassandra to run in the background as a daemon, so you can continue using the terminal. The first startup may take **30–60 seconds** as it initializes the necessary files and processes.
19+
The `-R` flag allows Cassandra to run in the background as a daemon. The first startup may take 30–60 seconds as it initializes.
2520

2621
Check logs to ensure Cassandra started successfully:
2722

2823
```console
2924
tail -f ~/cassandra/logs/system.log
3025
```
31-
Look for the message **"Startup complete"**, which indicates Cassandra is fully initialized.
3226

33-
### Check Cassandra Status
27+
Look for the message "Startup complete", which indicates Cassandra is fully initialized.
28+
29+
## Check Cassandra status
30+
3431
```console
3532
nodetool status
3633
```
37-
You should see an output similar to:
34+
35+
The output is similar to:
3836

3937
```output
4038
Datacenter: datacenter1
@@ -44,29 +42,34 @@ Status=Up/Down
4442
-- Address Load Tokens Owns (effective) Host ID Rack
4543
UN 127.0.0.1 162.51 KiB 16 100.0% 78774686-39f3-47e7-87c3-3abc4f02a835 rack1
4644
```
47-
The `nodetool status` command displays the health and status of your Cassandra node(s). For a single-node setup, the output should indicate that the node is **Up (U)** and **Normal (N)**. This confirms that your Cassandra instance is running and ready to accept queries.
4845

49-
### Connect with CQLSH (Cassandra Query Shell)
50-
**cqlsh** is the interactive command-line shell for Cassandra. It allows you to run Cassandra Query Language (CQL) commands to interact with your database, create keyspaces and tables, insert data, and perform queries.
46+
For a single-node setup, the output should indicate that the node is Up (U) and Normal (N), confirming that your Cassandra instance is running and ready to accept queries.
47+
48+
### Connect with CQLSH
49+
50+
`cqlsh` is the interactive command-line shell for Cassandra that allows you to run Cassandra Query Language (CQL) commands.
5151

5252
```console
5353
cqlsh
5454
```
55-
You’ll enter the CQL (Cassandra Query Language) shell.
5655

57-
### Create a Keyspace (like a database)
58-
A **keyspace** in Cassandra is similar to a database in SQL systems. Here, we create a simple keyspace `testks` with a **replication factor of 1**, meaning data will only be stored on one node (suitable for a single-node setup).
56+
You'll enter the CQL (Cassandra Query Language) shell.
57+
58+
### Create a keyspace
59+
60+
A keyspace in Cassandra is similar to a database in SQL systems. Create a simple keyspace `testks` with a replication factor of 1 (suitable for a single-node setup):
5961

6062
```sql
6163
CREATE KEYSPACE testks WITH replication = {'class':'SimpleStrategy','replication_factor' : 1};
6264
```
63-
Check if created:
65+
66+
Verify the keyspace was created:
6467

6568
```sql
6669
DESCRIBE KEYSPACES;
6770
```
6871

69-
You should see an output similar to:
72+
The output is similar to:
7073

7174
```output
7275
cqlsh> DESCRIBE KEYSPACES;
@@ -75,8 +78,9 @@ system system_distributed system_traces system_virtual_schema
7578
system_auth system_schema system_views testks
7679
```
7780

78-
### Create a Table
79-
Tables in Cassandra are used to store structured data. This step creates a `users` table with three columns: `id` (unique identifier), `name` (text), and `age` (integer). The `id` column is the primary key.
81+
### Create a table
82+
83+
Create a `users` table with three columns:
8084

8185
```sql
8286
USE testks;
@@ -88,22 +92,24 @@ CREATE TABLE users (
8892
);
8993
```
9094

91-
### Insert Data
92-
We insert two sample rows into the `users` table. The `uuid()` function generates a unique identifier for each row, which ensures that every user entry has a unique primary key.
95+
### Insert data
96+
97+
Insert two sample rows into the `users` table. The `uuid()` function generates a unique identifier for each row:
9398

9499
```sql
95100
INSERT INTO users (id, name, age) VALUES (uuid(), 'Alice', 30);
96101
INSERT INTO users (id, name, age) VALUES (uuid(), 'Bob', 25);
97102
```
98103

99-
### Query Data
100-
This command retrieves all rows from the `users` table. Successful retrieval confirms that data insertion works correctly and that queries return expected results.
104+
### Query data
105+
106+
Retrieve all rows from the `users` table:
101107

102108
```sql
103109
SELECT * FROM users;
104110
```
105111

106-
You should see an output similar to:
112+
The output is similar to:
107113

108114
```output
109115
id | age | name
@@ -114,6 +120,6 @@ You should see an output similar to:
114120
(2 rows)
115121
```
116122

117-
This baseline test verifies that Cassandra 5.0.5 is installed and running correctly on the VM. It confirms the node status, allows connection via `cqlsh`, and ensures basic operations like creating a keyspace, table, inserting, and querying data work as expected.
123+
This baseline test verifies that Cassandra 5.0.5 is installed and running correctly on the VM, confirming node status, CQLSH connectivity, and basic database operations.
118124

119-
Please now press "Ctrl-D" to exit the Cassandra Query Shell.
125+
Press Ctrl-D to exit the Cassandra Query Shell.

0 commit comments

Comments
 (0)