1= couchbase-cli-cluster-init(1)
2ifndef::doctype-manpage[:doctitle: cluster-init]
3
4ifdef::doctype-manpage[]
5== NAME
6
7couchbase-cli-cluster-init -
8endif::[]
9Initializes a Couchbase Server cluster
10
11== SYNOPSIS
12
13[verse]
14_couchbase-cli cluster-init_ [--cluster <url>] [--cluster-username <username>]
15    [--cluster-password <password>] [--cluster-port <port>]
16    [--cluster-ramsize <megabytes>] [--cluster-name <name>]
17    [--cluster-index-ramsize <megabytes>] [--cluster-fts-ramsize <megabytes>]
18    [--cluster-eventing-ramsize <megabytes>]
19    [--index-storage-setting <setting>] [--services <services>]
20
21== DESCRIPTION
22
23Initializes the first node in a Couchbase Server cluster. Before initializing a
24cluster you need to decide which services you will be running on this node as
25well as the memory quota for each service you are starting. Services started
26with cluster-init will be running on this server only. Future servers that are
27added to this cluster may be configured with different services
28running on them. Note that the data service is always required on the first
29node. Memory quotas for each service are global settings and will apply to each
30node added to the cluster. The memory quota for a service only applies if that
31service is running on a given server. You may also define the index storage mode
32which will determine how the global secondary indexes (GSI) are stored.
33
34== OPTIONS
35
36-c::
37--cluster::
38  Specifies the hostname of the cluster to initialize. By default, this
39  parameter is set to localhost:8091 for this command. See the HOST FORMATS
40  section for more information on specifying a hostname.
41
42--cluster-username::
43  When starting a new cluster you need to create the Couchbase Server built-in
44  administrator user for the cluster. This user will be able to access the
45  Couchbase Server Administration Console as well as be used for data access
46  and future configuration. This option specifies the username for the
47  administrator user.
48
49--cluster-password::
50  When starting a new cluster you need to create the Couchbase Server built-in
51  administrator user for the cluster. This user will be able to access the
52  Couchbase Server Administration Console as well as be used for data access
53  and future configuration. This option specifies the password for the
54  administrator user.
55
56--cluster-ramsize::
57  Specifies the data services memory quota (in MB). This quota will be assigned
58  to all future nodes added to the cluster with the data service.
59
60--cluster-fts-ramsize::
61  Sets the full-text service memory quota (in MB). This parameter is required
62  if the full-text service is specified in the --services option. This quota will
63  be assigned to all future nodes added to the cluster with the full-text
64  service.
65
66--cluster-index-ramsize::
67  Sets the index service memory quota (in MB). This parameter is required if
68  the index service is specified in the --services option. This quota will be
69  assigned to all future nodes added to the cluster with the index service.
70
71--cluster-eventing-ramsize::
72  Sets the Eventing service memory quota (in MB). This parameter is required
73  if the Eventing service is specified in the --services option. This quota
74  will be assigned to all future nodes added to the cluster with the eventing
75  service.
76
77--cluster-name::
78  Sets the name for this cluster. Naming clusters is useful when you have
79  multiple Couchbase Server clusters in your deployment.
80
81--cluster-port::
82  Specifies the port for the Couchbase Administration Console. Defaults to
83  port 8091.
84
85--index-storage-setting::
86  Specifies the index storage mode for the index service. Accepted storage
87  modes are "default" for the standard index backend or "memopt" for memory
88  optimized indexes. If the index service is specified to be started with the
89  --services command then this parameter defaults to "default". If the index
90  service is not specified to be started then the index storage mode will not
91  be set. You will then be required to set the index storage mode when the
92  first index service is started on a server in the cluster. You may also
93  define the index storage mode even if an index service is not started on the
94  first node and it will be remembered when the first index service is added
95  in the future. You may not change this parameter while there are index nodes
96  in the cluster.
97
98--services::
99  Specifies the services to start on this cluster. You may not change the
100  services running on this node once the cluster has been initialized. This
101  options takes a comma separated list of services. Accepted services are "data",
102  "index", "query", "fts" and "eventing", specified as a comma-separated list.
103  This parameter defaults to "data".
104
105include::{partialsdir}/cbcli/part-host-formats.adoc[]
106
107== EXAMPLES
108
109To create a Couchbase Server cluster with only the data service on the first node
110and a memory quota of 4096MB run the following command.
111
112  $ couchbase-cli cluster-init -c 127.0.0.1 --cluster-username Administrator \
113   --cluster-password password --services data --cluster-ramsize 4096
114
115To create a Couchbase Server cluster with the data and index service then you
116also need to set the memory quotas for each service as well as the index storage
117mode since you are starting the index service.
118
119To create a cluster with an index memory quota of 1024MB, a data service memory
120quota of 2048MB and a memory optimized index storage mode run the following
121command.
122
123  $ couchbase-cli cluster-init -c 127.0.0.1 --cluster-username Administrator \
124   --cluster-password password --services data,index --cluster-ramsize 2048 \
125   --cluster-index-ramsize 1024 --index-storage-setting memopt
126
127To create a Couchbase Server cluster with all services then you need to set
128the memory quotas for the Data, Index, Full-Text and Eventing service. The
129quotas are set to 2048MB, 1024MB, 1024MB and 1024MB respectively. A quota is
130not set for the query service since it does not have a memory quota. You also
131need to set the index storage mode for the index service, which will be set to
132"default" since the service is started on the first node.
133
134  $ couchbase-cli cluster-init -c 127.0.0.1 --cluster-username Administrator \
135   --cluster-password password --services data,index,query,fts \
136   --cluster-ramsize 2048 --cluster-index-ramsize 1024 \
137   --cluster-eventing-ramsize 1024\ --cluster-fts-ramsize 1024 \
138  --index-storage-setting default
139
140If you want to set the port number you can do so with the --cluster-port
141option. In the example below, a cluster is setup on port 5000 and starts
142only the data service. The memory quota of the data service is set to 2048MB.
143
144  $ couchbase-cli cluster-init -c 127.0.0.1 --cluster-username Administrator \
145   --cluster-password password --services data --cluster-ramsize 2048 \
146   --cluster-port 5000
147
148== DISCUSSION
149
150The cluster-init subcommand sets up the first node on a Couchbase cluster. To
151set per node settings such as the data storage directory, index storage
152directory, or hostname see the man:couchbase-cli-node-init[1] command. To
153add nodes to a currently initialized cluster use the
154man:couchbase-cli-server-add[1] command. Some cluster settings may be
155changed after a cluster is initialized. Use the
156man:couchbase-cli-setting-cluster[1] command to edit these settings.
157
158== ENVIRONMENT AND CONFIGURATION VARIABLES
159
160include::{partialsdir}/cbcli/part-common-env.adoc[]
161
162== SEE ALSO
163
164man:couchbase-cli-cluster-edit[1],
165man:couchbase-cli-node-init[1],
166man:couchbase-cli-server-add[1]
167
168include::{partialsdir}/cbcli/part-footer.adoc[]
169