Skip to content

aldy505/local-scylladb-cluster

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
}

About

Local ScyllaDB 4.5 cluster with Docker Compose

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published