Atlas-sharding_1.0.1 설치 설정

8650 단어 mysql
1.환경
OS: CentOS 6.5 x64
MySQL: 5.6 for Linux (x86_64)
Atlas IP        : 192.168.10.180
MySQL Master IP : 192.168.10.181
MySQL Slave IP  : 192.168.10.182
메모:MySQL 의 마스터 를 복사 설정 합 니 다.
MySQL 원본 설치 참고:http://blog.csdn.net/john_chang11/article/details/51593220
MySQL RPM 설치 참고:http://blog.csdn.net/john_chang11/article/details/51622725
2.Atlas 준비
사용 은 필름 분할 을 지원 하 는 최신 버 전:Atlas-sharding1.0.1,rpm 패키지 로 설치,다운로드 주소:https://github.com/Qihoo360/Atlas/releases/
원본 을 보 려 면 여 기 를 보 세 요.https://github.com/Qihoo360/Atlas/tree/sharding
atlas 홈 페이지 에 다음 과 같은 힌트 가 올 라 왔 습 니 다.
(1).Atlas       64     。
(2).Centos 5.X   Atlas-XX.el5.x86_64.rpm,Centos 6.X  Atlas-XX.el6.x86_64.rpm.
(3).  mysql     5.1,    Mysql 5.6.

3.Atlas 설치
sudo rpm –i Atlas-XX.el6.x86_64.rpm 설치.이렇게 간단 해.
설치 디 렉 터 리:/usr/local/mysql-proxy
디 렉 터 리 내용 은 다음 과 같 습 니 다.
[root@test1 ~]# cd /usr/local/mysql-proxy/ [root@test1 mysql-proxy]# ls bin  conf  include  lib  libexec  log  share
4.프로필 수정
프로필 은.../conf 디 렉 터 리 에 있 습 니 다.기본적으로 test.cnf 파일 이 있 습 니 다.이 파일 을 복사 하고 수정 하면 됩 니 다.
[root@test1 mysql-proxy]# cd conf/ [root@test1 conf]# vi test.cnf 
[mysql-proxy]
(  ,     )        。  Atlas      MySQL          ,      。            
admin-username = user
(  ,     )       
admin-password = 111
(  ,        )   IP   
proxy-backend-addresses =192.168.10.181:3306
(   ,        )   IP   ,@         ,       ,       1,     ,     。               ,                  。
proxy-read-only-backend-addresses =192.168.10.182:3306@1
(  ,        )            MySQL  ,    PREFIX/bin        encrypt  ,             。                   (                )。      user,   111,  ./encrypt mypwd   9YGoyKZPMdg=。              。        :
pwds = user: 9YGoyKZPMdg=,user2:HJBoxfRsjeI=
(  ,     )Atlas     ,  true        ,  false      ,         false,       true
daemon = true
(  ,     )  Atlas     ,  true Atlas       ,   monitor,   worker,monitor worker            ,  false   worker,  monitor,         false,       true
keepalive = true
(  ,        )     ,        CPU   2 4 。Atlas        CPU   。       CPU   1 2 。
event-threads = 4
(  ,     )    ,  message、warning、critical、error、debug    
log-level = message
(  ,     )       
log-path = /usr/local/mysql-proxy/log
(  ,        )SQL     ,    OFF、ON、REALTIME,OFF     SQL  ,ON    SQL  ,               ,         ,          。REALTIME    ,    SQL         ,   OFF。      Atlas   , MySQL     。
sql-log = OFF
(   ,    )       。        ,            sql-log-slow(  :ms)     。             。
sql-log-slow = 10
(   ,    )             。        ,Atlas       'wait-timeout'           。  : 
wait-timeout = 10
#    ,          Atlas      。         Atlas  ,       ,       ,         。
instance = test
(  ,     )Atlas       IP   
proxy-address = 192.168.10.180:1234
(  ,     )Atlas       IP   。
admin-address = 192.168.10.180:2345
(   ,    )    ,   person   ,mt   ,id     ,3     ,     ,     ,            ,        ,       _  ,     [0,   -1],    ,     mt_0、mt_1、mt_2。           ,       。
#tables = person.mt.id.3
(   ,    )     ,      ,       latin1。      ,     utf8。
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

5.비밀번호 생 성
파일 에 pwds 인 자 를 암호 화 할 암 호 를 설정 합 니 다.암호 가 111 이면 이 암 호 를 만 드 는 암호 화 문자열 방식 은 다음 과 같 습 니 다.
[root@test1mysql-proxy]\#/usr/local/mysql-proxy/bin/encrypt 1119 YGoyKZPMdg=(이것 이 암호 화 문자열 입 니 다)[root@test1 mysql-proxy]# 
6.시동 정지 Atlas
시작:
[root@test1 mysql-proxy]# /usr/local/mysql-proxy/bin/mysql-proxyd test start OK: MySQL-Proxy of test is started
지정 한 매개 변수 파일 로 시작 하기:
[root@test1 mysql-proxy]# /usr/local/mysql-proxy/bin/mysql-proxy --defaults-file=/usr/local/mysql-proxy/conf/test.cnf
상태 보기:[root@test1 mysql-proxy]# /usr/local/mysql-proxy/bin/mysql-proxyd test status MySQL-Proxy of test is running (7024) MySQL-Proxy of test is running (7025)
정지:[root@test1 mysql-proxy]# /usr/local/mysql-proxy/bin/mysql-proxyd test stop OK: MySQL-Proxy of test is stopped
상태 보기:[root@test1 mysql-proxy]# /usr/local/mysql-proxy/bin/mysql-proxyd test status MySQL-Proxy of test is NOT running [root@test1 mysql-proxy]# 
7.Atlas 시작 스 크 립 트 만 들 기
[root@test1 mysql-proxy]# vi /etc/init.d/atlas
#!/bin/sh   #  
# chkconfig: 2345 90 90 # description:  Atlas Daemon   #   start()   {           echo -n $"Starting atlas: "           /usr/local/mysql-proxy/bin/mysql-proxyd test start           echo    }   stop()   {           echo -n $"Shutting down atlas: "           /usr/local/mysql-proxy/bin/mysql-proxyd test stop           echo   }   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)                   stop                   sleep 3                   start                   ;;           *)                   echo $"Usage: $0 {start|stop|restart}"                   exit 1   esac   exit 0  
[root@test1 init.d]# chkconfig atlas on
[root@test1 init.d]#

좋은 웹페이지 즐겨찾기