반응형

MaxScale 

 

기본 명령어들

 

기동/종료

    systemctl [start | stop | restart | status] maxscale   

    systemctl [enable | disable] maxscale

    journalctl -u maxscale

 

운영

    maxctrl list [ servers | services | listeners | monitors | sessions | threads | users | commands ] 

    maxctrl show [ servers | services | monitors | sessions | threads | maxscale | commands ]

 

설치

 

-- /ect/hosts (root)
 
10.70.101.16   xpand1
10.70.101.17   xpand2
10.70.101.18   xpand3
10.70.101.19   xpand4
 
10.70.101.20   maxscale1
--방화벽 OFF (root)

systemctl stop firewalld
systemctl disable firewalld
 
-- 필요 패키지 설치 (root)  <-- Xpand와 그냥 동일하게 맞춰 주었음

yum install bzip2 mdadm ntp ntpdate screen wget xz -y 

yum-config-manager --enable rhui-REGION-rhel-server-optional  (RHEL Only)
-- 엔진 설치 (root)

wget https://downloads.mariadb.com/MariaDB/mariadb_repo_setup

echo "b9e90cde27affc2a44f9fc60e302ccfcacf71f4ae02071f30d570e6048c28597  mariadb_repo_setup" \ | sha256sum -c -
chmod +x mariadb_repo_setup
sudo ./mariadb_repo_setup \
   --skip-server \
   --skip-tools \
   --mariadb-maxscale-version="2.5"
yum install maxscale -y
-- 기본 설정(root)

/etc/maxscale.cnf

[maxscale]
threads          = auto
admin_host       = 0.0.0.0
admin_secure_gui = false
-- maxscale 재 시작

systemctl restart maxscale
-- 기본 서비스 확인


-- Xpand Server 추가

maxctrl create server xpand1 10.70.101.16

maxctrl create server xpand2 10.70.101.17
maxctrl create server xpand3 10.70.101.18


-- Xpand Monitor 추가 (maxscale DB유저 입력)

maxctrl create monitor xpand_monitor xpandmon \

   --servers xpand1 xpand2 xpand3 \
   --monitor-user=max \
   --monitor-password=max1122


-- readwritesplit라는 이름의 라우터 추가 (부하 분산용으로 3개 서버를 설정)

maxctrl create service xpand_service readwritesplit \

   user=max \
   password=max1122 \
   --servers xpand1 xpand2 xpand3


-- 라우터의 리슨 포트 생성
   (maxscale에 3306으로 접속하게 되면 자동으로 xpand1 , xpand2 , xpand3으로 커넥션 개수를 기준으로 라우팅 함)


maxctrl create listener xpand_service xpand_listener 3306 \

   --protocol=MariaDBClient

-- 설정 확인


-- client 접속

10.70.101.20 3306 포트를 이용하여 접근하면 된다.

 

모니터링 웹

 

8989 포트를 이용하여 MaxScale 모니터링 웹에 접속 가능

기본 제공 :

    admin / mariadb

 

 

 

 

 

 

반응형

+ Recent posts