Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Install MySQL 8.4 on SLES 15 SP6 #1789

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
32 changes: 31 additions & 1 deletion apps/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,37 @@ var mysqlLegacyReplicationQueries = []sqlReceiverQuery{
metric_name: "mysql.replica.time_behind_source",
value_column: "Seconds_Behind_Master",
unit: "s",
description: "This field is an indication of how “late” the replica is.",
description: "This field is an indication of how late the replica is.",
data_type: "sum",
monotonic: "false",
value_type: "int",
attribute_columns: []string{},
static_attributes: map[string]string{},
},
},
},
// SHOW SLAVE STATUS is deprecated in MySQL 8.0.23, so we need to also somehow query SHOW REPLICA STATUS instead for later version support.
// The downside of this approach is now the receiver always has to make a query that will fail, which is not ideal.
// We should be open to other suggestions if there is an alternative to get this data.
{
algchoo marked this conversation as resolved.
Show resolved Hide resolved
query: `SHOW REPLICA STATUS`,
metrics: []sqlReceiverMetric{
{
metric_name: "mysql.replica.sql_delay",
value_column: "SQL_Delay",
unit: "s",
description: "The number of seconds that the replica must lag the source.",
data_type: "sum",
monotonic: "false",
value_type: "int",
attribute_columns: []string{},
static_attributes: map[string]string{},
},
{
metric_name: "mysql.replica.time_behind_source",
value_column: "Seconds_Behind_Source",
unit: "s",
description: "This field is an indication of how late the replica is.",
data_type: "sum",
monotonic: "false",
value_type: "int",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -578,14 +578,34 @@ receivers:
value_type: int
- attribute_columns: []
data_type: sum
description: This field is an indication of how late the replica is.
description: This field is an indication of how late the replica is.
metric_name: mysql.replica.time_behind_source
monotonic: "false"
static_attributes: {}
unit: s
value_column: Seconds_Behind_Master
value_type: int
sql: SHOW SLAVE STATUS
- metrics:
- attribute_columns: []
data_type: sum
description: The number of seconds that the replica must lag the source.
metric_name: mysql.replica.sql_delay
monotonic: "false"
static_attributes: {}
unit: s
value_column: SQL_Delay
value_type: int
- attribute_columns: []
data_type: sum
description: This field is an indication of how late the replica is.
metric_name: mysql.replica.time_behind_source
monotonic: "false"
static_attributes: {}
unit: s
value_column: Seconds_Behind_Source
value_type: int
sql: SHOW REPLICA STATUS
service:
pipelines:
metrics/default__pipeline_hostmetrics:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -547,14 +547,34 @@ receivers:
value_type: int
- attribute_columns: []
data_type: sum
description: This field is an indication of how late the replica is.
description: This field is an indication of how late the replica is.
metric_name: mysql.replica.time_behind_source
monotonic: "false"
static_attributes: {}
unit: s
value_column: Seconds_Behind_Master
value_type: int
sql: SHOW SLAVE STATUS
- metrics:
- attribute_columns: []
data_type: sum
description: The number of seconds that the replica must lag the source.
metric_name: mysql.replica.sql_delay
monotonic: "false"
static_attributes: {}
unit: s
value_column: SQL_Delay
value_type: int
- attribute_columns: []
data_type: sum
description: This field is an indication of how late the replica is.
metric_name: mysql.replica.time_behind_source
monotonic: "false"
static_attributes: {}
unit: s
value_column: Seconds_Behind_Source
value_type: int
sql: SHOW REPLICA STATUS
service:
pipelines:
metrics/default__pipeline_hostmetrics:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -622,14 +622,34 @@ receivers:
value_type: int
- attribute_columns: []
data_type: sum
description: This field is an indication of how late the replica is.
description: This field is an indication of how late the replica is.
metric_name: mysql.replica.time_behind_source
monotonic: "false"
static_attributes: {}
unit: s
value_column: Seconds_Behind_Master
value_type: int
sql: SHOW SLAVE STATUS
- metrics:
- attribute_columns: []
data_type: sum
description: The number of seconds that the replica must lag the source.
metric_name: mysql.replica.sql_delay
monotonic: "false"
static_attributes: {}
unit: s
value_column: SQL_Delay
value_type: int
- attribute_columns: []
data_type: sum
description: This field is an indication of how late the replica is.
metric_name: mysql.replica.time_behind_source
monotonic: "false"
static_attributes: {}
unit: s
value_column: Seconds_Behind_Source
value_type: int
sql: SHOW REPLICA STATUS
windowsperfcounters/iis:
collection_interval: 60s
perfcounters:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -622,14 +622,34 @@ receivers:
value_type: int
- attribute_columns: []
data_type: sum
description: This field is an indication of how late the replica is.
description: This field is an indication of how late the replica is.
metric_name: mysql.replica.time_behind_source
monotonic: "false"
static_attributes: {}
unit: s
value_column: Seconds_Behind_Master
value_type: int
sql: SHOW SLAVE STATUS
- metrics:
- attribute_columns: []
data_type: sum
description: The number of seconds that the replica must lag the source.
metric_name: mysql.replica.sql_delay
monotonic: "false"
static_attributes: {}
unit: s
value_column: SQL_Delay
value_type: int
- attribute_columns: []
data_type: sum
description: This field is an indication of how late the replica is.
metric_name: mysql.replica.time_behind_source
monotonic: "false"
static_attributes: {}
unit: s
value_column: Seconds_Behind_Source
value_type: int
sql: SHOW REPLICA STATUS
windowsperfcounters/iis:
collection_interval: 60s
perfcounters:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -578,14 +578,34 @@ receivers:
value_type: int
- attribute_columns: []
data_type: sum
description: This field is an indication of how late the replica is.
description: This field is an indication of how late the replica is.
metric_name: mysql.replica.time_behind_source
monotonic: "false"
static_attributes: {}
unit: s
value_column: Seconds_Behind_Master
value_type: int
sql: SHOW SLAVE STATUS
- metrics:
- attribute_columns: []
data_type: sum
description: The number of seconds that the replica must lag the source.
metric_name: mysql.replica.sql_delay
monotonic: "false"
static_attributes: {}
unit: s
value_column: SQL_Delay
value_type: int
- attribute_columns: []
data_type: sum
description: This field is an indication of how late the replica is.
metric_name: mysql.replica.time_behind_source
monotonic: "false"
static_attributes: {}
unit: s
value_column: Seconds_Behind_Source
value_type: int
sql: SHOW REPLICA STATUS
service:
pipelines:
metrics/default__pipeline_hostmetrics:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -547,14 +547,34 @@ receivers:
value_type: int
- attribute_columns: []
data_type: sum
description: This field is an indication of how late the replica is.
description: This field is an indication of how late the replica is.
metric_name: mysql.replica.time_behind_source
monotonic: "false"
static_attributes: {}
unit: s
value_column: Seconds_Behind_Master
value_type: int
sql: SHOW SLAVE STATUS
- metrics:
- attribute_columns: []
data_type: sum
description: The number of seconds that the replica must lag the source.
metric_name: mysql.replica.sql_delay
monotonic: "false"
static_attributes: {}
unit: s
value_column: SQL_Delay
value_type: int
- attribute_columns: []
data_type: sum
description: This field is an indication of how late the replica is.
metric_name: mysql.replica.time_behind_source
monotonic: "false"
static_attributes: {}
unit: s
value_column: Seconds_Behind_Source
value_type: int
sql: SHOW REPLICA STATUS
service:
pipelines:
metrics/default__pipeline_hostmetrics:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -622,14 +622,34 @@ receivers:
value_type: int
- attribute_columns: []
data_type: sum
description: This field is an indication of how late the replica is.
description: This field is an indication of how late the replica is.
metric_name: mysql.replica.time_behind_source
monotonic: "false"
static_attributes: {}
unit: s
value_column: Seconds_Behind_Master
value_type: int
sql: SHOW SLAVE STATUS
- metrics:
- attribute_columns: []
data_type: sum
description: The number of seconds that the replica must lag the source.
metric_name: mysql.replica.sql_delay
monotonic: "false"
static_attributes: {}
unit: s
value_column: SQL_Delay
value_type: int
- attribute_columns: []
data_type: sum
description: This field is an indication of how late the replica is.
metric_name: mysql.replica.time_behind_source
monotonic: "false"
static_attributes: {}
unit: s
value_column: Seconds_Behind_Source
value_type: int
sql: SHOW REPLICA STATUS
windowsperfcounters/iis:
collection_interval: 60s
perfcounters:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -622,14 +622,34 @@ receivers:
value_type: int
- attribute_columns: []
data_type: sum
description: This field is an indication of how late the replica is.
description: This field is an indication of how late the replica is.
metric_name: mysql.replica.time_behind_source
monotonic: "false"
static_attributes: {}
unit: s
value_column: Seconds_Behind_Master
value_type: int
sql: SHOW SLAVE STATUS
- metrics:
- attribute_columns: []
data_type: sum
description: The number of seconds that the replica must lag the source.
metric_name: mysql.replica.sql_delay
monotonic: "false"
static_attributes: {}
unit: s
value_column: SQL_Delay
value_type: int
- attribute_columns: []
data_type: sum
description: This field is an indication of how late the replica is.
metric_name: mysql.replica.time_behind_source
monotonic: "false"
static_attributes: {}
unit: s
value_column: Seconds_Behind_Source
value_type: int
sql: SHOW REPLICA STATUS
windowsperfcounters/iis:
collection_interval: 60s
perfcounters:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ VERSION_ID=${VERSION_ID%%.*}

sudo rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2023
sudo rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
sudo yum -y install https://repo.mysql.com/mysql80-community-release-el${VERSION_ID}.rpm
sudo yum -y install https://repo.mysql.com/mysql84-community-release-el${VERSION_ID}.rpm

if [ ${VERSION_ID} == 8 ]; then
sudo yum -y module disable mysql
Expand All @@ -14,6 +14,8 @@ sudo yum -y install mysql-community-server

echo "default-authentication-plugin=mysql_native_password" | sudo tee -a /etc/my.cnf

# !!!Even though everything appears to install OK, service will not start ATM
# For now not an issue until we actually enable mysql8.4 tests for RHEL family
sudo service mysqld start

password=$(sudo grep -oP '(?<=temporary password is generated for root@localhost: ).*$' /var/log/mysqld.log)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ set -e
sudo apt update
sudo apt install -y wget

wget --no-verbose https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.29-1_all.deb
wget --no-verbose https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.32-1_all.deb
sudo apt update
sudo debconf-set-selections <<< 'mysql-community-server mysql-server/default-auth-override select Use Legacy Authentication Method (Retain MySQL 5.x Compatibility)'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ sudo mysql --defaults-extra-file=config-user -S /var/run/mysqld/mysql2.sock -Bse
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;")
raw_status=$(sudo mysql --defaults-extra-file=config-user -S /var/run/mysqld/mysql2.sock -Bse "SHOW BINARY LOG STATUS;")
read -r logfile logpos <<< $raw_status

# Dump data from source into replica
Expand All @@ -46,4 +46,4 @@ sudo mysql --defaults-extra-file=config-user -Bse "SET GLOBAL long_query_time =
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"
sudo mysql --defaults-extra-file=config-user -Bse "select table_catalog, table_schema, table_name from information_schema.tables"
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,22 @@ minimum_supported_agent_version:
supported_operating_systems: linux
platforms_to_skip:
# MySQL is not currently supported on various distros.
- ml-images:common-gpu-debian-11-py310
- debian-cloud:debian-11
- debian-cloud:debian-12
- debian-cloud:debian-12-arm64
- rocky-linux-cloud:rocky-linux-8
- rocky-linux-cloud:rocky-linux-9
- rocky-linux-cloud:rocky-linux-9-arm64
- ubuntu-os-cloud:ubuntu-2004-lts
- ubuntu-os-cloud:ubuntu-2004-lts-arm64
- ubuntu-os-cloud:ubuntu-2204-lts
- ubuntu-os-cloud:ubuntu-2204-lts-arm64
- ubuntu-os-cloud:ubuntu-2404-lts-amd64
- ubuntu-os-cloud:ubuntu-2404-lts-arm64
- suse-cloud:sles-12
- suse-cloud:sles-15-arm64
supported_app_version: ["5.7", "8.0"]
supported_app_version: ["5.7", "8.0", "8.4"]
expected_metrics:
- type: workload.googleapis.com/mysql.buffer_pool_data_pages
value_type: INT64
Expand Down
Loading
Loading