» Documentation » SQL Reference

Create Cluster

Syntax

CREATE CLUSTER ENDPOINT ('connection_string') GO;
( partition_def [, ...] ) 

where partition_def syntax

ADD PARTITION GROUP 
(
    ADD ENDPOINT('connect_string'), ...
) 

and connection_string is the ip-number:port-number of a running server instance (eg. '10.0.0.1:999').

Description

The CREATE CLUSTER command will create a cluster, where instances of scimore instances join together and acts as a single database.

A cluster horizontally distributes data among partitions groups. Each partition group can consist of multiple instances. Within a parition group all data is replicated.

Example: Create cluster with a single partition group, containing only one instance - the default localhost:999 instance

create cluster endpoint('localhost:999')
go;
add partition group
(
    add endpoint('localhost:999')
)
go;
commit cluster; 

Example: Create cluster with a two partition groups, each containing two instances:

create cluster endpoint('10.0.0.1:999')
go;
add partition group
(
    add endpoint('10.0.0.1:999'),
    add endpoint('10.0.0.2:999'),
),
add partition group
(
    add endpoint('10.0.0.3:999'),
    add endpoint('10.0.0.4:999'),
)
go;
commit cluster;