vtmanager

command module
v0.0.0-...-2dbc722 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

README

vtmanager

Tool for managing container based Vitess deployments for testing purposes

Install

go get github.com/mattlord/vtmanager

Usage

$ vtmanager -h
Manage local containerized Vitess deployments

Usage:
  vtmanager [command]

Available Commands:
  completion  generate the autocompletion script for the specified shell
  create      Create Vitess objects
  delete      Delete Vitess objects
  describe    Describe Vitess objects
  help        Help about any command
  list        List Vitess objects
  update      Update Vitess objects

Flags:
      --config string   config file (default is $HOME/.vtmanager.yaml)
  -h, --help            help for vtmanager
  -t, --toggle          Help message for toggle

Use "vtmanager [command] --help" for more information about a command.`

Example

$ vtmanager create cluster test -v 11.0.0 -m 8.0
Pulling up to date container images
⠏ done!
Waiting for mysqld on mysqld-test-1 to initialize and be ready to serve queries
⠼ done!
Waiting for mysqld on mysqld-test-2 to initialize and be ready to serve queries
⠋ done!

$ docker ps -a
CONTAINER ID   IMAGE                    COMMAND                  CREATED              STATUS                   PORTS                       NAMES
f3660205f351   vitess/lite:v11.0.0      "/vt/bin/vtgate -top…"   About a minute ago   Up About a minute                                    vtgate-test
23bbb86922eb   vitess/lite:v11.0.0      "/vt/bin/vttablet -t…"   About a minute ago   Up About a minute                                    vttablet-test-2
86cbeb0fa302   vitess/lite:v11.0.0      "/vt/bin/vttablet -t…"   About a minute ago   Up About a minute                                    vttablet-test-1
58c83bec0554   mysql/mysql-server:8.0   "/entrypoint.sh --gt…"   3 minutes ago        Up 3 minutes (healthy)   3306/tcp, 33060-33061/tcp   mysqld-test-2
fcaa1c6afdaf   mysql/mysql-server:8.0   "/entrypoint.sh --gt…"   4 minutes ago        Up 4 minutes (healthy)   3306/tcp, 33060-33061/tcp   mysqld-test-1
60ce63ac4314   vitess/lite:v11.0.0      "/vt/bin/vtctld -top…"   4 minutes ago        Up 4 minutes                                         vtctld-test
604d4e51ef73   bitnami/etcd:3.5.0       "/opt/bitnami/script…"   4 minutes ago        Up 4 minutes             2379-2380/tcp               etcd-test

$ docker exec -it vttablet-test-1 /vt/bin/vtctlclient -server=vtctld-test:15999 ListAllTablets
local-0000000001 unsharded_ks - replica vttablet-test-1:15800 mysqld-test-1:3306 [] <null>
local-0000000002 unsharded_ks - master vttablet-test-2:15800 mysqld-test-2:3306 [] 2021-09-05T19:54:35Z

$ docker exec -it mysqld-test-1 mysql -u root -h vtgate-test -P 15306 unsharded_ks -e "create table t1 (id int)"

$ docker exec -it mysqld-test-1 mysql -u root -h vtgate-test -P 15306 unsharded_ks -e "show tables"
+------------------------+
| Tables_in_unsharded_ks |
+------------------------+
| t1                     |
+------------------------+

$ vtmanager delete cluster test
Stopping and deleting containers for the test cluster
⠸ done!

$ docker ps -a
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES

Documentation

Overview

Copyright © 2021 Matt Lord <mattalord@gmail.com>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL