当前位置:网站首页>Mysql代理中间件Atlas安装和配置
Mysql代理中间件Atlas安装和配置
2022-06-30 15:38:00 【BUG弄潮儿】
前提得配置好主从参考:http://www.cnblogs.com/super-d2/p/4802990.html
首先,先去下载Altas的rpm包,下载地址:https://github.com/Qihoo360/Atlas/releases
要看清楚版本,centos 5.x:Atlas-1.0.3.el5.x86_64.rpm centos 6.x:
我的系统是centos 6.4 ,所以下载Atlas-1.0.3.el6.x86_64.rpm
千万别搞错了,否则最后启动会出错。大家也可以采取源码编译安装,不过rpm安装比较省时省力,而且简单。
下载rpm
wget https://github.com/Qihoo360/Atlas/releases/download/1.0.3/Atlas-1.0.3.el6.x86_64.rpm安装
rpm -i Atlas-1.0.3.el6.x86_64.rpm安装的目录是/usr/local/mysql-proxy
conf文件夹下有一个自带的配置文件test.cnf,我们可以直接修改,下面是我修改的
主数据库服务器:192.168.83.11
从数据库服务器:192.168.83.12
proxy服务器:192.168.83.13
[mysql-proxy]
#Atlas加载的模块名称,不需要改
plugins = admin, proxy
#管理接口的用户名
admin-username = root
#管理接口的密码
admin-password = 123456
#实现管理接口的Lua脚本所在路径
admin-lua-script = /usr/local/mysql-proxy/lib/mysql-proxy/lua/admin.lua
#Atlas后端连接的MySQL主库的IP和端口,可设置多项,用逗号分隔
proxy-backend-addresses = 192.168.83.11:3306
#Atlas后端连接的MySQL从库的IP和端口,@后面的数字代表权重,用来作负载均衡,若省略则默认为1,可设置多项,用逗号分隔
proxy-read-only-backend-addresses = 192.168.83.12:[email protected]
#设置Atlas的运行方式,设为true时为守护进程方式,设为false时为前台方式,一般开发调试时设为false,线上运行时设为true
daemon = false#设置Atlas的运行方式,设为true时Atlas会启动两个进程,一个为monitor,一个为worker,monitor在worker意外退出后会自动将其重启,设为false时只有worker,没有monitor,一般开发调试时设为false,线上运行时设为true
keepalive = false
#工作线程数,推荐设置与系统的CPU核数相等event-threads = 4
#日志级别,分为message、warning、critical、error、debug五个级别
log-level = message
#日志存放的路径
log-path = /usr/local/mysql-proxy/log
#实例名称,用于同一台机器上多个Atlas实例间的区分
instance = test
#Atlas监听的工作接口IP和端口
proxy-address = 0.0.0.0:1234
#Atlas监听的管理接口IP和端口
admin-address = 0.0.0.0:2345#连接池的最小空闲连接数,应设为event-threads的整数倍,可根据业务请求量大小适当调大或调小
min-idle-connections = 8
#分表设置,此例中person为库名,mt为表名,id为分表字段,3为子表数量,可设置多项,以逗号分隔,若不分表则不需要设置该项
#tables = person.mt.id.3
#用户名与其对应的加密过的MySQL密码,密码使用PREFIX/bin目录下的加密程序encrypt加密,此设置项用于多个用户名同时访问同一个Atlas实例的情况,若只有一个用户名>则不需要设置该项
#pwds = user1:+jKsgB3YAG8=, user2:GS+tr4TPgqc=
#默认字符集,若不设置该项,则默认字符集为latin1
charset = utf8
#允许连接Atlas的客户端的IP,可以是精确IP,也可以是IP段,以逗号分隔,若不设置该项则允许所有IP连接,否则只允许列表中的IP连接
#client-ips = 127.0.0.1, 192.168.1
#Atlas前面挂接的LVS的物理网卡的IP(注意不是虚IP),若有LVS且设置了client-ips则此项必须设置,否则可以不设置
#lvs-ips = 192.168.1.1最后,进入到bin文件夹下,启动Altas./mysql-proxy --defaults-file=../conf/test.cnf最好配置文件中的 daemon设置为true,为后台守护运行。
使用官网的
./mysql-proxydteststart
查看Altas运行情况
./mysql-proxyd test status
有两个进程的。
我后来使用NaviCat连接工作端口,用户名和密码就是上面配置文件的管理用户和密码,成功了。
经过测试,Altas的读写分离和事务支持很好,明天发布2.0版本,增加对JDBC的支持。
参考:
https://github.com/Qihoo360/Atlas
边栏推荐
- ADB devices cannot detect the problem of Xiaomi note 3
- 服务端测试工程师面试经验
- Alibaba cloud OSS object storage cross domain settings
- Unsupported major.minor version 52.0
- Policy Center > Google Play‘s Target API Level Policy
- How should we understand the variability of architecture design?
- Chapter III installation and use of jupyter
- Super comprehensive redis distributed high availability solution: sentry mechanism
- Create a new MySQL database under Linux and import SQL files
- Oculus quest2 | unity configures the oculus quest2 development environment and packages an application for real machine testing
猜你喜欢

Swagger's asp Net core web API help page

Chapter III installation and use of jupyter

【子矩阵数量统计】CF1181C Flag子矩阵数量统计

4.3 variables and assignments

4.4 string

【Unity UGUI】ScrollRect 动态缩放格子大小,自动定位到中间的格子

Open source STM32 USB-CAN project

'<', hexadecimal value 0x3C, is an invalid 问题解决

Oculus quest2 | unity configures the oculus quest2 development environment and packages an application for real machine testing

Preliminary study on AI noise reduction evaluation system of sound network
随机推荐
Basic literacy - four common software architectures
Log4j2 进阶使用
Experiment of the planning group of the West University of technology -- pipeline CPU and data processing Adventure
Policy Center-User Data
C language foundation - pointer array - initialization method & constant pointer array, pointer constant array
String common API
Practical cases of data visualization (timeline rotation diagram, streamlit control year metabase visualization tutorial) 2.0
Pointer understanding
Noj1042 - electronic mouse running through maze
Unsupported major.minor version 52.0
Deep understanding Net (2) kernel mode 1 Kernel mode construct event event
Mysql database - create user name & modify permission
Flask Sqlalchemy - automatically export the table model (flask sqlacodegen) & no single primary key problem ---orm (8)
openresty 内置变量
Finally understand science! 200 pictures to appreciate the peak of human wisdom
Mysql事务/锁/日志总结
Create a new MySQL database under Linux and import SQL files
[algorithm] after summarizing the four linked lists, I brushed two interview questions
[附下载]渗透测试神器Nessus安装及使用
CVPR 2022丨特斯联AI提出:基于图采样深度度量学习的可泛化行人重识别