centos 6.5 Atlas 中介軟體的安裝配置

來源:互聯網
上載者:User

標籤:atlas

前言: Atlasy由奇虎出品,在mysqp-proxy上開發而已,內建lua指令碼,th用於取代 mysql-proxy和amoebo ,後兩者已經停止開發.


atlas :192.168.168.130

master:192.168.168.128

slave: 192.168.168.129


  1. 配置master和slave 主從:

    參考:http://752030200.blog.51cto.com/8936921/1853460

  2. 首先從官方下載rpm安裝包。https://github.com/Qihoo360/Atlas/releases   ## el6 代表用於centos 6.x系統,el5 用於centos 5.x


3.安裝:rpm -i Atlas-2.2.1.el6.x86_64.rpm    #預設安裝路徑:/usr/local/mysql-proxy/


4.vim /usr/local/mysql-proxy/conf/test.cnf     #修改設定檔,注意 true,false 參數後面不能有空格,不然會報錯,判斷方法:非編輯模式下游標向右移動不能移動到最後表示無空間,否則有空格。

主要根據實際調整幾個:

[mysql-proxy]


#帶#號的為非必需的設定項目


#管理介面的使用者名稱

admin-username = atlas


#管理介面的密碼

admin-password = atlas


#Atlas後端串連的MySQL主庫的IP和連接埠,可設定多項,用逗號分隔

proxy-backend-addresses = 192.168.168.128:3306


#Atlas後端串連的MySQL從庫的IP和連接埠,@後面的數字代表權重,用來作負載平衡,若省略則預設為1,可設定多項,用逗號分隔

proxy-read-only-backend-addresses = 192.168.168.129:[email protected]


#使用者名稱與其對應的加密過的MySQL密碼,密碼使用PREFIX/bin目錄下的加密程式encrypt加密,下行的user1和user2為樣本,將其替換為你的MySQL的使用者名稱和加密密碼!

#密碼加密: encrypt 123456   結果等於:  /iZxz+0GRoA=

pwds = [email protected]:/iZxz+0GRoA=


5.啟動 / 停止 /重啟  atlas :

 [[email protected] ~]# /usr/local/mysql-proxy/bin/mysql-proxyd test start

 [[email protected] ~]# /usr/local/mysql-proxy/bin/mysql-proxyd test stop

 [[email protected] ~]# /usr/local/mysql-proxy/bin/mysql-proxyd test restart


6.登入atlas管理介面:


 [[email protected] ~]# mysql -u atlas -patlas -h127.0.0.1 -P2345

      mysql> SELECT * FROM help;     ---查看所有可用的命令幫忙  

      

      mysql> SELECT * FROM backends;       --查看後端的資訊

+-------------+----------------------+------+-------+---------+

| backend_ndx | address              | state | type   |

+-------------+----------------------+------+-------+---------+

|           1 | 192.168.168.128:3306 | up    | rw    |

|           2 | 192.168.168.129:3306 | up    | ro    |

+-------------+----------------------+----+---------+---------+

2 rows in set (0.00 sec)



驗證:


7.登入atlas對mysql進行操作:


[[email protected] ~]# mysql -u root -p123456 -h127.0.0.1 -P1234

  

mysql> show databases;

+--------------------+

| Database            |

+--------------------+

| information_schema |

| mysql              |

| test               |

+--------------------+

5 rows in set (0.00 sec)


mysql>create database TOP;           --建立一個資料庫TOP,成功

 Query OK, 1 row affected (0.00 sec) 


mysql> show databases;

+--------------------+

| Database            |

+--------------------+

| information_schema |

| TOP                |

| mysql               |

| test                |

+--------------------+

4 rows in set (0.01 sec)


8.登入master 查看是否有 TOP 資料庫

[[email protected] ~]# mysql

mysql> show databases;

+--------------------+

| Database           |

+--------------------+

| information_schema |

| TOP                |

| mysql              |

| test               |

+--------------------+

4 rows in set (0.00 sec)


9.登入 SLAVE 查看是否有 TOP 資料庫

[[email protected] ~]# mysql

mysql> show databases;

+--------------------+

| Database           |

+--------------------+

| information_schema |

| TOP                |

| mysql              |

| test               |

+--------------------+

4 rows in set (0.00 sec)


10,可以看到在atlas 建立一個TOP資料庫時,成功寫入到master上,並且SLAVE 成功從MASTER上複製過來。



注意:1.使用者名稱和加密密碼這段用來登入mysql進行操作。

    2. 管理介面使用者用來管理 atlas 。

    3.當atlas 沒有啟動時,用restart不能啟動atlas服務,並會報錯。

centos 6.5 Atlas 中介軟體的安裝配置

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.