当前位置:网站首页>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-proxyd
test
start
查看Altas运行情况
./mysql-proxyd
test status
有两个进程的。
我后来使用NaviCat连接工作端口,用户名和密码就是上面配置文件的管理用户和密码,成功了。
经过测试,Altas的读写分离和事务支持很好,明天发布2.0版本,增加对JDBC的支持。
参考:
https://github.com/Qihoo360/Atlas
边栏推荐
- Policy Center > Deceptive Behavior
- RTC monthly tabloid programming challenge ended successfully in June; Review of the first anniversary of sound network's listing
- return statement
- About pickle module - 6 points that beginners must know
- Google Play 索引表
- Kindle down, ireader relay
- Experiment of the planning group of the West University of technology -- pipeline CPU and data processing Adventure
- 各省GDP可视化案列,附带csv Metabase处理
- Lecun points out the direction of next generation AI: autonomous machine intelligence
- 技不压身,快速入门ETH智能合约开发,带你进入ETH世界
猜你喜欢
Chapter 2 installation and use of vscode editor
Using asp Net core creating web API series
What would you choose between architecture optimization and business iteration?
爬虫(1) - 爬虫基础入门理论篇
Anyrtc implements application scenarios based on webrtc
How to do a good job in high concurrency system design? I have summarized three points
Super comprehensive redis distributed high availability solution: sentry mechanism
Management joint examination - mathematical formula
[leetcode] linked list sorting (gradually increasing the space-time complexity)
Visualization of provincial GDP with CSV metabase processing
随机推荐
Infrastructure is code. What are you talking about?
How should we understand the variability of architecture design?
[附下载]渗透测试神器Nessus安装及使用
Experiment of the planning group of the West University of technology -- pipeline CPU and data processing Adventure
[algorithm] after summarizing the four linked lists, I brushed two interview questions
Npumcm selection question 3 and acmc2020a
Generating verification code with sring
阿里云oss对象存储跨域设置
Model system: Sword (1)
Chapter 2 installation and use of vscode editor
Jupyter notebook basic knowledge learning
智慧风电:数字孪生 3D 风机智能设备运维
4.8 data type conversion
Introduction to using 51 single chip microcomputer to control steering gear
Pointer understanding
Policy Center > Device and Network Abuse
Policy Center > Google Play‘s Target API Level Policy
Policy Center-User Data
Container common commands
爬虫(1) - 爬虫基础入门理论篇