代码改变世界

mysql-proxy之奇虎360 Atlas 安装实现mysql读写分离

  cmsd  阅读(2689)  评论(1编辑  收藏  举报

官方git https://github.com/Qihoo360/Atlas

参照:http://blog.qixingzhong.com/2013/09/centos-install-atlas.html

1. 安装必要的依赖包

yum install pkg-config libevent* glib lua

2. 升级安装autoconf,编译安装automake需要

wget ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz && tar zxvf  autoconf-2.69.tar.gz && cd autoconf-2.69 &&  ./configure && make && make install

3. 升级安装automake,编译安装glib需要

 wget http://ftp.gnu.org/gnu/automake/automake-1.13.2.tar.gz  &&  tar zxvf  automake-1.13.2.tar.gz  && cd automake-1.13.2 &&  ./configure && make && make install

4. 安装libffi-devel  glibc编译需要

yum -y install libffi-devel

5. 编译安装glib,Atlas需要glib-2.0 >= 2.32.0

wget http://ftp.gnome.org/pub/gnome/sources/glib/2.36/glib-2.36.3.tar.xz && tar xvf glib-2.36.3.tar.xz && cd glib-2.36.3 && ./configure
export PKG_CONFIG_PATH=/usr/bin/pkg-config 
make && make install

6. 下载Atlas rpm包,安装

https://github.com/Qihoo360/Atlas/releases  下载对应的版本,以centos6.4 x86_64为例

rpm -ivh Atlas-2.0.5.el6.x86_64.rpm 

7. 链接库文件或者在ld.conf.d中添加库文件

echo '/usr/local/mysql-proxy/lib/'> /etc/ld.so.conf.d/mysql-proxy.conf
ldconfig -v

8. 修改配置文件/usr/local/mysql-proxy/conf/test.cnf

见https://github.com/Qihoo360/Atlas/wiki/Atlas%E7%9A%84%E5%AE%89%E8%A3%85 

9. 启动停止重启Mysql-proxy

/usr/local/mysql-proxy/bin/mysql-proxyd start|stop|restart

10. 测试

mysql -uuser -ppassword -h127.0.0.1 -P3306

其中user@password能登陆到后端的Mysql且写在配置文件中,password用encrypt加密,show processlist 查看一下是不是在slave上,insert一个查看是否插入到master上,并同步到slave上了

 

 

 

 

编辑推荐:
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
阅读排行:
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 周边上新:园子的第一款马克杯温暖上架
点击右上角即可分享
微信分享提示