proxysql1.4.12 安装及 集群测试 ~~~~~坑还是很多【亲测可用】

 

proxysql介绍

ProxySQL is a high performance, high availability, protocol aware proxy for MySQL and forks (like Percona Server and MariaDB). All the while getting the unlimited freedom that comes with a GPL license.

Its development is driven by the lack of open source proxies that provide high performance.

ProxySQL是一种针对mysql及其分支(如Percona,MariaDB)的一种高性能,高可用的代理协议。

ProxySQl之所以被开发出来是因为市面上缺少开源高可用的开源代理。

 

ProxySQL测试

proxysql安装:

cat <<EOF | tee /etc/yum.repos.d/proxysql.repo
[proxysql_repo]
name= ProxySQL YUM repository
baseurl=http://repo.proxysql.com/ProxySQL/proxysql-1.4.x/centos/\$releasever
gpgcheck=1
gpgkey=http://repo.proxysql.com/ProxySQL/repo_pub_key
EOF

yum makecache

yum install proxysql

proxysql -V
#ProxySQL version 1.4.12-9-g216b872, codename Truls

 proxysql配置

  需要注意的是proxysql的配置是支持动态配置的。

  程序运行时会先读取sqlitedb(如果存在的话),否则就读取配置文件。部分参数是即使sqlitedb存在也读取配置文件的:

  如下。

 

配置流程图如下:

  • datadir : it defines the path of ProxySQL datadir, where database file, logs and other files are stored
  • restart_on_missing_heartbeats (new in 1.4.4) : if MySQL threads miss restart_on_missing_heartbeats heartbeats, proxysql will raise a SIGABRT signal and restart. Default is 10 . See watchdog .
  • execute_on_exit_failure (new in 1.4.4) : if set, ProxySQL parent process will execute the defined script every time ProxySQL crashes. It is recommended to use this setting to generate an alert or log the event. Note that proxysql is able to restart in few milliseconds in case of crash, therefore it is possible that a normal failure is not detected by other monitoring tools.
+-------------------------+
|         RUNTIME         |
+-------------------------+
       /|\          |
        |           |
    [1] |       [2] |
        |          \|/
+-------------------------+
|         MEMORY          |
+-------------------------+ _
       /|\          |      |\
        |           |        \
    [3] |       [4] |         \ [5]
        |          \|/         \
+-------------------------+  +-------------------------+
|          DISK           |  |       CONFIG FILE       |
+-------------------------+  +-------------------------+

 如上:

runtime----内存中保存的配置数据结构。直接用来进程处理请求。包含:实际连接的后端server列表。实际的全局变量,能连接proxysql的用户。用户无法直接设置runtime的数据。需要通过底层调用来修改。

memory(也可被叫做main)--存在于内存的中的db.这个db暴露出兼容mysql的接口供用户连接进行配置项修改。以下配置可以在该处进行修改:

  • mysql_servers -- the list of backend servers which ProxySQL connects to
  • mysql_users -- the list of users and their credentials which connect to ProxySQL. Please note that P
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值