-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds MySQL 8.4 3rd Party Integration test
- Loading branch information
1 parent
a0a01df
commit 0bbba5f
Showing
11 changed files
with
674 additions
and
37 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
File renamed without changes.
File renamed without changes.
39 changes: 39 additions & 0 deletions
39
integration_test/third_party_apps_test/applications/mysql8.0/enable
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,39 @@ | ||
# Configures Ops Agent to collect telemetry from the app and restart Ops Agent. | ||
|
||
set -e | ||
|
||
# Create a back up of the existing file so existing configurations are not lost. | ||
sudo cp /etc/google-cloud-ops-agent/config.yaml /etc/google-cloud-ops-agent/config.yaml.bak | ||
|
||
# Configure the Ops Agent. | ||
sudo tee /etc/google-cloud-ops-agent/config.yaml > /dev/null << EOF | ||
metrics: | ||
receivers: | ||
mysql: | ||
type: mysql | ||
username: root | ||
password: Ss123%321 | ||
service: | ||
pipelines: | ||
mysql: | ||
receivers: | ||
- mysql | ||
logging: | ||
receivers: | ||
mysql_error: | ||
type: mysql_error | ||
mysql_general: | ||
type: mysql_general | ||
mysql_slow: | ||
type: mysql_slow | ||
service: | ||
pipelines: | ||
mysql: | ||
receivers: | ||
- mysql_error | ||
- mysql_general | ||
- mysql_slow | ||
EOF | ||
|
||
sudo service google-cloud-ops-agent restart | ||
sleep 60 |
49 changes: 49 additions & 0 deletions
49
integration_test/third_party_apps_test/applications/mysql8.0/exercise
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,49 @@ | ||
set -e | ||
|
||
cat <<EOF > config-user | ||
[client] | ||
user=root | ||
password='Ss123%321' | ||
EOF | ||
|
||
# initialize and start replation source | ||
sudo mysqld --defaults-group-suffix=2 --initialize | ||
nohup sudo mysqld --defaults-group-suffix=2 2>/dev/null >/dev/null </dev/null & | ||
# give it time to start, since we put it in the background | ||
sleep 10 | ||
|
||
# grab root password for replication source | ||
password=$(sudo grep -oP '(?<=temporary password is generated for root@localhost: ).*$' /var/log/mysql/error2.log) | ||
cat <<EOF > config-user-2 | ||
[client] | ||
user=root | ||
password='$password' | ||
EOF | ||
|
||
sudo mysql --defaults-extra-file=config-user-2 -S /var/run/mysqld/mysql2.sock -Bse "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Ss123%321'; FLUSH PRIVILEGES;" --connect-expired-password | ||
|
||
# Create replication user | ||
sudo mysql --defaults-extra-file=config-user -S /var/run/mysqld/mysql2.sock -Bse "CREATE USER 'repl'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';" | ||
sudo mysql --defaults-extra-file=config-user -S /var/run/mysqld/mysql2.sock -Bse "GRANT REPLICATION SLAVE ON *.* TO 'repl'@'localhost';" | ||
|
||
# Dump data from replica source | ||
sudo mysqldump --defaults-extra-file=config-user -S /var/run/mysqld/mysql2.sock --all-databases --source-data > /tmp/dbdump.sql | ||
|
||
# Capture status to seed replica | ||
raw_status=$(sudo mysql --defaults-extra-file=config-user -S /var/run/mysqld/mysql2.sock -Bse "SHOW MASTER STATUS;") | ||
read -r logfile logpos <<< $raw_status | ||
|
||
# Dump data from source into replica | ||
sudo mysql --defaults-extra-file=config-user < /tmp/dbdump.sql | ||
|
||
# Configure replication | ||
sudo mysql --defaults-extra-file=config-user -Bse "STOP REPLICA;" | ||
sudo mysql --defaults-extra-file=config-user -Bse "CHANGE REPLICATION SOURCE TO SOURCE_HOST='localhost', SOURCE_USER='repl', SOURCE_PORT=3307, SOURCE_PASSWORD='password', SOURCE_LOG_FILE='$logfile', SOURCE_LOG_POS=$logpos;" | ||
sudo mysql --defaults-extra-file=config-user -Bse "START REPLICA;" | ||
|
||
sudo mysql --defaults-extra-file=config-user -Bse "SET GLOBAL log_slow_extra = 'ON'" | ||
sudo mysql --defaults-extra-file=config-user -Bse "SET GLOBAL long_query_time = 0" | ||
sudo mysql --defaults-extra-file=config-user -Bse "SET GLOBAL slow_query_log = 1" | ||
sudo mysql --defaults-extra-file=config-user -Bse "SET GLOBAL general_log = 'ON'" | ||
|
||
sudo mysql --defaults-extra-file=config-user -Bse "select table_catalog, table_schema, table_name from information_schema.tables" |
17 changes: 17 additions & 0 deletions
17
integration_test/third_party_apps_test/applications/mysql8.0/features.yaml
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,17 @@ | ||
features: | ||
- feature: receivers:mysql | ||
module: metrics | ||
key: "[0].enabled" | ||
value: true | ||
- feature: receivers:mysql_error | ||
module: logging | ||
key: "[0].enabled" | ||
value: true | ||
- feature: receivers:mysql_general | ||
module: logging | ||
key: "[1].enabled" | ||
value: true | ||
- feature: receivers:mysql_slow | ||
module: logging | ||
key: "[2].enabled" | ||
value: true |
Oops, something went wrong.