MySQL中间件Atlas安装及使用

简介

Atlas是由 Qihoo 360公司Web平台部基础架构团队开发维护的一个基于MySQL协议的数据中间层项目。它在MySQL官方推出的MySQL-Proxy 0.8.2版本的基础上,修改了大量bug,添加了很多功能特性。而且安装方便。配置的注释写的蛮详细的,都是中文。

主要功能

  • 读写分离
  • 从库负载均衡
  • IP过滤
  • 自动分表
  • DBA可平滑上下线DB
  • 自动摘除宕机的DB

相关链接

Mysql中间件产品比较:http://songwie.com/articlelist/44
Atlas的安装:https://github.com/Qihoo360/Atlas/wiki/Atlas的安装
Atlas功能特点FAQ:https://github.com/Qihoo360/Atlas/wiki/Atlas功能特点FAQ
Atlas性能特点:https://github.com/Qihoo360/Atlas/wiki/Atlas的性能测试
Atlas架构:https://github.com/Qihoo360/Atlas/wiki/Atlas的架构
Atlas+Keepalived:http://sofar.blog.51cto.com/353572/1601552
Atlas各项功能验证:http://blog.itpub.net/27000195/viewspace-1421262/

官网教程很详细,且是中文,这里就不详述相关安装过程了

设置开机自启动

echo "/usr/local/mysql-proxy/bin/mysql-proxyd test start" >> /etc/rc.local

添加atlas服务

# 编写简单的Atlas启动脚本
vim /etc/init.d/atlas

#!/bin/sh  

start()  
{  
        /usr/local/mysql-proxy/bin/mysql-proxyd test start
}  
stop()  
{  
        /usr/local/mysql-proxy/bin/mysql-proxyd test stop
}
status()  
{       
        /usr/local/mysql-proxy/bin/mysql-proxyd test status  
}
restart()  
{  
        /usr/local/mysql-proxy/bin/mysql-proxyd test restart
} 
ATLAS="/usr/local/mysql-proxy/bin/mysql-proxyd"  
[ -f $ATLAS ] || exit 1  
# See how we were called.  
case "$1" in  
        start)  
                start  
                ;;  
        stop)  
                stop  
                ;;  
        restart)  
                restart
                ;;  
        status)  
                status 
                ;;  
                # stop    sleep 3   start  ;;  
        *)  
                echo $"Usage: $0 {start|stop|status|restart}"  
                exit 1  
esac  
exit 0 

# atlas服务验证
service atlas status
service atlas start
service atlas restart
service atlas stop

查看MySQL监听端口

etstat -tanlp | grep mysql
tcp        0      0 0.0.0.0:2345            0.0.0.0:*               LISTEN      21449/mysql-proxy   
tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN      24096/mysqld        
tcp        0      0 0.0.0.0:1234            0.0.0.0:*               LISTEN      21449/mysql-proxy

Atlas安装及卸载

# 安装
sudo rpm -i Atlas-2.2.1.el6.x86_64.rpm

# 卸载
sudo rpm -e Atlas-2.2.1.el6.x86_64

猜你喜欢

转载自blog.csdn.net/keith003/article/details/80624938