Local ScyllaDB 4.5 cluster with Docker Compose
Go to file
Reinaldy Rafli 178de8180e
intialize repository
2022-06-24 09:20:41 +07:00
LICENSE intialize repository 2022-06-24 09:20:41 +07:00
README.md intialize repository 2022-06-24 09:20:41 +07:00
cassandra-rackdc.properties intialize repository 2022-06-24 09:20:41 +07:00
docker-compose.yml intialize repository 2022-06-24 09:20:41 +07:00
scylla.yaml intialize repository 2022-06-24 09:20:41 +07:00

README.md

Local ScylladB Cluster with Docker Compose

Sets up a local ScyllaDB v4.5 cluster with 3 nodes.

To add new nodes, just modify the docker-compose.yml file and add another ScyllaDB instance, then point the new instance name to the --seeds command value on other nodes. Then you are good to go.

To run it:

docker compose up -d

There is no authentication being set up. If you want to enable authentication, change scylla.yaml file on line 237 to PasswordAuthenticator and line 249 to CassandraAuthorizer. You should read Cassandra or ScyllaDB documentation about creating a username-password combination.

Obviously don't use it on a production environment.

To connect with Go:

package main

import (
    "time"
    
    "github.com/gocql/gocql"
)

func main() {
    session := gocql.NewSession(gocql.ClusterConfig{
        Hosts:          []string{"localhost:9042", "localhost:9043", "localhost:9044"},
        Timeout:        3 * time.Second,
		ConnectTimeout: 3 * time.Second,
        Consistency:    gocql.Quorum,
    })
    defer session.Close()

    // do things with session
}