Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

Commit

Permalink
examples: vclient->vtctlclient
Browse files Browse the repository at this point in the history
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
  • Loading branch information
sougou committed Apr 15, 2020
1 parent 6dee503 commit d671c55
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 33 deletions.
28 changes: 14 additions & 14 deletions examples/helm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This document contains the summary of the commands to be run.

```
# Start minikube
minikube start --kubernetes-version v1.15.0 --cpus=4 --memory=5000
minikube start --cpus=4 --memory=8000
# Bring up initial cluster and commerce keyspace
helm install vitess ../../helm/vitess -f 101_initial_cluster.yaml
Expand All @@ -22,30 +22,30 @@ mysql --table < ../common/select_commerce_data.sql
helm upgrade vitess ../../helm/vitess/ -f 201_customer_tablets.yaml
# Initiate move tables
vclient MoveTables -workflow=commerce2customer commerce customer '{"customer":{}, "corder":{}}'
vtctlclient 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
vtctlclient SwitchReads -tablet_type=rdonly customer.commerce2customer
vtctlclient SwitchReads -tablet_type=replica customer.commerce2customer
vtctlclient 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='{}'
vtctlclient SetShardTabletControl -blacklisted_tables=customer,corder -remove commerce/0 rdonly
vtctlclient SetShardTabletControl -blacklisted_tables=customer,corder -remove commerce/0 replica
vtctlclient SetShardTabletControl -blacklisted_tables=customer,corder -remove commerce/0 master
vtctlclient ApplyRoutingRules -rules='{}'
# Prepare for resharding
helm upgrade vitess ../../helm/vitess/ -f 301_customer_sharded.yaml
helm upgrade vitess ../../helm/vitess/ -f 302_new_shards.yaml
# 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
vtctlclient Reshard customer.cust2cust '0' '-80,80-'
vtctlclient SwitchReads -tablet_type=rdonly customer.cust2cust
vtctlclient SwitchReads -tablet_type=replica customer.cust2cust
vtctlclient SwitchWrites customer.cust2cust
# Down shard 0
helm upgrade vitess ../../helm/vitess/ -f 306_down_shard_0.yaml
vclient DeleteShard -recursive customer/0
vtctlclient DeleteShard -recursive customer/0
```
8 changes: 4 additions & 4 deletions examples/helm/alias.source
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ function vsetmysql() {
alias mysql="mysql -h $vhost -P $vport"
}

function vsetvclient() {
function vsetvtctlclient() {
vhostport vtctld
if [ -z $vport ]; then
echo "Error: failed to: obtain [host:port] minikube or kubectl."
return 1
fi
echo "Setting alias vclient to vtctlclient -server=$vhost:$vport"
alias vclient="vtctlclient -server=$vhost:$vport"
echo "Setting alias vtctlclient to vtctlclient -server=$vhost:$vport"
alias vtctlclient="vtctlclient -server=$vhost:$vport"
}

vsetmysql
vsetvclient
vsetvtctlclient
26 changes: 13 additions & 13 deletions examples/local/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,32 @@ mysql --table < ../common/select_commerce_data.sql
./201_customer_tablets.sh
# Initiate move tables
vclient MoveTables -workflow=commerce2customer commerce customer '{"customer":{}, "corder":{}}'
vtctlclient 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
vtctlclient SwitchReads -tablet_type=rdonly customer.commerce2customer
vtctlclient SwitchReads -tablet_type=replica customer.commerce2customer
vtctlclient 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='{}'
vtctlclient SetShardTabletControl -blacklisted_tables=customer,corder -remove commerce/0 rdonly
vtctlclient SetShardTabletControl -blacklisted_tables=customer,corder -remove commerce/0 replica
vtctlclient SetShardTabletControl -blacklisted_tables=customer,corder -remove commerce/0 master
vtctlclient 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
vtctlclient Reshard customer.cust2cust '0' '-80,80-'
vtctlclient SwitchReads -tablet_type=rdonly customer.cust2cust
vtctlclient SwitchReads -tablet_type=replica customer.cust2cust
vtctlclient SwitchWrites customer.cust2cust
# Down shard 0
./306_down_shard_0.sh
vclient DeleteShard -recursive customer/0
vtctlclient DeleteShard -recursive customer/0
# Down cluster
./401_teardown.sh
Expand Down
4 changes: 2 additions & 2 deletions examples/local/alias.source
Original file line number Diff line number Diff line change
@@ -1,4 +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"
echo "Setting alias vtctlclient to vtctlclient -server localhost:15999 -log_dir $VTDATAROOT/tmp -alsologtostderr"
alias vtctlclient="vtctlclient -server localhost:15999 -log_dir $VTDATAROOT/tmp -alsologtostderr"

0 comments on commit d671c55

Please sign in to comment.