首页 > 数据库 >2.配置proxysql.conf进行读写分离

2.配置proxysql.conf进行读写分离

时间:2023-03-15 14:24:08浏览次数:33  
标签:monitor max 读写 proxysql timeout hostgroup conf mysql active

datadir="/var/lib/proxysql"

admin_variables=
{
  admin_credentials="admin:admin"
  mysql_ifaces="0.0.0.0:6032"
  refresh_interval=2000
  web_enabled=true
  web_port=6080
  stats_credentials="stats:admin"
}

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;/tmp/proxysql.sock"
  default_schema="information_schema"
  stacksize=1048576
  server_version="8.0.25"
  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="monitor"
  monitor_password="9!qpzs.C0m"
  monitor_galera_healthcheck_interval=2000
  monitor_galera_healthcheck_timeout=800
  set_query_lock_on_hostgroup=0
}

mysql_galera_hostgroups =
(
  {
    writer_hostgroup=10
    backup_writer_hostgroup=20
    reader_hostgroup=30
    offline_hostgroup=9999
    max_writers=1
    writer_is_also_reader=2
    max_transactions_behind=30
    active=1
  }
)

mysql_servers =
(
  { address="192.168.0.101" , port=3306 , hostgroup=10, max_connections=100 },
  { address="192.168.0.102" , port=3306 , hostgroup=20, max_connections=100 },
  { address="192.168.0.103" , port=3306 , hostgroup=30, max_connections=100 }
)

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

mysql_users =
(
  { username = "root", password = "123456", default_hostgroup = 10, transaction_persistent = 0, active = 1 }
)

标签:monitor,max,读写,proxysql,timeout,hostgroup,conf,mysql,active
From: https://www.cnblogs.com/zhangdapangzo/p/17218362.html

相关文章

  • RabbitMQ learn —— acknowledgements and confirming messages
        发布者确认:asocketconnectionoverTCP/IP连接 tansaction(不建议)publishconfirn(建议) ......
  • 9 ServletConfig和ServletContext
    ​ ServletContext和ServletConfigServletContext对象ServletContext对象介绍ServletContext官方叫Servlet上下文。服务器会为每一个Web应用创建一个ServletContext对......
  • 9 ServletConfig和ServletContext
    ​ ServletContext和ServletConfigServletContext对象ServletContext对象介绍ServletContext官方叫Servlet上下文。服务器会为每一个Web应用创建一个ServletContext对......
  • 20230314-Python-文件的读写
    1.文件读取          2.文件写入     ......
  • VueX插件 --- 共享数据的读写处理
    vueX:vue插件,处理组件之间共享数据的读&&写引入demo(就一个Count组件,加法计算)###Count.vue(基础的写死版)<template> <div> <h1>当前求和为???</h1> <se......
  • 开源免费:分享powershell读写k8s的etcd的脚本库
      powershelletcdreadwriteputgetdelkubernetesk8s读写博客园---【前言】--- 篡改记忆=写入你脑仁,这是一项可怕的技术!它可以很容易把猫的爸爸,篡改成狗狗......
  • Intel AI Conference
    2022.11.24这场由英特尔举办、面向AI软硬件开发者和技术生态打造的年度盛会——"智能算力AI破局”2022英特尔AI开发者大会成功举办。英特尔携手其一众人工智能领域合作......
  • System.InvalidOperationException: 'OnConfiguring' cannot be used to modify DbCon
    报错原因因为你在依赖注入使用的是连接池AddDbContextPool,则不能在OnConfiguring配置参数需要在AddDbContextPool中完成配置builder.Services.AddDbContextPool<MyDbCon......
  • OSCAR Open Source Industry Conference
    2022.9.16国家会议中心为了推动我国开源生态安全合规、可持续发展,中国信通院自2015年筹备国内首个开源联盟,提出“可信开源”理念,通过产业研究、标准评估、企业/项目级开......
  • 易语言 读写txt文本
    文章目录​​1写文本​​​​2读文本​​1写文本写到文件(“群成员.txt”,到字节集(“777”))2读文本.版本2.支持库spec.局部变量文件号,整数型.局部变量txt文......