Configuration

Location

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

Naming

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

Example


    {
        "dataDirectory": "$HOME/db-data",
        "installDirectory": "$HOME/sonicbase",
        "compressRecords": false,
        "useUnsafe": true,
        "maxJavaHeap": "60%",
        "user": "ubuntu",
        "clientIsPrivate": false,
        "shards" : [
            {
                "replicas": [
                    {
                        "privateAddress": "localhost",
                        "publicAddress": "localhost",
                        "port": 9010
                    }
                ]
            },
         ],
        "clients" : [
            {
                "privateAddress": "localhost",
                "publicAddress": "localhost",
                "port": 8080
            }
        ]
    }

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

compressRecords - if true, records will be compressed when stored in memory. This option won't help much unless you have lots of strings that compress well.

useUnsafe - if true, records will be stores in unsafe memory (off java heap). This reduces the amount of memory that is subject to garbase collection. Using this option slows down SonicBase, but it increases the number of records you can load into the database

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%).

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.

shards - list of shards (servers)

replicas - list of replicas. Only one replica can be configured in the free version

   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
   port - port for the server to listen on

clients - list of clients. These are servers where the client will run. You typically only need one client.

   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
   port - port for the server to listen on