Skip to main content
Version: 3.11

ScalarDB Cluster Standalone Mode

Instead of setting up a Kubernetes cluster and deploying ScalarDB Cluster on top of it by using a Helm Chart, you can run ScalarDB Cluster in standalone mode, which simplifies development and testing processes. A primary use case for this would be when you want to start ScalarDB Cluster in standalone mode via Docker on your local machine and use it for development and testing.

To run ScalarDB Cluster in standalone mode, you need to set the scalar.db.cluster.node.standalone_mode.enabled property to true:

scalar.db.cluster.node.standalone_mode.enabled=true

Usage with Docker

You can start ScalarDB Cluster in standalone mode by running the following command, replacing <YOUR_LOCAL_PROPERTIES_FILE_PATH> with the path to the ScalarDB Cluster properties file and <VERSION> with the version of ScalarDB Cluster that you are using:

$ docker run -v <YOUR_LOCAL_PROPERTIES_FILE_PATH>:/scalardb-cluster/node/scalardb-cluster-node.properties -d -p 60053:60053 -p 8080:8080 ghcr.io/scalar-labs/scalardb-cluster-node:<VERSION>

In this case, you must include the property scalar.db.cluster.node.standalone_mode.enabled and set it to true in the properties file.

You can also start ScalarDB Cluster by using environment variables as follows by setting the variable SCALAR_DB_CLUSTER_NODE_STANDALONE_MODE_ENABLED to true.

$ docker run \
--env SCALAR_DB_CLUSTER_NODE_STANDALONE_MODE_ENABLED=true \
--env SCALAR_DB_STORAGE=cassandra \
--env SCALAR_DB_CONTACT_POINTS=localhost \
--env SCALAR_DB_CONTACT_PORT=9042 \
--env SCALAR_DB_USERNAME=cassandra \
--env SCALAR_DB_PASSWORD=cassandra \
--env SCALAR_DB_GRAPHQL_ENABLED=true \
--env SCALAR_DB_SQL_ENABLED=true \
-d -p 60053:60053 -p 8080:8080 ghcr.io/scalar-labs/scalardb-cluster-node:<VERSION>

The following environment variables are available for the Docker image:

NameCorresponding configuration
SCALAR_DB_CLUSTER_MEMBERSHIP_TYPEscalar.db.cluster.membership.type
SCALAR_DB_CLUSTER_MEMBERSHIP_KUBERNETES_ENDPOINT_NAMESPACE_NAMEscalar.db.cluster.membership.kubernetes.endpoint.namespace_name
SCALAR_DB_CLUSTER_MEMBERSHIP_KUBERNETES_ENDPOINT_NAMEscalar.db.cluster.membership.kubernetes.endpoint.name
SCALAR_DB_CLUSTER_GRPC_DEADLINE_DURATION_MILLISscalar.db.cluster.grpc.deadline_duration_millis
SCALAR_DB_CLUSTER_NODE_STANDALONE_MODE_ENABLEDscalar.db.cluster.node.standalone_mode.enabled
SCALAR_DB_STORAGEscalar.db.storage
SCALAR_DB_CONTACT_POINTSscalar.db.contact_points
SCALAR_DB_CONTACT_PORTscalar.db.contact_port
SCALAR_DB_USERNAMEscalar.db.username
SCALAR_DB_PASSWORDscalar.db.password
SCALAR_DB_CROSS_PARTITION_SCAN_ENABLEDscalar.db.cross_partition_scan.enabled
SCALAR_DB_CROSS_PARTITION_SCAN_FILTERING_ENABLEDscalar.db.cross_partition_scan.filtering.enabled
SCALAR_DB_CROSS_PARTITION_SCAN_ORDERING_ENABLEDscalar.db.cross_partition_scan.ordering.enabled
SCALAR_DB_CONSENSUS_COMMIT_ISOLATION_LEVELscalar.db.consensus_commit.isolation_level
SCALAR_DB_CONSENSUS_COMMIT_SERIALIZABLE_STRATEGYscalar.db.consensus_commit.serializable_strategy
SCALAR_DB_CONSENSUS_COMMIT_PARALLEL_EXECUTOR_COUNTscalar.db.consensus_commit.parallel_executor_count
SCALAR_DB_CONSENSUS_COMMIT_PARALLEL_PREPARATION_ENABLEDscalar.db.consensus_commit.parallel_preparation.enabled
SCALAR_DB_CONSENSUS_COMMIT_PARALLEL_COMMIT_ENABLEDscalar.db.consensus_commit.parallel_commit.enabled
SCALAR_DB_CONSENSUS_COMMIT_ASYNC_COMMIT_ENABLEDscalar.db.consensus_commit.async_commit.enabled
SCALAR_DB_GRAPHQL_ENABLEDscalar.db.graphql.enabled
SCALAR_DB_GRAPHQL_PORTscalar.db.graphql.port
SCALAR_DB_GRAPHQL_PATHscalar.db.graphql.path
SCALAR_DB_GRAPHQL_NAMESPACESscalar.db.graphql.namespaces
SCALAR_DB_GRAPHQL_GRAPHIQLscalar.db.graphql.graphiql
SCALAR_DB_GRAPHQL_SCHEMA_CHECKING_INTERVAL_MILLISscalar.db.graphql.schema_checking_interval_millis
SCALAR_DB_SQL_ENABLEDscalar.db.sql.enabled
SCALAR_DB_SQL_STATEMENT_CACHE_ENABLEDscalar.db.sql.statement_cache.enabled
SCALAR_DB_SQL_STATEMENT_CACHE_SIZEscalar.db.sql.statement_cache.size
SCALAR_DB_CLUSTER_AUTH_ENABLEDscalar.db.cluster.auth.enabled
SCALAR_DB_CLUSTER_AUTH_CACHE_EXPIRATION_TIME_MILLISscalar.db.cluster.auth.cache_expiration_time_millis
SCALAR_DB_CLUSTER_AUTH_AUTH_TOKEN_EXPIRATION_TIME_MINUTESscalar.db.cluster.auth.auth_token_expiration_time_minutes
SCALAR_DB_CLUSTER_AUTH_AUTH_TOKEN_GC_THREAD_INTERVAL_MINUTESscalar.db.cluster.auth.auth_token_gc_thread_interval_minutes

If you want to specify configurations other than the ones mentioned in the table above, set up your custom properties file by using the configurations described in ScalarDB Cluster Configurations.

Usage with Docker Compose

You can start ScalarDB Cluster in standalone mode on Docker Compose by using the docs/standalone-mode/docker-compose.yaml file. This file includes PostgreSQL as the backend database for ScalarDB Cluster.

To start ScalarDB Cluster in standalone mode on Docker Compose, first go to the folder that contains the docker-compose.yaml file by running the following command:

cd docs/standalone-mode/

Then, start Docker Compose by running the following command:

note

To change the configuration of ScalarDB Cluster, update the docs/standalone-mode/scalardb-cluster-node.properties file before running the command below.

docker compose up -d

Client configurations for the ScalarDB Cluster Java API

You can use the indirect client mode to connect to ScalarDB Cluster in standalone mode. For details about client configurations for the ScalarDB Cluster Java API, see Developer Guide for ScalarDB Cluster with the Java API.