-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
examples: helm and local matched commands
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
- Loading branch information
Showing
4 changed files
with
56 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,51 @@ | ||
# Local Vitess Cluster | ||
# Instructions | ||
|
||
This directory contains example scripts to bring up a Vitess cluster on your | ||
local machine, which may be useful for experimentation. These scripts can | ||
also serve as a starting point for configuring Vitess into your preferred | ||
deployment strategy or toolset. | ||
Detailed instructions for running this example can be found at https://vitess.io. | ||
This document contains the summary of the commands to be run. | ||
|
||
See the [Run Vitess Locally](https://vitess.io/docs/tutorials/local/) | ||
tutorial ("Start a Vitess cluster" section) for instructions on using these scripts. | ||
|
||
``` | ||
# Bring up initial cluster and commerce keyspace | ||
./101_initial_cluster.sh | ||
# Setup aliases | ||
source alias.source | ||
# Insert and verify data | ||
mysql < ../common/insert_commerce_data.sql | ||
mysql --table < ../common/select_commerce_data.sql | ||
# Bring up customer keyspace | ||
./201_customer_tablets.sh | ||
# Initiate move tables | ||
vclient MoveTables -workflow=commerce2customer commerce customer '{"customer":{}, "corder":{}}' | ||
# Cut-over | ||
vclient SwitchReads -tablet_type=rdonly customer.commerce2customer | ||
vclient SwitchReads -tablet_type=replica customer.commerce2customer | ||
vclient SwitchWrites customer.commerce2customer | ||
# Clean-up | ||
vclient SetShardTabletControl -blacklisted_tables=customer,corder -remove commerce/0 rdonly | ||
vclient SetShardTabletControl -blacklisted_tables=customer,corder -remove commerce/0 replica | ||
vclient SetShardTabletControl -blacklisted_tables=customer,corder -remove commerce/0 master | ||
vclient ApplyRoutingRules -rules='{}' | ||
# Prepare for resharding | ||
./301_customer_sharded.sh | ||
./302_new_shards.sh | ||
# Reshard | ||
vclient Reshard customer.cust2cust '0' '-80,80-' | ||
vclient SwitchReads -tablet_type=rdonly customer.cust2cust | ||
vclient SwitchReads -tablet_type=replica customer.cust2cust | ||
vclient SwitchWrites customer.cust2cust | ||
# Down shard 0 | ||
./306_down_shard_0.sh | ||
vclient DeleteShard -recursive customer/0 | ||
# Down cluster | ||
./401_teardown.sh | ||
``` |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
echo "Setting alias mysql to mysql -h 127.0.0.1 -P 15306" | ||
alias mysql="mysql -h 127.0.0.1 -P 15306" | ||
echo "Setting alias vclient to vtctlclient -server localhost:15999 -log_dir $VTDATAROOT/tmp -alsologtostderr" | ||
alias vclient="vtctlclient -server localhost:15999 -log_dir $VTDATAROOT/tmp -alsologtostderr" |