当前位置:网站首页>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
边栏推荐
- Data governance Market: Yixin Huachen faces left, Huaao data faces right
- Phone number shielding function
- iMeta | 叶茂/时玉等综述环境微生物组中胞内与胞外基因的动态穿梭与生态功能...
- 4.5 integer
- Npumcm selection question 3 and acmc2020a
- CVPR 2022丨特斯联AI提出:基于图采样深度度量学习的可泛化行人重识别
- Container common commands
- 电子烟强制性国家标准GB 41700-2022发布 2022年10月1日起实施
- Types of waveguides
- C language foundation - pointer array - initialization method & constant pointer array, pointer constant array
猜你喜欢

终于看懂科学了!200张图领略人类智慧的巅峰

Smart wind power: operation and maintenance of digital twin 3D wind turbine intelligent equipment

How to do a good job in high concurrency system design? I have summarized three points

Npumcm selection question 3 and acmc2020a

互联网研发效能之去哪儿网(Qunar)核心领域DevOps落地实践

Policy Center-User Data

Some reference routines for cache update

At the beginning of the 2022 new year, I will send you hundreds of dry articles

Open source STM32 USB-CAN project

【时序数据库InfluxDB】Windows环境下配置InfluxDB+数据可视化,以及使用 C#进行简单操作的代码实例
随机推荐
At the beginning of the 2022 new year, I will send you hundreds of dry articles
Start your global dynamic acceleration journey of Web services in three steps
ASP. Net core signalr series hub tutorial
Chapter III installation and use of jupyter
Basic literacy - four common software architectures
4.4 string
Oracle中的With As 子查询
Smart wind power: operation and maintenance of digital twin 3D wind turbine intelligent equipment
Simulate user login function
Flask Sqlalchemy - automatically export the table model (flask sqlacodegen) & no single primary key problem ---orm (8)
Policy Center > Misrepresentation
Npumcm selection question 3 and acmc2020a
How to browse mobile web pages on your computer
Single cycle CPU of the design group of West University of Technology
各省GDP可视化案列,附带csv Metabase处理
开源 STM32 USB-CAN项目
Introduction to using 51 single chip microcomputer to control steering gear
[sub matrix quantity statistics] cf1181c flag sub matrix quantity statistics
Asp.NetCore利用缓存使用AOP方式防止重复提交
Cesium-1.72 learning (deploy offline resources)