\
SonicBase. In-memory embedded or distributed streaming sql database

Configuration

Location

Config files are located in the "<installDir>/config" directory.

Naming

The config file must be named "config-<cluster name>.yaml".

Example


replicationFactor: 1
dataDirectory: $WORKING_DIR/db-data
installDirectory: $WORKING_DIR
maxJavaHeap: 20%
useUnsafe: true
user: ubuntu
clientIsPrivate: false
defaultPort: 9010
defaultHttpPort: 8080
servers:
- server:
    address: localhost
clients:
- client:
    address: 10.0.0.240

Elements

dataDirectory - path to the location of the database files. Note on Windows you will need to escape the backslashes so the value can be stored in the json file.

On Windows the directory may look like "c:\\\\sonicbase". On linux it may look like "/mnt/sonicbase". On linux and mac you also have the option of prefixing your path with "$HOME" to specify the home directory. This option is not available on Windows.

installDirectory - path to the location of the installation directory. See dataDirectory for detailed instructions

maxJavaHeap - maximum java heap size. Can be absolute (e.g., 50g, 1024m). It can also be a percentage of the machine total memory (e.g., 60%).

useUnsafe - If set to true, SonicBase will use unsafe memory to store data. This allows for reduced memory consumption. However, care must be taken wen selecting the maxJavaHeap.

user - for Linux and Mac this must be set the the userid of the user you will be running the server as. For Windows you do not need to set this value.

clientIsPrivate - set to true if the client machine is in the same private network as the servers. The client must be able to call the servers on the private addresses that are configured.

replicationFactor - the number of replicas you want.

defaultPort - the port that should be used for all servers. If no port is specified then the value 9010 will be used

defaultHttpPort - node to the port that should be used for the http transport for all servers. If no port is specified then the value 8080 will be used.

Servers

List of servers that you want to use in your cluster. Each server can be configured with the following properties.

If you have more than one replica, you must have at least three servers. This doesn't mean you have to have three replicas. You must either have at least three replicas or have at least two shards with two replicas. If you truly only want one shard with two replicas, you will need to run two servers on each box.

address - address of the server. If you specify this address you don't need to specify privateAddress or publicAddress

privateAddress - address private to the cluster. If there is no private address, set this to the public address

publicAddress - address the server can be accessed external to the cluster. You will want to set a public address if you are deploying from your laptop. The first any only the first server needs a public address that can be accessed from your laptop.

port - port for the server to listen on. If you specify defaultPort, you don't need to set this port

httpPort - http port for the server to listen on. If you specify defaultHttpPort, you don't need to set this port


clients

List of clients. These are servers where the benchmark client will run. This is only needed if you are doing benchmarking.

Example - Detailed Config


replicationFactor: 1
dataDirectory: $WORKING_DIR/db-data
installDirectory: $WORKING_DIR
maxJavaHeap: 20%
user: ubuntu
clientIsPrivate: false
servers:
- server:
    publicAddress: localhost
    privateAddress: localhost
    port: 9010
    httpPort: 8080
clients:
- client:
    privateAddress: 10.0.0.240
    port: 8080
    publicAddress: 10.0.0.240