Skip to content

Instantly share code, notes, and snippets.

@sougou
Created July 13, 2018 04:19
Show Gist options
  • Save sougou/e6259e958b5707d5888a5ac406418cc3 to your computer and use it in GitHub Desktop.
Save sougou/e6259e958b5707d5888a5ac406418cc3 to your computer and use it in GitHub Desktop.
Local Example shortcuts
./vtgate-down.sh
./sharded-vttablet-down.sh
./vttablet-down.sh
./vtctld-down.sh
./zk-down.sh
rm -r $VTDATAROOT/*
./zk-up.sh
./vtctld-up.sh
./vttablet-up.sh
sleep 10s
./lvtctl.sh InitShardMaster -force test_keyspace/0 test-100
./lvtctl.sh ApplySchema -sql "$(cat create_test_table.sql)" test_keyspace
./vtgate-up.sh
./lvtctl.sh ApplyVSchema -vschema "$(cat vschema.json)" test_keyspace
./sharded-vttablet-up.sh
sleep 10s
./lvtctl.sh InitShardMaster -force test_keyspace/-80 test-0000000200
./lvtctl.sh InitShardMaster -force test_keyspace/80- test-0000000300
./lvtctl.sh CopySchemaShard test_keyspace/0 test_keyspace/-80
./lvtctl.sh CopySchemaShard test_keyspace/0 test_keyspace/80-
./sharded-vtworker.sh SplitClone test_keyspace/0
./lvtctl.sh ApplyVSchema -vschema '{"tables": {"messages":{}}}' test_keyspace
./lvtctl.sh CreateKeyspace --served_from 'master:test_keyspace,replica:test_keyspace,rdonly:test_keyspace' target
./vvttablet-up.sh
sleep 10s
./lvtctl.sh InitShardMaster -force target/0 test-0000000200
./lvtctl.sh CopySchemaShard test_keyspace/0 target/0
./sharded-vtworker.sh VerticalSplitClone --tables messages target/0
KEYSPACE=target SHARD=0 UID_BASE=200 ./vttablet-up.sh "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment