add mysql helper script to local example, remove calls to mysql from scripts, they will be executed by the user using lmysql.sh

Signed-off-by: deepthi <deepthi@planetscale.com>
This commit is contained in:
deepthi 2018-12-07 11:16:37 -08:00
Родитель 06cb4f4ab7
Коммит 2be922a20c
11 изменённых файлов: 46 добавлений и 26 удалений

Просмотреть файл

@ -46,10 +46,5 @@ sleep 15
# start vtgate
CELL=zone1 $script_root/vtgate-up.sh
sleep 5
# insert rows into the tables. we are actually connecting to vtgate here, it will route the sql correctly
mysql -h 127.0.0.1 -P 15306 -u mysql_user < $script_root/../common/insert_commerce_data.sql
mysql -h 127.0.0.1 -P 15306 -u mysql_user --table < $script_root/../common/select_commerce_data.sql
disown -a

Просмотреть файл

@ -30,8 +30,4 @@ $VTROOT/bin/vtworker \
-use_v3_resharding_mode \
VerticalSplitClone -min_healthy_rdonly_tablets=1 -tables=customer,corder customer/0
sleep 2
# check that customer and order data has been copied to customer keyspace
mysql -h 127.0.0.1 -P 15306 -u mysql_user --table < $script_root/../common/select_customer0_data.sql
disown -a

Просмотреть файл

@ -23,7 +23,4 @@ script_root=`dirname "${BASH_SOURCE}"`
./lvtctl.sh MigrateServedFrom customer/0 master
# customer and order data cannot be accessed from commerce keyspace
mysql -h 127.0.0.1 -P 15306 -u mysql_user --table < $script_root/../common/select_commerce_data.sql
disown -a

Просмотреть файл

@ -26,7 +26,4 @@ script_root=`dirname "${BASH_SOURCE}"`
./lvtctl.sh SetShardTabletControl -blacklisted_tables=customer,corder -remove commerce/0 replica
./lvtctl.sh SetShardTabletControl -blacklisted_tables=customer,corder -remove commerce/0 master
# customer and order tables have now been deleted from commerce keyspace
mysql -h 127.0.0.1 -P 15306 -u mysql_user --table < $script_root/../common/select_commerce_data.sql
disown -a

Просмотреть файл

@ -29,9 +29,4 @@ sleep 15
./lvtctl.sh CopySchemaShard customer/0 customer/-80
./lvtctl.sh CopySchemaShard customer/0 customer/80-
sleep 15
# new tables are empty
mysql -h 127.0.0.1 -P 15306 -u mysql_user --table < $script_root/../common/select_customer-80_data.sql
mysql -h 127.0.0.1 -P 15306 -u mysql_user --table < $script_root/../common/select_customer80-_data.sql
disown -a

Просмотреть файл

@ -23,5 +23,4 @@ script_root=`dirname "${BASH_SOURCE}"`
./lvtctl.sh MigrateServedTypes customer/0 rdonly
./lvtctl.sh MigrateServedTypes customer/0 replica
disown -a

Просмотреть файл

@ -23,7 +23,5 @@ script_root=`dirname "${BASH_SOURCE}"`
./lvtctl.sh MigrateServedTypes customer/0 master
# data has been copied over to shards, and databases for the new shards are now available
mysql -h 127.0.0.1 -P 15306 -u mysql_user --table < $script_root/../common/select_customer-80_data.sql
mysql -h 127.0.0.1 -P 15306 -u mysql_user --table < $script_root/../common/select_customer80-_data.sql
disown -a

4
examples/local/306_down_shard_0.sh Executable file → Normal file
Просмотреть файл

@ -14,12 +14,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# this script deletes the old shard 0 which has been replaced by 2 shards
# this script brings down the tablets for customer/0 keyspace
set -e
script_root=`dirname "${BASH_SOURCE}"`
./lvtctl.sh DeleteShard -recursive customer/0
CELL=zone1 UID_BASE=100 $script_root/vttablet-down.sh
disown -a

Просмотреть файл

@ -0,0 +1,25 @@
#!/bin/bash
# Copyright 2018 The Vitess Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# this script deletes the old shard 0 which has been replaced by 2 shards
set -e
script_root=`dirname "${BASH_SOURCE}"`
./lvtctl.sh DeleteShard -recursive customer/0
disown -a

Просмотреть файл

@ -24,7 +24,6 @@ set -e
script_root=`dirname "${BASH_SOURCE}"`
./vtgate-down.sh
CELL=zone1 UID_BASE=100 $script_root/vttablet-down.sh
CELL=zone1 UID_BASE=200 $script_root/vttablet-down.sh
CELL=zone1 UID_BASE=300 $script_root/vttablet-down.sh
CELL=zone1 UID_BASE=400 $script_root/vttablet-down.sh

19
examples/local/lmysql.sh Executable file
Просмотреть файл

@ -0,0 +1,19 @@
#!/bin/bash
# Copyright 2018 The Vitess Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This is a convenience script to run mysql client against the local vtgate.
mysql -h 127.0.0.1 -P 15306 -u mysql_user