## 1. Project Overview & Quickstart (yugabyte/AGENTS)

# AGENTS

Multi-harness agentic plugin marketplace for Claude Code, Codex CLI, Cursor, OpenCode, GitHub Copilot, and Gemini CLI

### Repository Details
- **Repository:** [yugabyte/AGENTS](https://github.com/yugabyte/AGENTS)
- **GitHub Stars:** ⭐ 38,567
- **Primary Language:** Python

*Note: High-volume repository documentation is actively indexed and synchronized by YakaAI.*

## 2. Official Technical Reference & Guides (yugabyte/docs)

## File: README.md

# THIS REPO HAS MOVED [HERE](https://github.com/YugaByte/yugabyte-db/tree/master/docs).
# DO NOT USE THIS CODEBASE ANYMORE.



# YugaByte DB Docs

This repository contains the documentation for YugaByte DB available at https://docs.yugabyte.com/

Please [open an issue](https://github.com/YugaByte/docs/issues) to suggest enhancements.


# Contributing to YugaByte DB Docs

YugaByte DB docs are based on the Hugo framework and use the Material Docs theme.

* Hugo framework: http://gohugo.io/overview/introduction/
* Material Docs theme: http://themes.gohugo.io/material-docs/


## Step 1. Initial setup

Follow these steps if this is the first time you are setting up the YugaByte docs repo locally.

1. Fork this repository on GitHub and create a local clone of your fork. This should look something like below:
```
git clone git@github.com:<YOUR_GITHUB_ID>/docs.git
```

Add the master as a remote branch by running the following:
```
$ git remote add --track master upstream https://github.com/YugaByte/docs.git
```

2. Install Hugo. For example, on a Mac, you can run the following commands:
```
brew update
brew install hugo
brew install npm
```

3. Copy the config.yaml.sample to config.yaml.
```
cp config.yaml.sample config.yaml
```

4. Install node modules as shown below:
```
$ npm ci
```

## Step 2. Update your docs repo and start the local webserver

The assumption here is that you are working on a local clone of your fork. See the previous step.

1. Rebase your fork to fetch the latest docs changes:
Ensure you are on the master branch.
```
$ git checkout master
```

Now rebase to the latest changes.
```
$ git pull --rebase upstream master
$ git push origin master
```

2. Start the local webserver on `127.0.0.1` interface by running the following:
```
$ npm start
```

You should be able to see the local version of the docs by browsing to:
http://localhost:1313/

**Note #1** that the URL may be different if the port 1313 is not available. In any case, the URL is printed out on your shell as shown below.
```
Web Server is available at //localhost:1313/ (bind address 0.0.0.0)
Press Ctrl+C to stop
```

**Note #2** To start the webserver on some other IP address (in case you want to share the URL of your local docs with someone else), do the following:
```
YB_HUGO_BASE=<YOUR_IP_OR_HOSTNAME> npm start
```
You can now share the following link: `http://<YOUR_IP_OR_HOSTNAME>:1313`


## Step 3. Make changes

Make the changes locally and test them on the browser.

Once you are satisfied with your changes, commit them to your local branch. You can do this by running the following command:
```
# Add all files you have made changes to.
$ git add -A

# Commit these changes.
$ git commit
```

## Step 4. Submit a pull request

Create a [pull request in the YugaByte docs repo](https://github.com/YugaByte/docs/pulls) once you are ready to submit your changes.

We will review your changes, add any feedback and once everything looks good merge your changes into the mainline.

---

## File: content/latest/admin/cqlsh.md

---
title: cqlsh
linkTitle: cqlsh
aliases:
  - /develop/tools/cqlsh/
  - /latest/develop/tools/cqlsh/
menu:
  latest:
    identifier: cqlsh
    parent: admin
    weight: 2460
isTocNested: true
showAsideToc: true
---

## Overview

`cqlsh` is a command line shell for interacting with YugaByte DB through [YCQL](../../api/ycql/). 

## Download 

cqlsh is installed as part of YugaByte DB and is located in the bin directory of YugaByte home. It is also available for download and install from YugaByte DB's [Github repo](https://github.com/YugaByte/cqlsh/releases).

## Example

```sh
$ ./bin/cqlsh --execute "select cluster_name, data_center, rack from system.local" 127.0.0.1
```

```
 cluster_name  | data_center | rack
---------------+-------------+-------
 local cluster | datacenter1 | rack1
```

## Command Line Options

Use the **-\-help** option to see all the command line options supported.

```
cqlsh [options] [host [port]]
```

Where

- `host` is the IP address of the host on which [YB-TServer](../../../architecture/concepts/universe/#yb-tserver) is run. The default is local host at 127.0.0.1.
- `port` is the TCP port at which YB-TServer listens for YCQL connections. The default is 9042.

Options | Short Form | Default | Description
----------------------------|----|-------|---------------------------------------
`--color` | `-C` |  | Force color output
`--no-color`| | | Disable color output
`--browser` | | | Specify the browser to use for displaying `cqlsh` help. This can be one of the [supported browser names](https://docs.python.org/2/library/webbrowser.html) (e.g. firefox) or a browser path followed by `%s` (e.g. `/usr/bin/google-chrome-stable %s`).
`--ssl` | | | Use SSL when connecting to YugaByte DB
`--user` | `-u` | | Username to authenticate against YugaByte DB with
`--password` | `-p` | | Password to authenticate against YugaByte DB with, should be used in conjunction with `--user`
`--keyspace` | `-k` | | Keyspace to authenticate to, should be used in conjunction with `--user`
`--file` | `-f` | | Execute commands from the given file, then exit
`--debug` | | | Print additional debugging information
`--encoding` | | UTF-8 | Specify a non-default encoding for output.
`--cqlshrc` | | | Specify the location for the `cqlshrc` file. The `cqlshrc` file holds configuration options for `cqlsh`. By default this is in the user’s home directory at `~/.cassandra/cqlsh`.
`--execute` | `-e` | | Execute the given statement, then exit
`--connect-timeout` | | 2 | Specify the connection timeout in seconds
`--request-timeout` | | 10 | Specify the request timeout in seconds
`--tty` | `-t` | | Force tty mode (command prompt)

## Special Commands

In addition to supporting regular YCQL statements, `cqlsh` also supports the following special commands.

### CONSISTENCY

```sql
CONSISTENCY <consistency level>
```

Sets the consistency level for the read operations that follow. Valid arguments include:

Consistency Level | Description
------------------|------------
`QUORUM` | Read the strongly consistent results from the tablet's quorum. The read request will be processed by the tablet leader only. This is the default consistency level.
`ONE` | Read from a follower with relaxed consistency guarantees.

To inspect the current consistency level, use `CONSISTENCY` with no arguments.

### SHOW VERSION
Prints the `cqlsh`, Cassandra, CQL, and native protocol versions in use. Example:

```sql
cqlsh> SHOW VERSION
```

```
[cqlsh 5.0.1 | Cassandra 3.8 | CQL spec 3.4.2 | Native protocol v4]
```

### SHOW HOST
Prints the IP address and port of the YB-TServer node that `cqlsh` is connected to in addition to the cluster name. Example:

```sql
cqlsh> SHOW HOST
```

```
Connected to local cluster at 127.0.0.1:9042.
```

### SOURCE
Reads the contents of a file and executes each line as a YCQL statement or special `cqlsh` command.

```
SOURCE '<file>'
```

Example usage:

```sql
cqlsh> SOURCE '/home/yugabyte/commands.cql'
```

### CAPTURE
Begins capturing command output and appending it to a specified file. Output will not be shown at the console while it is captured.

```
CAPTURE '<file>'
CAPTURE OFF
CAPTURE
```

- The path to the file to be appended to must be given inside a string literal. The path is interpreted relative to the current working directory. The tilde shorthand notation (`~/mydir`) is supported for referring to `$HOME`.
- Only query result output is captured. Errors and output from cqlsh-only commands will still be shown in the `cqlsh` session.
- To stop capturing output and show it in the `cqlsh` session again, use `CAPTURE OFF`.
- To inspect the current capture configuration, use `CAPTURE` with no arguments.

### HELP

Gives information about `cqlsh` commands. To see available topics, enter `HELP` without any arguments. To see help on a topic, use `HELP <topic>`. Also see the `--browser` argument for controlling what browser is used to display help.

```sql
HELP <topic>
```

### PAGING
Enables paging, disables paging, or sets the page size for read queries. When paging is enabled, only one page of data will be fetched at a time and a prompt will appear to fetch the next page. Generally, it’s a good idea to leave paging enabled in an interactive session to avoid fetching and printing large amounts of data at once.

```sql
PAGING ON
PAGING OFF
PAGING 
```
To inspect the current paging setting, use `PAGING` with no arguments.

### EXPAND
Enables or disables vertical printing of rows. Enabling EXPAND is useful when many columns are fetched, or the contents of a single column are large.

```sql
EXPAND ON
EXPAND OFF
```

To inspect the current expand setting, use `EXPAND` with no arguments.

### LOGIN
Authenticate as a specified YugaByte DB user for the current session.

```sql
LOGIN  []
```

### EXIT
Ends the current session and terminates the `cqlsh` process.

```sql
EXIT
QUIT
```

### CLEAR
Clears the console.

```sql
CLEAR
CLS
```

### DESCRIBE
Prints a description (typically a series of DDL statements) of a schema element or the cluster. This is useful for dumping all or portions of the schema.

```sql
DESCRIBE CLUSTER
DESCRIBE SCHEMA
DESCRIBE KEYSPACES
DESCRIBE KEYSPACE <keyspace name>
DESCRIBE TABLES
DESCRIBE TABLE 
DESCRIBE INDEX 
DESCRIBE TYPES
DESCRIBE TYPE <type name>
```

In any of the commands, `DESC` may be used in place of `DESCRIBE`.

The `DESCRIBE CLUSTER` command prints the cluster namer:

```sql
cqlsh> DESCRIBE CLUSTER
```

```
Cluster: local cluster
```

The `DESCRIBE SCHEMA` command prints the DDL statements needed to recreate the entire schema. This is especially useful for dumping the schema in order to clone a cluster or restore from a backup.

### COPY TO
Copies data from a table to a CSV file.

```sql
COPY  [(<column>, ...)] TO <file name> WITH <copy option> [AND <copy option> ...]
```

If no columns are specified, all columns from the table will be copied to the CSV file. A subset of columns to copy may be specified by adding a comma-separated list of column names surrounded by parenthesis after the table name.

The `file name` should be a string literal (with single quotes) representing a path to the destination file. This can also the special value `STDOUT` (without single quotes) to print the CSV to stdout.

Options | Default | Description
--------|---------|------------
`MAXREQUESTS` | 6 | The maximum number token ranges to fetch simultaneously.
`PAGESIZE` | 1000 | The number of rows to fetch in a single page.
`PAGETIMEOUT` | 10 | The timeout in seconds per 1000 entries in the page size or smaller.
`BEGINTOKEN`, `ENDTOKEN` | | Token range to export. Defaults to exporting the full ring.
`MAXOUTPUTSIZE` | -1 | The maximum size of the output file measured in number of lines; beyond this maximum the output file will be split into segments. -1 means unlimited.
`ENCODING` | utf8 | The encoding used for characters.

The following options are common to both `COPY TO` and `COPY FROM`.

Options | Default | Description
--------|---------|------------
`NULLVAL` | `null` | The string placeholder for null values.
`HEADER` | `false` | For `COPY TO`, controls whether the first line in the CSV output file will contain the column names. For `COPY FROM`, specifies whether the first line in the CSV input file contains column names.
`DECIMALSEP` | `.` | The character that is used as the decimal point separator.
`THOUSANDSSEP` | | The character that is used to separate thousands. Defaults to the empty string.
`BOOLSTYlE` | `True,False` | The string literal format for boolean values.
`NUMPROCESSES` | | The number of child worker processes to create for `COPY` tasks. Defaults to a max of 4 for `COPY FROM` and 16 for `COPY TO`. However, at most (num_cores - 1) processes will be created.
`MAXATTEMPTS` | 5 | The maximum number of failed attempts to fetch a range of data (when using `COPY TO`) or insert a chunk of data (when using `COPY FROM`) before giving up.
`REPORTFREQUENCY` | 0.25 | How often status updates are refreshed, in seconds.
`RATEFILE` | | An optional file to output rate statistics to. By default, statistics are not output to a file.

### COPY FROM
Copies data from a CSV file to table.

```sql
COPY  [(<column>, ...)] FROM <file name> WITH <copy option> [AND <copy option> ...]
```
If no columns are specified, all columns from the CSV file will be copied to the table. A subset of columns to copy may be specified by adding a comma-separated list of column names surrounded by parenthesis after the table name.

The `file name` should be a string literal (with single quotes) representing a path to the source file. This can also the special value `STDIN` (without single quotes) to read the CSV data from stdin.

Options | Default | Description
--------|---------|------------
`INGESTRATE` | 100000 | The maximum number of rows to process per second.
`MAXROWS` | -1 | The maximum number of rows to import. -1 means unlimited.
`SKIPROWS` | 0 | A number of initial rows to skip.
`SKIPCOLS` | | A comma-separated list of column names to ignore. By default, no columns are skipped.
`MAXPARSEERRORS` | -1 | The maximum global number of parsing errors to ignore. -1 means unlimited.
`MAXINSERTERRORS` | 1000 | The maximum global number of insert errors to ignore. -1 means unlimited.
`ERRFILE=` | | A file to store all rows that could not be imported, by default this is `import_<ks>_.err` where `<ks>` is your keyspace and `` is your table name.
`MAXBATCHSIZE` | 20 | The max number of rows inserted in a single batch.
`MINBATCHSIZE` | 2 | The min number of rows inserted in a single batch.
`CHUNKSIZE` | 1000 | The number of rows that are passed to child worker processes from the main process at a time.

See `COPY TO` for additional options common to both `COPY TO` and `COPY FROM`.

---

## File: content/latest/admin/yb-ctl.md

---
title: yb-ctl
linkTitle: yb-ctl
menu:
  latest:
    identifier: yb-ctl
    parent: admin
    weight: 2410
aliases:
  - admin/yb-ctl
isTocNested: false
showAsideToc: true
---

`yb-ctl`, located in the bin directory of YugaByte home, is a simple command line interface for administering local clusters. It invokes the [`yb-master`](../yb-master/) and [`yb-tserver`](../yb-tserver/) binaries to perform the necessary administration.

Use the **-\-help** option to see all the commands supported.

```sh
$ ./bin/yb-ctl --help
```
```
/* Detailed source-code truncated for AI context efficiency. */
```

Here are the default values for all the optional arguments.

Optional Argument | Default | Description
----------------------------|-----------|---------------------------------------
`--binary_dir` | Same directory as the `yb-ctl` binary | Location of the `yb-master` and the `yb-tserver` binaries
`--data_dir` | `/tmp/yugabyte-local-cluster` | Location of the data directory for the YugaByte DB
`--replication_factor` or `--rf`| `1` | Number of replicas for each tablet, should be an odd number (e.g. `1`,`3`,`5`) so that majority consensus can be established
`--require_clock_sync`| `false` | Tells YugaByte DB whether to depend on clock synchronization between the nodes in the cluster
`--num_shards_per_tserver`| `2` | Number of shards (tablets) per tablet server for each table


## Create a cluster

The `create` cluster command is used to create a cluster.

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.

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.

- Creating a local cluster with replication factor 1.

```sh
$ ./bin/yb-ctl create
```

Note that the default replication factor is 1.

- Creating a 4 node cluster with replication factor 3.

First create 3 node cluster with replication factor 3.

```sh
$ ./bin/yb-ctl --rf 3 create
```

Add a node to make it a 4 node cluster.

```sh
$ ./bin/yb-ctl add_node
```

- Creating a 5 node cluster with replication factor 5.

```sh
$ ./bin/yb-ctl --rf 5 create
```

## Default cluster configuration

### Data directory

Cluster data is installed in `$HOME/yugabyte-data/`.

#### Node directories

`yugabyte-data/node-#/` directory created for node #.

This directory contains the following.

```sh
yugabyte-data/node-#/disk-#/
initdb.log
cluster_config.json
```

#### Disk directories

`yugabyte-data/node-#/disk-#/` directory created for each disk.

This directory contains the following.

```sh
yugabyte-data/node-#/disk-#/pg_data/
yugabyte-data/node-#/disk-#/yb-data/ 
```

### Logs

yb-master logs are located at

```sh
yugabyte-data/node-#/disk-#/yb-data/master.out
yugabyte-data/node-#/disk-#/yb-data/master/logs
```

yb-tserver logs are located at

```sh
yugabyte-data/node-#/disk-#/yb-data/tserver.out
yugabyte-data/node-#/disk-#/yb-data/tserver/logs
```

## Start and stop an existing cluster

Create a new cluster, or start an existing cluster if it already exists.
```sh
$ ./bin/yb-ctl start
```

Stop a cluster so that you can start it later.
```sh
$ ./bin/yb-ctl stop
```

## Check cluster status

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.

```sh
$ ./bin/yb-ctl status
```

## Initialize the YEDIS API

The `setup_redis` command to initialize YugaByte DB's Redis-compatible YEDIS API.

```sh
$ ./bin/yb-ctl setup_redis
```

## Add and remove nodes

### Add nodes

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

```sh
$ ./bin/yb-ctl add_node
```

### Stop/remove nodes

We can stop a node by executing the `stop` command. The command takes the node id of the node
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
master.

```sh
$ ./bin/yb-ctl stop_node 4
```

At this point of time `remove_node` and `stop_node` do the same thing. So they can be used interchangeably.

## Destroy a cluster

You can use the `destroy` command to destroy a cluster. This command stops all the nodes and 
deletes the data directory of the cluster.

```sh
$ ./bin/yb-ctl destroy
```



## Advanced commands

### Create a cluster across multiple zones, regions and clouds

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.

```sh
$ ./bin/yb-ctl --rf 3 create --placement_info "cloud1.region1.zone1,cloud2.region2.zone2"
```

The total number of placement information entries cannot be more than the replication factor (this is because we would not be able to satisfy the data placement constraints for this replication factor).
If the total number of placement information entries is lesser than the replication factor, the placement information is passed down to the node in a round robin fashion.

To add a node:
```sh
$ ./bin/yb-ctl add_node --placement_info "cloud1.region1.zone1"
```

### Create a cluster with custom flags

You can also pass custom flags to the masters and tservers.
```sh
$ ./bin/yb-ctl --rf 1 create --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"
```

To add a node with custom tserver flags.

```sh
$ ./bin/yb-ctl add_node --tserver_flags "log_inject_latency=false,log_segment_size_mb=128"
```

To add a node with custom master flags:

```sh
$ ./bin/yb-ctl add_node --master_flags "log_cache_size_limit_mb=128,log_min_seconds_to_retain=20"
```

### Restart a cluster

The `restart` command can be used to restart a cluster. Please note that if you restart the cluster,
all custom defined flags and placement information will be lost. Nevertheless, you can pass the
placement information and custom flags in the same way as they are passed in the `create` command.

```sh
$ ./bin/yb-ctl restart
```

- Restart with cloud, region and zone flags

```sh
$ ./bin/yb-ctl restart --placement_info "cloud1.region1.zone1" 
```

- Restart with custom flags

```sh
$ ./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"
```

### Restart a node

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.

```sh
$ ./bin/yb-ctl restart_node 2
```

- Restart node with placement info

```sh
$ ./bin/yb-ctl restart_node 2 --placement_info "cloud1.region1.zone1"
```

- Restart master node

```sh
$ ./bin/yb-ctl restart_node 2 --master
```

- Restart node with flags

```sh
$ ./bin/yb-ctl restart_node 2 --master --master_flags "log_cache_size_limit_mb=128,log_min_seconds_to_retain=20"
```

### Wipe and restart a cluster

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.

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.

```sh
$ ./bin/yb-ctl wipe_restart
```

- Wipe and restart with placement info flags

```sh
$ ./bin/yb-ctl wipe_restart --placement_info "cloud1.region1.zone1" 
```

- Wipe and restart with custom flags

```sh
$ ./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"
```

---

## File: content/latest/admin/yb-docker-ctl.md

---
title: yb-docker-ctl
linkTitle: yb-docker-ctl
menu:
  latest:
    identifier: yb-docker-ctl
    parent: admin
    weight: 2420
aliases:
  - admin/yb-docker-ctl
isTocNested: false
showAsideToc: true
---

`yb-docker-ctl` is a simple command line interface for administering local Docker clusters. It manages the [`yb-master`](../yb-master/) and [`yb-tserver`](../yb-tserver/) containers to perform the necessary administration.

## Download

```sh
$ mkdir ~/yugabyte && cd ~/yugabyte
```

```sh
$ wget https://downloads.yugabyte.com/yb-docker-ctl && chmod +x yb-docker-ctl
```

## Help command

Use the **-\-help** option to see all the commands supported.

```sh
$ ./yb-docker-ctl -h
```

```
usage: yb-docker-ctl [-h]
                     {create,add_node,status,destroy,stop_node,start_node,stop,start,remove_node}
                     ...

YugaByte Docker Container Control

positional arguments:
  {create,add_node,status,destroy,stop_node,start_node,stop,start,remove_node}
                        Commands
    create              Create YugaByte Cluster
    add_node            Add a new YugaByte Cluster Node
    status              Check YugaByte Cluster status
    destroy             Destroy YugaByte Cluster
    stop_node           Stop a YugaByte Cluster Node
    start_node          Start a YugaByte Cluster Node
    stop                Stop YugaByte Cluster so that it can be started later
    start               Start YugaByte Cluster if one already exists
    remove_node         Stop a YugaByte Cluster Node

optional arguments:
  -h, --help            show this help message and exit
```

## Create cluster

- Create a 1 node local cluster with replication factor 1. 

Note that the create command pulls the latest `yugabytedb/yugabyte` image at the outset in case the image is not yet downloaded or is not the latest.

```sh
$ ./yb-docker-ctl create
```

- Create a 3 node local cluster with replication factor 3. 

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 to the replication factor for the cluster to be considered as operating normally and the number of yb-tservers is equal to be the number of nodes.

```sh
$ ./yb-docker-ctl create --rf 3
```

```
/* Detailed source-code truncated for AI context efficiency. */
```

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. With the [add_node](#add-a-node) and [remove_node](#remove-a-node) commands the size of the cluster can thereafter be expanded or shrinked as necessary. 

- Create a 5 node local cluster with replication factor 5. 

```sh
$ ./yb-docker-ctl create --rf 5
```

## Check cluster status

Get the status of the local cluster including the URLs for the admin UIs for the YB-Master and YB-TServer.

```sh
$ ./yb-docker-ctl status
```

```
PID        Type       Node                 URL                       Status          Started At          
11818      tserver    yb-tserver-n3        http://172.19.0.7:9000    Running         2017-11-28T23:33:00.369124907Z
11632      tserver    yb-tserver-n2        http://172.19.0.6:9000    Running         2017-11-28T23:32:59.874963849Z
11535      tserver    yb-tserver-n1        http://172.19.0.5:9000    Running         2017-11-28T23:32:59.444064946Z
11350      master     yb-master-n3         http://172.19.0.4:9000    Running         2017-11-28T23:32:58.899308826Z
11231      master     yb-master-n2         http://172.19.0.3:9000    Running         2017-11-28T23:32:58.403788411Z
11133      master     yb-master-n1         http://172.19.0.2:9000    Running         2017-11-28T23:32:57.905097927Z
```

## Add a node

Add a new node to the cluster. This will start a new yb-tserver process and give it a new `node_id` for tracking purposes.

```sh
$ ./yb-docker-ctl add_node
```

```
docker run --name yb-tserver-n4 --net yb-net --detach yugabytedb/yugabyte:latest /home/yugabyte/yb-tserver --fs_data_dirs=/mnt/disk0,/mnt/disk1 --tserver_master_addrs=04:7100,04:7100,04:7100 --rpc_bind_addresses=yb-tserver-n4:9100
Adding node yb-tserver-n4
```

## Remove a node

Remove a node from the cluster by executing the following command. The command takes the node_id of the node to be removed as input.

### Help

```sh
$ ./yb-docker-ctl remove_node --help
```

```
usage: yb-docker-ctl remove_node [-h] node

positional arguments:
  node_id        Index of the node to remove

optional arguments:
  -h, --help  show this help message and exit
```

### Example

```sh
$ ./yb-docker-ctl remove_node 3
```

```
Stopping node :yb-tserver-n3
```

## Destroy cluster

The command below destroys the cluster which includes deleting the data directories.

```sh
$ ./yb-docker-ctl destroy
```

## Upgrade container image

The command below upgrades the YugaByte DB image to the latest version.

```sh
$ docker pull yugabytedb/yugabyte
```

---

## File: content/latest/admin/yb-master.md

---
title: yb-master
linkTitle: yb-master
menu:
  latest:
    identifier: yb-master
    parent: admin
    weight: 2440
aliases:
  - admin/yb-master
isTocNested: false
showAsideToc: true
---

`yb-master`, located in the bin directory of YugaByte home, is the [YB-Master](../../architecture/concepts/universe/#yb-master) binary.

## Example

```sh
$ ./bin/yb-master \
--master_addresses 172.151.17.130:7100,172.151.17.220:7100,172.151.17.140:7100 \
--rpc_bind_addresses 172.151.17.130 \
--fs_data_dirs "/home/centos/disk1,/home/centos/disk2" \
--replication_factor=3 &
```

## Help 

Use the **-\-help** option to see all the commands supported.

```sh
$ ./bin/yb-master --help
```

## Config flags

Flag | Mandatory | Default | Description 
----------------------|------|---------|------------------------
`--master_addresses` | Y | N/A |Comma-separated list of all the RPC addresses for `yb-master` consensus-configuration. 
`--fs_data_dirs` | Y | N/A | Comma-separated list of directories where the `yb-master` will place all it's `yb-data/master` data directory. 
`--fs_wal_dirs`| N | Same value as `--fs_data_dirs` | The directory where the `yb-master` will place its write-ahead logs. May be the same as one of the directories listed in `--fs_data_dirs`, but not a sub-directory of a data directory. 
`--log_dir`| N | Same value as `--fs_data_dirs`   | The directory to store `yb-master` log files.  
`--max_clock_skew_usec` | N | 50000 (50ms) | The expected maximum clock skew between any two nodes in your deployment.
`--rpc_bind_addresses`| Y |`0.0.0.0:7100` | Comma-separated list of addresses to bind to for RPC connections.
`--server_broadcast_addresses`| N |`0.0.0.0:7100` | Public IP or DNS hostname of the server (along with an optional port).
`--use_private_ip`| N |`never` | Determines when to use private IP addresses. Possible values are `never`,`zone`,`cloud` and `region`. Based on the values of the `placement_*` config flags listed in this table.
`--webserver_interface`| N |`0.0.0.0` | Address to bind for server UI access.
`--webserver_port`| N | `7000` | Monitoring web server port.
`--webserver_doc_root`| N | The `www` directory in the YugaByte DB home directory | Monitoring web server home.
`--replication_factor`| N |`3`  | Number of replicas to store for each tablet in the universe.
`--placement_zone`| N |`rack1`  | Name of the availability zone or rack where this instance is deployed.
`--placement_region`| N |`datacenter1`  | Name of the region or datacenter where this instance is deployed.
`--placement_cloud`| N |`cloud1`  | Name of the cloud where this instance is deployed.
`--logtostderr`| N | N/A  | Log to standard error.
`--flagfile`| N | N/A  | Load flags from the specified file.
`--version` | N | N/A | Show version and build info.
`--yb_num_shards_per_tserver` | N | -1 | The number of shards per yb-tserver per table when a user table is created. Server automatically picks a valid default internally.

## Admin UI

The Admin UI for yb-master is available at http://localhost:7000.

### Home 

Home page of the yb-master that gives a high level overview of the cluster. Note all yb-masters in a cluster show exactly the same information.



### Tables 

List of tables present in the cluster.



### Tablet Servers 

List of all nodes (aka yb-tservers) present in the cluster.



### Debug

List of all utilities available to debug the performance of the cluster.



## Default ports reference

The various default ports are listed below. 

Service | Type | Port 
--------|------| -------
`yb-master` | rpc | 7100
`yb-master` | admin web server | 7000

---

## File: content/latest/admin/yb-tserver.md

---
title: yb-tserver
linkTitle: yb-tserver
menu:
  latest:
    identifier: yb-tserver
    parent: admin
    weight: 2450
aliases:
  - admin/yb-tserver
isTocNested: false
showAsideToc: true
---

`yb-tserver`, located in the bin directory of YugaByte home, is the [YB-TServer](../../architecture/concepts/universe/#yb-tserver) binary.

## Example

```sh
$ ./bin/yb-tserver \
--tserver_master_addrs 172.151.17.130:7100,172.151.17.220:7100,172.151.17.140:7100 \
--rpc_bind_addresses 172.151.17.130 \
--start_pgsql_proxy \
--fs_data_dirs "/home/centos/disk1,/home/centos/disk2" &
```

## Help

Use the **-\-help** option to see all the commands supported.

```sh
$ ./bin/yb-tserver --help
```

## Config flags

Flag | Mandatory | Default | Description
----------------------|------|---------|------------------------
`--tserver_master_addrs` | Y | N/A  |Comma-separated list of all the `yb-master` RPC addresses.
`--fs_data_dirs` | Y | N/A | Comma-separated list of directories where the `yb-tserver` will place it's `yb-data/tserver` data directory.
`--fs_wal_dirs` | N | Same value as `--fs_data_dirs` | The directory where the `yb-tserver` will place its write-ahead logs. May be the same as one of the directories listed in `--fs_data_dirs`, but not a sub-directory of a data directory.
`--log_dir` | N | Same value as `--fs_data_dirs` | The directory to store `yb-tserver` log files.
`--max_clock_skew_usec` | N | 50000 (50ms) | The expected maximum clock skew between any two nodes in your deployment.
`--rpc_bind_addresses` | N |`0.0.0.0:9100` | Comma-separated list of addresses to bind to for RPC connections.
`--server_broadcast_addresses` | N |`0.0.0.0:9100` | Public IP or DNS hostname of the server (along with an optional port).
`--use_private_ip` | N |`never` | Determines when to use private IP addresses. Possible values are `never`,`zone`,`cloud` and `region`. Based on the values of the `placement_*` config flags listed in this table.
`--webserver_interface` | N |`0.0.0.0` | Address to bind for server UI access.
`--webserver_port` | N | `7000` | Monitoring web server port.
`--webserver_doc_root` | N | The `www` directory in the YugaByte DB home directory | Monitoring web server home.
`--cql_proxy_bind_address` | N | `0.0.0.0:9042` | YCQL API bind address.
`--cql_proxy_webserver_port` | N | 12000 | YCQL metrics monitoring port
`--redis_proxy_bind_address` | N | `0.0.0.0:6379` | YEDIS API bind address.
`--redis_proxy_webserver_port` | N | 11000 | YEDIS metrics monitoring port.
`--start_pgsql_proxy` | N | N/A | Enable YSQL API.
`--pgsql_proxy_bind_address` | N | `0.0.0.0:5433` | YSQL API bind address.
`--pgsql_proxy_webserver_port` | N | 13000 | YSQL metrics monitoring port.
`--placement_zone` | N |`rack1` | Name of the availability zone or rack where this instance is deployed.
`--placement_region` | N |`datacenter1` | Name of the region or datacenter where this instance is deployed.
`--placement_cloud` | N |`cloud1` | Name of the cloud where this instance is deployed.
`--logtostderr` | N | N/A  | Log to standard error.
`--flagfile` | N | N/A  | Load flags from the specified file.
`--version` | N | N/A | Show version and build info.
`--use_cassandra_authentication` | N | false | If enabled, it will require YCQL client authentication (username/password), enable YCQL security statements (CREATE/DROP/GRANT/REVOKE ROLE and GRANT/REVOKE PERMISSION), and enforce permissions for YCQL statements.
`--rocksdb_compact_flush_rate_limit_bytes_per_sec` | N | 256MB | Used to control rate of memstore flush and SSTable file compaction.
`--remote_bootstrap_rate_limit_bytes_per_sec` | N | 256MB | Rate control across all tablets being remote bootstrapped from or to this process.
`--yb_num_shards_per_tserver` | N | -1 | The number of shards per yb-tserver per table when a user table is created. Server automatically picks a valid default internally.
`--durable_wal_write` | N | false | If set to `false`, the writes to the Raft log are synced to disk every `interval_durable_wal_write_ms` milliseconds or every `bytes_durable_wal_write_mb` MB, whichever comes first. This default setting is recommended only for multi-AZ or multi-region deployments where the zones/regions are independent failure domains and there isn't a risk of correlated power loss.
`--interval_durable_wal_write_ms` | N | 1000 | When `durable_wal_write` is false, writes to the Raft log are synced to disk every `interval_durable_wal_write_ms` milliseconds. Also see `bytes_durable_wal_write_mb`.
`--bytes_durable_wal_write_mb`` | N | 1 | When `durable_wal_write` is false, writes to the Raft log are synced to disk every `bytes_durable_wal_write_mb` MB. Also see `interval_durable_wal_write_ms`.

## Admin UI

The Admin UI for yb-tserver is available at http://localhost:9000.

### Home

Home page of the yb-tserver that gives a high level overview of this specific instance.



### Dashboards

List of all dashboards to review the ongoing operations



### Tablets

List of all tablets managed by this specific instance, sorted by the table name.



### Debug

List of all utilities available to debug the performance of this specific instance.



## Default ports reference

The various default ports are listed below.

Service | Type | Port
--------|------| -------
`yb-master` | rpc | 7100
`yb-master` | admin web server | 7000
`yb-tserver` | rpc | 9100
`yb-tserver` | admin web server | 9000
`ycql` | rpc | 9042
`ycql` | admin web server | 12000
`yedis` | rpc | 6379
`yedis` | admin web server | 11000
`ysql` | rpc | 5433
`ysql` | admin web server | 13000

---

## File: content/latest/admin/ysqlsh.md

---
title: ysqlsh
linkTitle: ysqlsh
aliases:
  - /develop/tools/ysqlsh/
  - /latest/develop/tools/ysqlsh/
menu:
  latest:
    identifier: ysqlsh
    parent: admin
    weight: 2459
isTocNested: true
showAsideToc: true
---

## Overview

`ysqlsh` is a command line shell for interacting with YugaByte DB through [YSQL](../../api/ysql/). It is derived from [`psql`](https://www.postgresql.org/docs/11/app-psql.html), the PostgreSQL shell.

## Download 

ysqlsh is installed as part of YugaByte DB and is located in the bin directory of YugaByte home. 

## Example

```sh
$ ./bin/ysqlsh
```

```
ysqlsh (11.2)
Type "help" for help.

postgres=#
```

## Defaults

ysqlsh defaults the following flags so that the user does not have to specify them.

```
-h 127.0.0.1 
-p 5433 
-U postgres
```

---

## File: content/latest/api/ycql/quick-start/binary/explore-ycql.md

* Run cqlsh to connect to the service.

You can do this as shown below.

```sh
$ ./bin/cqlsh localhost
```

```
Connected to local cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 3.9-SNAPSHOT | CQL spec 3.4.2 | Native protocol v4]
Use HELP for help.
cqlsh> 
```

* Run a cql command to verify it is working.

```sql
cqlsh> describe keyspaces;
```

```
system_schema  system_auth  system

cqlsh> 
```

---

## File: content/latest/api/ycql/quick-start/docker/explore-ycql.md

* Run cqlsh to connect to the service.

You can do this as shown below.

```sh
$ docker exec -it yb-tserver-n3 /home/yugabyte/bin/cqlsh
```

```
Connected to local cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 3.9-SNAPSHOT | CQL spec 3.4.2 | Native protocol v4]
Use HELP for help.
cqlsh> 
```

* Run a cql command to verify it is working.

```sql
cqlsh> describe keyspaces;
```

```
system_schema  system_auth  system

cqlsh> 
```

---

## File: content/latest/api/ycql/quick-start/kubernetes/explore-ycql.md

* Run cqlsh to connect to the service.

```sh
$ kubectl exec -it yb-tserver-0 /home/yugabyte/bin/cqlsh
```

```
Connected to local cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 3.9-SNAPSHOT | CQL spec 3.4.2 | Native protocol v4]
Use HELP for help.
cqlsh> 
```

* Run a cql command to verify it is working.

```sql
cqlsh> describe keyspaces;
```

```
system_schema  system_auth  system

cqlsh> 
```