360开源数据库中间件Atlas 笔记记录

  |   0 评论   |   978 浏览

    Atlas 支持 64 bit centos os
    1、安装atlas 
         rpm -ivh Atlas-2.1.el6.x86_64.rpm
         uninstall   rpm -qa | grep Atlas
                           rpm -e Atlas-2.1-1.x86_64
    2、安装路径  /usr/local/mysql-proxy
    3、编辑 /usr/local/mysql-proxy/conf/test.cnf


    #管理接口的用户名 
    admin-username = myfun


    #管理接口的密码 
    admin-password = password@123


    #Atlas后端连接的MySQL主库的IP和端口,可设置多项,用逗号分隔 
    proxy-backend-addresses = 10.181.108.113:3418 


    #用户名与其对应的加密过的MySQL密码,密码使用PREFIX/bin目录下的加密程序encrypt加密,下行的user1和user2为示例,将其替换为你的MySQL的用户名和加密密码! 
    #pwds = user1:+jKsgB3YAG8=, user2:GS+tr4TPgqc= 
    pwds = root:5zsJPTyBwS4a8s/oWZlMvQ==


    #分表设置,此例中person为库名,mt为表名,id为分表字段,3为子表数量,可设置多项,以逗号分隔,若不分表则不需要设置该项
    tables = myfun.storage.user_id.100,myfun.user_storage.user_id.100


    加密密码生成
    cd /usr/local/mysql-proxy/bin
     ./encrypt 1qazxsw2 
    5zsJPTyBwS4a8s/oWZlMvQ==


    4、启动 和 停止
    cd /usr/local/mysql-prox/bin
    ./mysql-proxyd test start
    ./mysql-proxyd test stop
    ./mysql-proxyd test restart


    5、用户权限(Atals 管理接口)
    腾讯CVM 上 操作 CDB,赋予权限
    GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, PROCESS, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'myfun'@'%' IDENTIFIED BY 'password@123'; 
    flush privileges; 


    自安装mysql时,可以这样赋予权限
    grant all on  *.* to 'myfun'@'%' identified by 'password@123' ;


    6、登录Atlas


    通过Atlas访问Mysql , root/1qazxsw2
    mysql -h127.0.0.1 -uroot -p123456 -P1234


    Atals 的管理接口
    mysql -h127.0.0.1 -umyfun -ppassword@123 -P2345

    Github: https://github.com/Qihoo360

    评论

    发表评论

    validate