CLI Reference

Find information about the Synnax Database CLI.

Start

The start command starts a node in a Synnax cluster, bootstrapping a new cluster if necessary.

Examples

Starting a single-node cluster

We can use the i and m flags to start a single node in insecure mode with an in-memory data store:

synnax start -l localhost:9090 -im

Joining a node to an existing cluster

We can use the p flag to join a node to an existing cluster. If the node has no existing cluster data, it will attempt to join the cluster by repeatedly contacting each peer in the list until successful:

synnax start -l localhost:9090 -p localhost:9091,localhost:9092

Flags

FlagDefaultDescription
--listen/-llocalhost:9090
A reachable address and port to listen on for incoming client connections and RPCs from other nodes. This is also the address and port that will be advertised to peers in the cluster.
--peers/-p[]
A list of comma separated peer nodes in an existing cluster. If this list is not empty, the node will attempt to join the cluster by connecting to each peer in the list. If the list is empty and no existing cluster data is found, the node will bootstrap a new cluster.
--data/-d/usr/local/synnax/data
The file path to the storage device where Synnax will keep its data.
--verbose/-vfalse
Enables verbose logging for diagnostic purposes.
--insecure/-ifalse
Starts the node without TLS encryption. This is not recommended for production use.
--mem/-mfalse
Starts the node with an in-memory data store. In this mode, all data will kept in memory, will not be stored on disk, and will be lost when the node is restarted. This can be useful for testing and development, but is not recommended for production use.
--config/c~/.synnax.yaml
Path to a JSON, YAML, or TOML configuration file that can be used to set the node's configuration instead of using flags or environment variables. See Configuration Files for more information.
--certs-dir/usr/local/synnax/certs
Path to the directory containing the TLS certificates for the node.
--ca-certca.crt
Path to the CA certificate file relative to the certs-dir.
--node-certnode.crt
Path to the node certificate file relative to the certs-dir.
--node-keynode.key
Path to the node key file relative to the certs-dir.
--usernamesynnax
Username for the database root user.
--passwordseldon
Password for the database root user.
--license-key""
License key to use Synnax outside of demo mode.

Environment Variable Equivalents

The following environment variables can be used in place of the corresponding flags. Command line flags will take precedence over environment variables.

FlagEnvironment Variable
--listen/-lSYNNAX_LISTEN
--peers/-pSYNNAX_PEERS
--data/-dSYNNAX_DATA
--verbose/-vSYNNAX_VERBOSE
--insecure/-iSYNNAX_INSECURE
--mem/-mSYNNAX_MEM
--config/cSYNNAX_CONFIG
--certs-dirSYNNAX_CERTS_DIR
--ca-certSYNNAX_CA_CERT
--node-certSYNNAX_NODE_CERT
--node-keySYNNAX_NODE_KEY
--usernameSYNNAX_USERNAME
--passwordSYNNAX_PASSWORD
--license-keySYNNAX_LICENSE_KEY

Configuration Files

Synnax will also read configuration files in JSON, TOML and YAML formats. The values set in these configuration files take the lowest precedence and will be overridden by any environment variables or command line flags.

By default, Synnax will look for a configuration file at ~/.synnax.yaml. You can specify a different configuration file using the --config flag or the SYNNAX_CONFIG environment variable.

Here are example configuration files in various formats:

JSON

YAML

TOML

{
    "listen": "localhost:9090",
    "peers": ["localhost:9091", "localhost:9092"],
    "data": "/usr/local/synnax/data",
    "verbose": true,
    "insecure": false,
    "mem": false,
    "config": "/usr/local/synnax/config.yaml",
    "certs-dir": "/usr/local/synnax/certs",
    "ca-cert": "ca.crt",
    "node-cert": "node.crt",
    "node-key": "node.key",
    "username": "synnax",
    "password": "seldon",
    "license-key": "000000-00000000-0000000000",
}

Version

The version command prints the installed version of the Synnax database.

Examples

If you run this command:

synnax version

You’ll see output similar to the following:

Synnax version 0.34.0

Flags

This command has no flags.