VtCompose - Local Vitess Cluster (Docker) Auto-Setup #5262
Merged
sougou merged 4 commits intovitessio:masterfrom Oct 5, 2019
Merged
VtCompose - Local Vitess Cluster (Docker) Auto-Setup #5262sougou merged 4 commits intovitessio:masterfrom
sougou merged 4 commits intovitessio:masterfrom
Conversation
afb2a84 to
e71636c
Compare
…ble sql files and base vtcompose program Signed-off-by: JavierR14 <javier@squareup.com>
Signed-off-by: JavierR14 <javier@squareup.com>
…d through flags Signed-off-by: JavierR14 <javier@squareup.com>
e71636c to
7c0abea
Compare
…ble name Signed-off-by: JavierR14 <javier@squareup.com>
7c0abea to
5a27255
Compare
sougou
approved these changes
Oct 5, 2019
| gRpcPort = flag.String("gRpcPort", "15999", "gRPC port to be used") | ||
| mySqlPort = flag.String("mySqlPort", "15306", "mySql port to be used") | ||
| cell = flag.String("cell", "test", "Vitess Cell name") | ||
| keyspaceData = flag.String("keyspaces", "test_keyspace:2:1:create_messages.sql,create_tokens.sql unsharded_keyspace:0:0:create_dinosaurs.sql,create_eggs.sql", "List of keyspace_name:num_of_shards:num_of_replica_tablets:schema_files:<optional>lookup_keyspace_name seperated by ' '") |
Contributor
There was a problem hiding this comment.
This is a good start. I think this metadata may better be covered by a yaml file, mainly for the sake of uniformity. It would be ideal if we can standardize on the expected fields in the file. I have a start here: https://github.com/vitessio/vitess/blob/master/examples/helm/101_initial_cluster.yaml, which is for the helm charts. We'll also have to look at the operator CRDs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We wanted a way to easily set up a local vitess cluster on Docker without having to apply vschemas and do a lot of manual work.
With VtCompose.go, it programatically builds a vschema.json file (per keyspace), a schema_file.sql (per keyspace), and a docker_compose.yml file based on the specifications in the flags.
The meaty part of this is the flag
keyspaceDatawhere you specify each keyspace, the number of shards for the keyspace, the number of replica tablets you would like, the schema files to be loaded to that keyspace, and the name of the related lookup keyspace if there is one.There are default values so it is possible to run it without specifying any flags and you will have everything you need to run
docker-compose up -dwith simply doinggo run vtcompose.goVtCompose Supports multiple keyspaces, multiple shards, lookup tables, different types of tablets, and any number of tables.
Updated the Readme with instructions and explanations of the flags.