You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 21, 2019. It is now read-only.
`--require_clock_sync`|`false`| Tells YugaByte DB whether to depend on clock synchronization between the nodes in the cluster
32
78
`--num_shards_per_tserver`|`2`| Number of shards (tablets) per tablet server for each table
33
79
34
-
## Creating a cluster
80
+
81
+
## Create a cluster
35
82
36
83
The `create` cluster command is used to create a cluster.
37
84
38
-
The number of nodes created with the initial create command is always equal to the replication factor in order to ensure that all the replicas for a given tablet can be placed on different nodes. Use the [add_node](#adding-nodes) and [remove_node](#stopping-removing-nodes) commands to expand or shrink the cluster.
85
+
The number of nodes created with the initial create command is always equal to the replication factor in order to ensure that all the replicas for a given tablet can be placed on different nodes. Use the [add_node](#add-nodes) and [remove_node](#stop-remove-nodes) commands to expand or shrink the cluster.
39
86
40
87
Each of these initial nodes run a `yb-tserver` process and a `yb-master` process. Note that the number of yb-masters in a cluster has to equal the replication factor for the cluster to be considered operating normally.
41
88
@@ -61,58 +108,108 @@ Add a node to make it a 4 node cluster.
61
108
$ ./bin/yb-ctl add_node
62
109
```
63
110
64
-
65
111
- Creating a 5 node cluster with replication factor 5.
66
112
67
113
```sh
68
114
$ ./bin/yb-ctl --rf 5 create
69
115
```
70
116
117
+
## Default cluster configuration
118
+
119
+
### Data directory
120
+
121
+
Cluster data is installed in`$HOME/yugabyte-data/`.
122
+
123
+
#### Node directories
124
+
125
+
`yugabyte-data/node-#/` directory created for node #.
126
+
127
+
This directory contains the following.
128
+
129
+
```sh
130
+
yugabyte-data/node-#/disk-#/
131
+
initdb.log
132
+
cluster_config.json
133
+
```
134
+
135
+
#### Disk directories
136
+
137
+
`yugabyte-data/node-#/disk-#/` directory created for each disk.
138
+
139
+
This directory contains the following.
140
+
141
+
```sh
142
+
yugabyte-data/node-#/disk-#/pg_data/
143
+
yugabyte-data/node-#/disk-#/yb-data/
144
+
```
145
+
146
+
### Logs
147
+
148
+
yb-master logs are located at
149
+
150
+
```sh
151
+
yugabyte-data/node-#/disk-#/yb-data/master.out
152
+
yugabyte-data/node-#/disk-#/yb-data/master/logs
153
+
```
154
+
155
+
yb-tserver logs are located at
156
+
157
+
```sh
158
+
yugabyte-data/node-#/disk-#/yb-data/tserver.out
159
+
yugabyte-data/node-#/disk-#/yb-data/tserver/logs
160
+
```
161
+
162
+
## Start and stop an existing cluster
163
+
164
+
Create a new cluster, or start an existing cluster if it already exists.
165
+
```sh
166
+
$ ./bin/yb-ctl start
167
+
```
168
+
169
+
Stop a cluster so that you can start it later.
170
+
```sh
171
+
$ ./bin/yb-ctl stop
172
+
```
71
173
72
-
## Checking cluster status
174
+
## Check cluster status
73
175
74
176
You can get the status of the local cluster including the URLs for the admin UIs for the YB-Master and YB-TServer using the `status` command.
75
177
76
178
```sh
77
179
$ ./bin/yb-ctl status
78
180
```
79
181
182
+
## Initialize the YEDIS API
80
183
81
-
## Initializing the YEDIS API
82
-
83
-
The `setup_redis` command to initialize YugaByte's Redis-compatible YEDIS API.
184
+
The `setup_redis`command to initialize YugaByte DB's Redis-compatible YEDIS API.
84
185
85
186
```sh
86
187
$ ./bin/yb-ctl setup_redis
87
188
```
88
189
190
+
## Add and remove nodes
89
191
90
-
## Adding and removing nodes
91
-
92
-
### Adding nodes
192
+
### Add nodes
93
193
94
194
- Adding a new node to the cluster. This will start a new yb-tserver process and give it a new `node_id` for tracking purposes.
95
195
96
196
```sh
97
197
$ ./bin/yb-ctl add_node
98
198
```
99
199
200
+
### Stop/remove nodes
100
201
101
-
### Stopping/removing nodes
102
-
103
-
We can Stop a cluster node by executing the `stop` command. The command takes the node id of the node
104
-
that has to be removed as input. Stop node command expects a node id which denotes the index of the server that
105
-
needs to be stopped. It also takes an optional flag `--master` which denotes that the server is a
202
+
We can stop a node by executing the `stop` command. The command takes the node id of the node
203
+
that has to be removed as input. Stop node command expects a node id which denotes the index of the server that needs to be stopped. It also takes an optional flag `--master` which denotes that the server is a
106
204
master.
107
205
108
206
```sh
109
207
$ ./bin/yb-ctl stop_node 4
110
208
```
111
209
112
-
113
210
At this point of time `remove_node` and `stop_node` do the same thing. So they can be used interchangeably.
114
211
115
-
## Destroying a cluster
212
+
## Destroy a cluster
116
213
117
214
You can use the `destroy` command to destroy a cluster. This command stops all the nodes and
118
215
deletes the data directory of the cluster.
@@ -121,9 +218,11 @@ deletes the data directory of the cluster.
121
218
$ ./bin/yb-ctl destroy
122
219
```
123
220
221
+
222
+
124
223
## Advanced commands
125
224
126
-
### Creating a local cluster across multiple zones, regions and clouds
225
+
### Create a cluster across multiple zones, regions and clouds
127
226
128
227
You can pass the placement information for nodes in a cluster from the command line. The placement information is provided as a set of (cloud, region, zone) tuples separated by commas. Each cloud, region and zone entry is separated by dots.
The `restart` first stops the node and then starts it again(essentially restarting it). At this point of time the node is not decommissioned from the cluster.
186
-
Thus one of the primary advantages of this command is that it can be used to wipe out old flags and pass in new ones. Just like
187
-
create, you can pass the cloud/region/zone and custom flags in the `restart` command.
284
+
The `restart` first stops the node and then starts it again. At this point of time the node is not decommissioned from the cluster. Thus one of the primary advantages of this command is that it can be used to wipe out old flags and pass in new ones. Just like create, you can pass the cloud/region/zone and custom flags in the `restart` command.
We can use the `wipe_restart` command for this. This command stops all the nodes, removes the underlying data directort, then starts back the same
216
-
number of nodes that you had in your previous configuration.
310
+
This command stops all the nodes, removes the underlying data directories, then starts back the same number of nodes that you had in your previous configuration.
217
311
218
-
Just like the `restart` command the custom defined flags and placement information will be lost during `wipe_restart`,
219
-
though you can pass placement information and custom flags in the same way as they are passed in the
220
-
`create` command.
312
+
Just like the `restart` command the custom defined flags and placement information will be lost during `wipe_restart`, though you can pass placement information and custom flags in the same way as they are passed in the `create` command.
0 commit comments