vtorc (experimental)
vtorc
is a fork of the Orchestrator customized to run as a Vitess component. It is available as an experimental feature. It still needs thorough testing, and more features need to be added.
In order to configure vtorc
, you have to make the following changes to vttablet
:
- Add
--disable_active_reparents=true
: This part will prevent vttablet from fixing replication, and will rely on vtorc instead.
As mentioned before, bringing up vtorc
also lets you avoid performing the InitShardPrimary
step.
vtorc
requires a config file to be launched. A sample is available here:
{
"MySQLTopologyUser": "orc_client_user",
"MySQLTopologyPassword": "orc_client_user_password",
"MySQLReplicaUser": "vt_repl",
"MySQLReplicaPassword": "",
"RecoveryPeriodBlockSeconds": 5
}
The orc_client_user
and its password are in the init_db.sql
file. It is highly recommended that you change the password to a more secure value. The same recommendation holds for the vt_repl
user.
In production, you may also want to set “Debug” to false, and use a higher value for RecoveryPeriodBlockSeconds
(default 3600).
You can bring vtorc
using the following invocation:
vtorc <topo_flags> \
--log_dir=${VTDATAROOT}/tmp \
--config orc_config.json \
--orc_web_dir ${VTROOT}/web/orchestrator
orc_web_dir
must point at the contents of the orchestrator web files. The source can be found here.
Bringing up vtorc
should immediately cause a primary to be elected among the vttablets that have come up.
You can optionally add a clusters_to_watch
flag that contains a comma separated list of keyspaces or keyspace/shard
values. If specified, vtorc
will manage only those clusters.
You can perform planned failovers using vtorc
. Additionally, vtorc
will also perform failure detection with automatic failovers while honoring the durability policies.
Other Orchestrator settings may also be carefully added to the config. However, some of them may not be compatible with Vitess. These will be documented soon.
Known Issues
- VTOrc doesn't discover the tablets of a keyspace if the durability policy doesn't exist in the topo server when it comes up. This can be resolved by restarting VTOrc.