0

我管理一个 kubernetes 集群,我最近在其中添加了一个 ProxySQL 来处理 Master 和 Read-Replica 之间的查询路由。一开始它似乎运行良好,但几天后它在收到高流量时崩溃。导致超过 30 分钟的停机时间,我没有专业知识来弄清楚为什么会发生这种情况。Master 和 Read-Replica 托管在 Google 上,它是一个 Mysql 8.0。

崩溃发生时的 ProxySQL 日志: ProxySQL 日志

ProxySQL 再次出现时的日志: ProxySQL 再次登录

我正在使用的 docker 镜像:sevennines/proxysql:1.4.12 配置:

datadir="/var/lib/proxysql"

admin_variables=
{
    admin_credentials="USER:PASS"
    mysql_ifaces="0.0.0.0:6032"
    refresh_interval=2000
}

mysql_variables=
{
    threads=4
    max_connections=2048
    default_query_delay=0
    default_query_timeout=36000000
    have_compress=true
    poll_timeout=2000
    interfaces="0.0.0.0:6033"
    default_schema="information_schema"
    stacksize=1048576
    server_version="8.0"
    connect_timeout_server=10000
    monitor_history=60000
    monitor_connect_interval=200000
    monitor_ping_interval=200000
    ping_interval_server_msec=10000
    ping_timeout_server=200
    commands_stats=true
    sessions_sort=true
    monitor_username="USER"
    monitor_password="PASS"
}

mysql_replication_hostgroups =
(
    { writer_hostgroup=10, reader_hostgroup=20, comment="MySQL Replication 8.0" }
)

mysql_servers =
(
    { address="10.32.224.4", port=3306, hostgroup=10, max_connections=100 }, # MASTER
    { address="10.32.224.4", port=3306, hostgroup=20, max_connections=100 }, # MASTER
    { address="10.32.224.44", port=3306, hostgroup=20, max_connections=100, weight=10, max_replication_lag=5} # REPLICA
)

mysql_users =
(
    { username = "USER", password = "PASS", default_hostgroup = 10, active = 1 },
    { username = "USER", password = "PASS", default_hostgroup = 10, active = 1 },
    { username = "USER", password = "PASS", default_hostgroup = 10, active = 1 }
)

mysql_query_rules =
(
    {
        rule_id=100
        active=1
        match_pattern="^SELECT .* FOR UPDATE"
        destination_hostgroup=10
        apply=1
    },
    {
        rule_id=200
        active=1
        match_pattern="^SELECT .*"
        destination_hostgroup=20
        apply=1
    },
    {
        rule_id=300
        active=1
        match_pattern=".*"
        destination_hostgroup=10
        apply=1
    }
)

4

0 回答 0