зеркало из https://github.com/github/vitess-gh.git
e18bec45ca
* feat: add hyperlink using fqdn in vtgates Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: provide correct vtgate web address in examples Signed-off-by: Manan Gupta <manan@planetscale.com> * refactor: fix prettier errors Signed-off-by: Manan Gupta <manan@planetscale.com> Signed-off-by: Manan Gupta <manan@planetscale.com> |
||
---|---|---|
.. | ||
backups | ||
scripts | ||
vtadmin | ||
vtexplain | ||
vtorc | ||
101_initial_cluster.sh | ||
201_customer_tablets.sh | ||
201_newkeyspace_tablets.sh | ||
202_move_tables.sh | ||
203_switch_reads.sh | ||
204_switch_writes.sh | ||
205_clean_commerce.sh | ||
301_customer_sharded.sh | ||
302_new_shards.sh | ||
303_reshard.sh | ||
304_switch_reads.sh | ||
305_switch_writes.sh | ||
306_down_shard_0.sh | ||
307_delete_shard_0.sh | ||
401_teardown.sh | ||
README.md | ||
ceph_backup_config.json | ||
create_commerce_schema.sql | ||
create_commerce_seq.sql | ||
create_customer_sharded.sql | ||
create_test_table.sql | ||
drop_commerce_tables.sql | ||
env.sh | ||
grpc_static_auth.json | ||
grpc_static_client_auth.json | ||
mysql_auth_server_static_creds.json | ||
topo-etcd2.sh | ||
topo-k8s.sh | ||
topo-zk2.sh | ||
vschema.json | ||
vschema_commerce_initial.json | ||
vschema_commerce_seq.json | ||
vschema_customer_sharded.json | ||
vstream_client.go |
README.md
Instructions
Detailed instructions for running this example can be found at https://vitess.io. This document contains the summary of the commands to be run.
# Setup environment and aliases
source env.sh
# Bring up initial cluster and commerce keyspace
./101_initial_cluster.sh
# 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
vtctlclient MoveTables -- --source commerce --tables 'customer,corder' Create customer.commerce2customer
# Validate
vtctlclient VDiff customer.commerce2customer
# Cut-over
vtctlclient MoveTables -- --tablet_types=rdonly,replica SwitchTraffic customer.commerce2customer
vtctlclient MoveTables -- --tablet_types=primary SwitchTraffic customer.commerce2customer
# Clean-up
vtctlclient MoveTables Complete customer.commerce2customer
# Prepare for resharding
./301_customer_sharded.sh
./302_new_shards.sh
# Reshard
vtctlclient Reshard -- --source_shards '0' --target_shards '-80,80-' Create customer.cust2cust
# Validate
vtctlclient VDiff customer.cust2cust
# Cut-over
vtctlclient Reshard -- --tablet_types=rdonly,replica SwitchTraffic customer.cust2cust
vtctlclient Reshard -- --tablet_types=primary SwitchTraffic customer.cust2cust
# Down shard 0
./306_down_shard_0.sh
vtctlclient DeleteShard -- --recursive customer/0
# Down cluster
./401_teardown.sh