Difficulty: Beginner
Estimated Time: 13 minutes

This lab demonstrates, using a hands-on example, how Availability works in Scylla. You’ll try setting the Replication Factor and Consistency Levels in a three-node cluster and you’ll see how they affect read and write operations when all of the nodes in the cluster are up, and also when some of them are unavailable.

This lab is part of Scylla University.

To summarize, you saw what happens when some of the nodes are down in our three node cluster with RF=3, and with different Consistency Levels.

CL=ALL will provide higher consistency, while CL=1 will provide higher availability.

You can read more about the Replication Factor and Consistency Levels here.

In the next lesson you will take a closer look at the Scylla architecture.

Step 1 of 8

#### Create the Cluster

Scylla offers high availability by replicating data across multiple nodes. The Replication Factor (RF) is equivalent to the number of nodes where data (rows and partitions) are replicated. Data is replicated to multiple (RF=N) nodes.

An RF of ONE means there is only one copy of a row in a cluster, and there is no way to recover the data if the node is compromised or goes down. RF=2 means that there are two copies of a row in a cluster. An RF of at least three is used in most systems.

Data is always replicated automatically. Read or write operations can occur to data stored on any of the replicated nodes. The Consistency Level (CL) determines how many replicas in a cluster must acknowledge a read or write operation before it is considered successful.

In this part, you’ll bring up a three-node cluster.

## Create a Three-Node Cluster, CQLSH

First, you'll bring up a three-node Scylla cluster using Docker. Start with one node, called Node_X:

`docker run --name Node_X -d scylladb/scylla:4.3.0 --overprovisioned 1 --smp 1`

Create two more nodes, Node_Y and Node_Z, and add them to the cluster of Node_X.

The command “\$(docker inspect –format='{{ .NetworkSettings.IPAddress }}’ Node_X)” translates to the IP address of Node-X:

`docker run --name Node_Y -d scylladb/scylla:4.3.0 --overprovisioned 1 --smp 1 --seeds="\$(docker inspect --format='{{ .NetworkSettings.IPAddress }}' Node_X)"`

`docker run --name Node_Z -d scylladb/scylla:4.3.0 --overprovisioned 1 --smp 1 --seeds="\$(docker inspect --format='{{ .NetworkSettings.IPAddress }}' Node_X)"`

Wait a minute or so and check the node status:

`docker exec -it Node_X nodetool status`

You’ll see that eventually, all the nodes have UN for status. U means up, and N means normal. If you get a message "nodetool: Unable to connect to Scylla API server: java.net.ConnectException: Connection refused (Connection refused)", it means you have to wait a bit more for the node to be up and responding.

`docker exec -it Node_X cqlsh`