Skip to content
This repository was archived by the owner on Jul 21, 2019. It is now read-only.

Commit 7eb323b

Browse files
authored
misc updates to intro, compatibility, yb-ctl and ysql-spring (#96)
1 parent 3c6f63d commit 7eb323b

File tree

9 files changed

+168
-65
lines changed

9 files changed

+168
-65
lines changed

content/latest/admin/yb-ctl.md

Lines changed: 134 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,52 @@ Use the **-\-help** option to see all the commands supported.
2020
```sh
2121
$ ./bin/yb-ctl --help
2222
```
23+
```sh
24+
usage: yb-ctl [-h] [--binary_dir BINARY_DIR] [--data_dir DATA_DIR]
25+
[--replication_factor REPLICATION_FACTOR]
26+
[--num_shards_per_tserver NUM_SHARDS_PER_TSERVER]
27+
[--timeout TIMEOUT] [--verbose] [--install-if-needed]
28+
{create,start,stop,destroy,restart,wipe_restart,add_node,remove_node,start_node,stop_node,restart_node,status,setup_redis}
29+
...
30+
31+
positional arguments:
32+
{create,start,stop,destroy,restart,wipe_restart,add_node,remove_node,start_node,stop_node,restart_node,status,setup_redis}
33+
create Create a new cluster
34+
start Create a new cluster, or start existing cluster if it
35+
already exists.
36+
stop Stops the cluster
37+
destroy Destroy the current cluster
38+
restart Restart the current cluster all at once
39+
wipe_restart Stop the cluster, wipe all data files and start the
40+
cluster asbefore. Will lose all the flags though.
41+
add_node Add a new node to the current cluster
42+
remove_node Stop a particular node in the cluster.
43+
start_node Start a particular node with flags.
44+
stop_node Stop a particular node in the cluster
45+
restart_node Restart the node specified.
46+
status Get info on the current cluster processes
47+
setup_redis Setup YugaByte to support Redis API
48+
49+
optional arguments:
50+
-h, --help show this help message and exit
51+
--binary_dir BINARY_DIR
52+
Specify a custom directory in which to find the
53+
yugabyte binaries.
54+
--data_dir DATA_DIR Specify a custom directory where to store data.
55+
--replication_factor REPLICATION_FACTOR, --rf REPLICATION_FACTOR
56+
Replication factor for the cluster as well as default
57+
number of masters.
58+
--num_shards_per_tserver NUM_SHARDS_PER_TSERVER
59+
Number of shards (tablets) to start per tablet server
60+
for each table.
61+
--timeout TIMEOUT Timeout in seconds for operations that wait on the
62+
cluster
63+
--verbose If specified, will log internal debug messages to
64+
stderr.
65+
--install-if-needed With this option, if YugaByte DB is not yet installed
66+
on the system, the latest version will be downloaded
67+
and installed automatically.
68+
```
2369
2470
Here are the default values for all the optional arguments.
2571
@@ -31,11 +77,12 @@ Optional Argument | Default | Description
3177
`--require_clock_sync`| `false` | Tells YugaByte DB whether to depend on clock synchronization between the nodes in the cluster
3278
`--num_shards_per_tserver`| `2` | Number of shards (tablets) per tablet server for each table
3379
34-
## Creating a cluster
80+
81+
## Create a cluster
3582
3683
The `create` cluster command is used to create a cluster.
3784
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.
3986
4087
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.
4188
@@ -61,58 +108,108 @@ Add a node to make it a 4 node cluster.
61108
$ ./bin/yb-ctl add_node
62109
```
63110
64-
65111
- Creating a 5 node cluster with replication factor 5.
66112
67113
```sh
68114
$ ./bin/yb-ctl --rf 5 create
69115
```
70116
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+
```
71173
72-
## Checking cluster status
174+
## Check cluster status
73175
74176
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.
75177
76178
```sh
77179
$ ./bin/yb-ctl status
78180
```
79181
182+
## Initialize the YEDIS API
80183
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.
84185
85186
```sh
86187
$ ./bin/yb-ctl setup_redis
87188
```
88189
190+
## Add and remove nodes
89191
90-
## Adding and removing nodes
91-
92-
### Adding nodes
192+
### Add nodes
93193
94194
- 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.
95195
96196
```sh
97197
$ ./bin/yb-ctl add_node
98198
```
99199
200+
### Stop/remove nodes
100201
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
106204
master.
107205
108206
```sh
109207
$ ./bin/yb-ctl stop_node 4
110208
```
111209
112-
113210
At this point of time `remove_node` and `stop_node` do the same thing. So they can be used interchangeably.
114211
115-
## Destroying a cluster
212+
## Destroy a cluster
116213
117214
You can use the `destroy` command to destroy a cluster. This command stops all the nodes and
118215
deletes the data directory of the cluster.
@@ -121,9 +218,11 @@ deletes the data directory of the cluster.
121218
$ ./bin/yb-ctl destroy
122219
```
123220
221+
222+
124223
## Advanced commands
125224
126-
### Creating a local cluster across multiple zones, regions and clouds
225+
### Create a cluster across multiple zones, regions and clouds
127226
128227
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.
129228
@@ -139,7 +238,7 @@ To add a node:
139238
$ ./bin/yb-ctl add_node --placement_info "cloud1.region1.zone1"
140239
```
141240
142-
### Creating a local cluster with custom flags
241+
### Create a cluster with custom flags
143242
144243
You can also pass custom flags to the masters and tservers.
145244
```sh
@@ -158,7 +257,7 @@ To add a node with custom master flags:
158257
$ ./bin/yb-ctl add_node --master_flags "log_cache_size_limit_mb=128,log_min_seconds_to_retain=20"
159258
```
160259
161-
### Restarting a cluster
260+
### Restart a cluster
162261
163262
The `restart` command can be used to restart a cluster. Please note that if you restart the cluster,
164263
all custom defined flags and placement information will be lost. Nevertheless, you can pass the
@@ -168,69 +267,64 @@ placement information and custom flags in the same way as they are passed in the
168267
$ ./bin/yb-ctl restart
169268
```
170269
171-
Restarting with cloud, region and zone flags:
270+
- Restart with cloud, region and zone flags
172271
173272
```sh
174-
$ ./bin/yb-ctl wipe_restart --placement_info "cloud1.region1.zone1"
273+
$ ./bin/yb-ctl restart --placement_info "cloud1.region1.zone1"
175274
```
176275
177-
Restarting with custom flags:
276+
- Restart with custom flags
178277
179278
```sh
180-
$ ./bin/yb-ctl wipe_restart --master_flags "log_cache_size_limit_mb=128,log_min_seconds_to_retain=20,master_backup_svc_queue_length=70" --tserver_flags "log_inject_latency=false,log_segment_size_mb=128,raft_heartbeat_interval_ms=1000"
279+
$ ./bin/yb-ctl restart --master_flags "log_cache_size_limit_mb=128,log_min_seconds_to_retain=20,master_backup_svc_queue_length=70" --tserver_flags "log_inject_latency=false,log_segment_size_mb=128,raft_heartbeat_interval_ms=1000"
181280
```
182281
183-
### Restarting a node
282+
### Restart a node
184283
185-
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.
188285
189286
```sh
190287
$ ./bin/yb-ctl restart_node 2
191288
```
192289
193-
- Restarting node with placement info:
290+
- Restart node with placement info
194291
195292
```sh
196293
$ ./bin/yb-ctl restart_node 2 --placement_info "cloud1.region1.zone1"
197294
```
198295
199-
200-
- Restarting master node:
296+
- Restart master node
201297
202298
```sh
203299
$ ./bin/yb-ctl restart_node 2 --master
204300
```
205301
206-
207-
- Restarting node with flags:
302+
- Restart node with flags
208303
209304
```sh
210305
$ ./bin/yb-ctl restart_node 2 --master --master_flags "log_cache_size_limit_mb=128,log_min_seconds_to_retain=20"
211306
```
212307
213308
### Wipe and restart a cluster
214309
215-
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.
217311
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.
221313
222314
```sh
223315
$ ./bin/yb-ctl wipe_restart
224316
```
225317
226-
Wipe and restart with placement info flags:
318+
- Wipe and restart with placement info flags
227319
228320
```sh
229321
$ ./bin/yb-ctl wipe_restart --placement_info "cloud1.region1.zone1"
230322
```
231323
232-
Wipe and restart with custom flags:
324+
- Wipe and restart with custom flags
233325
234326
```sh
235327
$ ./bin/yb-ctl wipe_restart --master_flags "log_cache_size_limit_mb=128,log_min_seconds_to_retain=20,master_backup_svc_queue_length=70" --tserver_flags "log_inject_latency=false,log_segment_size_mb=128,raft_heartbeat_interval_ms=1000"
236328
```
329+
330+

content/latest/admin/yb-docker-ctl.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ $ mkdir ~/yugabyte && cd ~/yugabyte
2525
$ wget https://downloads.yugabyte.com/yb-docker-ctl && chmod +x yb-docker-ctl
2626
```
2727

28-
2928
## Help command
3029

3130
Use the **-\-help** option to see all the commands supported.
@@ -35,17 +34,23 @@ $ ./yb-docker-ctl -h
3534
```
3635

3736
```
38-
usage: yb-docker-ctl [-h] {create,status,destroy,add_node,remove_node} ...
37+
usage: yb-docker-ctl [-h]
38+
{create,add_node,status,destroy,stop_node,start_node,stop,start,remove_node}
39+
...
3940
4041
YugaByte Docker Container Control
4142
4243
positional arguments:
43-
{create,status,destroy,add_node,remove_node}
44+
{create,add_node,status,destroy,stop_node,start_node,stop,start,remove_node}
4445
Commands
4546
create Create YugaByte Cluster
47+
add_node Add a new YugaByte Cluster Node
4648
status Check YugaByte Cluster status
4749
destroy Destroy YugaByte Cluster
48-
add_node Add a new YugaByte Cluster Node
50+
stop_node Stop a YugaByte Cluster Node
51+
start_node Start a YugaByte Cluster Node
52+
stop Stop YugaByte Cluster so that it can be started later
53+
start Start YugaByte Cluster if one already exists
4954
remove_node Stop a YugaByte Cluster Node
5055
5156
optional arguments:

content/latest/admin/ysqlsh.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ ysqlsh is installed as part of YugaByte DB and is located in the bin directory o
2525
## Example
2626

2727
```sh
28-
$ ./bin/ysqlsh --echo-queries
28+
$ ./bin/ysqlsh
2929
```
3030

3131
```

content/latest/develop/build-apps/java/ycql.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ showAsideToc: true
2323
<li >
2424
<a href="/latest/develop/build-apps/java/ysql-spring-data" class="nav-link">
2525
<i class="icon-postgres" aria-hidden="true"></i>
26-
YSQL - Spring Data with JPA/Hibernate
26+
YSQL - Spring Data JPA with Hibernate
2727
</a>
2828
</li>
2929
<li>

content/latest/develop/build-apps/java/ysql-jdbc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ showAsideToc: true
2828
<li >
2929
<a href="/latest/develop/build-apps/java/ysql-spring-data" class="nav-link">
3030
<i class="icon-postgres" aria-hidden="true"></i>
31-
YSQL - Spring Data with JPA/Hibernate
31+
YSQL - Spring Data JPA with Hibernate
3232
</a>
3333
</li>
3434
<li>

0 commit comments

Comments
 (0)