Skip to content

Commit

Permalink
Updating ServerConfiguration doc.
Browse files Browse the repository at this point in the history
Topology service was the old syntax.
Added a section on directory configuration.
  • Loading branch information
alainjobart committed May 24, 2017
1 parent c31fd6a commit 96f2f35
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 13 deletions.
5 changes: 2 additions & 3 deletions doc/ScalabilityPhilosophy.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,8 @@ available and consistent data store.

Lock servers were built for this exact purpose, and Vitess needs one such
cluster to be setup to run smoothly. Vitess can be customized to utilize any
lock server, and by default it supports zookeeper and etcd. We call this
component
[Topology Service](/user-guide/topology-service.html).
lock server, and by default it supports Zookeeper, etcd and Consul. We call this
component [Topology Service](/user-guide/topology-service.html).

As Vitess is meant to run in multiple data centers / regions (called cells
below), it relies on two different lock servers:
Expand Down
58 changes: 48 additions & 10 deletions doc/ServerConfiguration.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,18 +177,21 @@ See the
for more information on how to setup both of these features, and what command
line parameters exist.

## Lock server configuration
## Topology Service configuration

Vttablet, vtgate, vtctld need the right command line parameters to find the topo server. First the *topo\_implementation* flag needs to be set to one of *zookeeper* or *etcd*. Then each is configured as follows:
Vttablet, vtgate, vtctld need the right command line parameters to find the
Topology Server. First the *topo\_implementation* flag needs to be set to one of
*zk2*, *etcd2*, or *consul*. Then they're all configured as follows:

* zookeeper: it is configured using the *ZK\_CLIENT\_CONFIG* environment
variable, that points at a JSON file that contains the global and local cells
configurations. For instance, this can be the contents of the file:
```{"cell1": "server1:port1,server2:port2", "cell2":
"server1:port1,server2:port2", "global": "server1:port1,server2:port2"}```
* etcd: the *etcd\_global\_addrs* parameter needs to point at the global
instance. Then inside that global instance, the */vt/cells/<cell name>* path
needs to point at each cell instance.
* The *topo_global_server_address* contains the server address / addresses of
the global topology server.
* The *topo_global_root* contains the directory / path to use.

Note that the local cell for the tablet must exist and be configured properly in
the Topology Service for vttablet to start. Local cells are configured inside
the topo server, by using the `vtctl AddCellInfo` command. See
the [Topology Service](/user-guide/topology-service.html) documentation for more
information.

## VTTablet

Expand All @@ -199,6 +202,41 @@ VTTablet has a large number of command line options. Some important ones will be
* 2-4 cores (in proportion to MySQL cores)
* 2-4 GB RAM

### Directory Configuration

vttablet supports a number of command line options and environment variables
to facilitate its setup.

The **VTDATAROOT** environment variable specifies the toplevel directory for all
data files. If not set, it defaults to `/vt`.

By default, a vttablet will use a subdirectory in **VTDATAROOT** named
`vt_NNNNNNNNNN` where `NNNNNNNNNN` is the tablet id. The **tablet_dir**
command-line parameter allows overriding this relative path. This is useful in
containers where the filesystem only contains one vttablet, in order to have a
fixed root directory.

When starting up and using `mysqlctl` to manage MySQL, the MySQL files will be
in subdirectories of the tablet root. For instance, `bin-logs` for the binary
logs, `data` for the data files, and `relay-logs` for the relay logs.

It is possible to host different parts of a MySQL server files on different
partitions. For instance, the data file may reside in flash, while the bin logs
and relay logs are on spindle. To achieve this, create a symlink from
`$VTDATAROOT/<dir name>` to the proper location on disk. When MySQL is
configured by mysqlctl, it will realize this directory exists, and use it for the
files it would otherwise have put in the tablet directory. For instance, to host
the binlogs in `/mnt/bin-logs`:

* Create a symlink from `$VTDATAROOT/bin-logs` to `/mnt/bin-logs`.

* When starting up a tablet:

* `/mnt/bin-logs/vt_NNNNNNNNNN` will be created.

* `$VTDATAROOT/vt_NNNNNNNNNN/bin-logs` will be a symlink to
`/mnt/bin-logs/vt_NNNNNNNNNN`

### Initialization

* Init_keyspace, init_shard, init_tablet_type: These parameters should be set at startup with the keyspace / shard / tablet type to start the tablet as. Note ‘master’ is not allowed here, instead use ‘replica’, as the tablet when starting will figure out if it is the master (this way, all replica tablets start with the same command line parameters, independently of which one is the master).
Expand Down

0 comments on commit 96f2f35

Please sign in to comment.