-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #102 from SeanMooney/nova-db-split
extend mariadb_copy to split out nova cell1 into a seperate db
- Loading branch information
Showing
11 changed files
with
208 additions
and
97 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
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
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
{{ shell_header }} | ||
{{ oc_header }} | ||
{{ mariadb_copy_shell_vars }} | ||
|
||
mkdir -p {{ mariadb_copy_tmp_dir }} | ||
cd {{ mariadb_copy_tmp_dir }} | ||
|
||
podman run -i --rm --userns=keep-id -u $UID -v $PWD:$PWD:z,rw -w $PWD $MARIADB_IMAGE bash <<EOF | ||
# Note we do not want to dump the information and performance schema tables so we filter them | ||
mysql -h ${SOURCE_MARIADB_IP} -u root "-p${SOURCE_DB_ROOT_PASSWORD}" -N -e 'show databases' | grep -E -v 'schema|mysql' | while read dbname; do | ||
echo "Dumping \${dbname}" | ||
mysqldump -h $SOURCE_MARIADB_IP -uroot "-p$SOURCE_DB_ROOT_PASSWORD" \ | ||
--single-transaction --complete-insert --skip-lock-tables --lock-tables=0 \ | ||
"\${dbname}" > "\${dbname}".sql | ||
done | ||
EOF |
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,14 @@ | ||
{{ shell_header }} | ||
{{ oc_header }} | ||
{{ mariadb_copy_shell_vars }} | ||
oc run mariadb-client --image $MARIADB_IMAGE -i --rm --restart=Never -- \ | ||
mysql -h "${PODIFIED_MARIADB_IP}" -uroot "-p${PODIFIED_DB_ROOT_PASSWORD}" -e 'SHOW databases;' \ | ||
| grep keystone | ||
# ensure neutron db is renamed from ovs_neutron | ||
oc run mariadb-client --image $MARIADB_IMAGE -i --rm --restart=Never -- \ | ||
mysql -h "${PODIFIED_MARIADB_IP}" -uroot "-p${PODIFIED_DB_ROOT_PASSWORD}" -e 'SHOW databases;' \ | ||
| grep neutron | ||
# ensure nova cell1 db is extracted to a separate db server and renamed from nova to nova_cell1 | ||
oc run mariadb-client --image $MARIADB_IMAGE -i --rm --restart=Never -- \ | ||
mysql -h "${PODIFIED_CELL1_MARIADB_IP}" -uroot "-p${PODIFIED_DB_ROOT_PASSWORD}" -e 'SHOW databases;' \ | ||
| grep nova_cell1 |
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,16 @@ | ||
#!/bin/bash | ||
{{ shell_header }} | ||
{{ oc_header }} | ||
{{ mariadb_copy_shell_vars }} | ||
|
||
# Test connection to the original DB (show databases) | ||
podman run -i --rm --userns=keep-id -u $UID -v $PWD:$PWD:z,rw -w $PWD $MARIADB_IMAGE \ | ||
mysql -h "$SOURCE_MARIADB_IP" -uroot "-p$SOURCE_DB_ROOT_PASSWORD" -e 'SHOW databases;' | ||
# Run mysqlcheck on the original DB to look for things that are not OK | ||
podman run -i --rm --userns=keep-id -u $UID -v $PWD:$PWD:z,rw -w $PWD $MARIADB_IMAGE \ | ||
mysqlcheck --all-databases -h $SOURCE_MARIADB_IP -u root "-p$SOURCE_DB_ROOT_PASSWORD" | ||
# Test connection to podified DBs (show databases) | ||
oc run mariadb-client --image $MARIADB_IMAGE -i --rm --restart=Never -- \ | ||
mysql -h "$PODIFIED_MARIADB_IP" -uroot "-p$PODIFIED_DB_ROOT_PASSWORD" -e 'SHOW databases;' | ||
oc run mariadb-client --image $MARIADB_IMAGE -i --rm --restart=Never -- \ | ||
mysql -h "$PODIFIED_CELL1_MARIADB_IP" -uroot "-p$PODIFIED_DB_ROOT_PASSWORD" -e 'SHOW databases;' |
Oops, something went wrong.