Background Image
조회 수 3946 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 첨부
CUBRID SELECT Query Load Balance


▶  CUBRID SELECT Query Load Balance 튜토리얼 환경 :
- VMware Work Station 11
- VM Version 10
- OS : Linux Centos 6.7 64bit
- CUBRID Version : 9.3.6.0002
- CUBRID JDBC Driver Version : 9.3.6.0002 

▶  CUBRID SELECT Query Load Balance 목적 : 
     - 조회 질의(SELECT) 분산을 통해 Broker Server와 Data Bases Server 리소스 부하를 줄일 수 있다.


jdbcload1.png
(그림 1-1. CUBRID Load Balance 미사용 다중화 구성)



jdbcload2.png
(그림 1-2. CUBRID Load Balance 사용 다중화 구성)


▶ 튜토리얼 구성 시나리오
- Broker Server_1
- Host Name : BRO_SV_1
- IP : 192.168.0.111
- Broker Port : 33000

- Broker Server_2
- Host Name : BRO_SV_1
- IP : 192.168.0.111
- Broker Port : 33000

- DataBase Server_1
- Host Name : DB_SV_1
- IP : 192.168.0.221

- DataBase Server_2
- Host Name : DB_SV_1
- IP : 192.168.0.222

- Data Bases Info
- DB Name : demodb
- DB User : demouser
- Query Type : SELECT



JDBC Setting

▶ JDBC Driver Configuration
- JDBC 사용 옵션
     - loadBalance

- Load Balance 사용을 위한 URL

"jdbc:cubrid:192.168.0.111:33000:demodb:demouser::?althosts=192.168.0.112:33000&loadBalance=true"

- 해당 URL은 앞의 192.168.0.111과 192.168.0.112을 랜덤한 순서로 연결한다.


BROKER Setting 


▶ Broker Server 1 Configuration

- Fail-Over 발생 후 Fail-Back이 되게 되면 기존의 연결 된 CAS들은 JDBC LoadBalance 와 무관하게 Active로만 연결 되게 된다. 
- 이 부분을 cubrid_broker.conf 값의 RECONNECT_TIME=10s를 통해 자신의 databases.txt의 우선 순위가 되는 DataBases로 다시 연결 하는 Broker 옵션을 사용한다.

$ cat $CUBRID/databases/databases.txt
#db-name        vol-path                db-host         log-path                lob-base-path
demodb          /home/cubrid/DB/demodb  DB_SV_1:DB_SV_2    /home/cubrid/DB/demodb  file:/home/cubrid/DB/demodb/lob

$ cat $CUBRID/conf/cubrid_broker.conf

[%BROKER1]
RECONNECT_TIME=10s

$ cat /etc/hosts
192.168.0.111     BRO_SV_1
192.168.0.112     BRO_SV_2

192.168.0.221     DB_SV_1
192.168.0.222     DB_SV_2

# cat /etc/sysconfig/iptables

-A INPUT -p tcp --dport 33000 -j ACCEPT


▶ Broker Server 2 Configuration

- Fail-Over 발생 후 Fail-Back이 되게 되면 기존의 연결 된 CAS들은 JDBC LoadBalance 와 무관하게 Active로만 연결 되게 된다. 
- 이 부분을 cubrid_broker.conf 값의 RECONNECT_TIME=1s를 통해 자신의 databases.txt의 우선 순위가 되는 DataBases로 다시 연결 하는 Broker 옵션을 사용한다.

$ cat $CUBRID/databases/databases.txt
#db-name        vol-path                db-host         log-path                lob-base-path
demodb          /home/cubrid/DB/demodb  DB_SV_2:DB_SV_1    /home/cubrid/DB/demodb  file:/home/cubrid/DB/demodb/lob

$ cat $CUBRID/conf/cubrid_broker.conf

[%BROKER1]
RECONNECT_TIME=10s

$ cat /etc/hosts
192.168.0.111     BRO_SV_1
192.168.0.112     BRO_SV_2

192.168.0.221     DB_SV_1
192.168.0.222     DB_SV_2

# cat /etc/sysconfig/iptables

-A INPUT -p tcp --dport 33000 -j ACCEPT



DB Setting

▶ Data Base Server 1 Configuration

DB_SV_1 Master 모드

$ cat /etc/hosts
192.168.0.111     BRO_SV_1
192.168.0.112     BRO_SV_2

192.168.0.221     DB_SV_1
192.168.0.222     DB_SV_2

# cat /etc/sysconfig/iptables

-A INPUT -p tcp --dport 1523 -j ACCEPT
-A INPUT -p udp --dport 59901 -j ACCEPT


▶ Data Base Server 2 Configuration

DB_SV_2 Slave 모드

$ cat /etc/hosts
192.168.0.111     BRO_SV_1
192.168.0.112     BRO_SV_2

192.168.0.221     DB_SV_1
192.168.0.222     DB_SV_2

# cat /etc/sysconfig/iptables

-A INPUT -p tcp --dport 1523 -j ACCEPT
-A INPUT -p udp --dport 59901 -j ACCEPT




마치며

▶ CUBRID 다중화 구성

- CUBRID는 Broker와 Database Server 같은 시스템(OS)에 둘 수도 있으며, 별도의 시스템(OS)으로 분리도 가능하다.
- 이러한 점에서 CUBRID로 연결되는 Driver와  CUBRID의 Broker, Database의 연결 관계를 이해하면 다양한 다중화 구성이 가능하다.

▶ CUBRID 참고 문헌
     - CUBRID 시스템 구조
  (http://www.cubrid.org/manual/ko/9.3.0/intro.html#id1)

     -JDBC 연결 설정
          (http://www.cubrid.org/manual/ko/9.3.0/api/jdbc.html#jdbc-connection-conf)

     - Broker 접속 관련 파라미터
  (http://www.cubrid.org/manual/ko/9.3.0/admin/config.html#cubrid-broker-conf)



감사합니다.

  1. [linux] wget으로 제품 다운로드 시 "wget: unable to resolve host address ‘ftp.cubrid.org’" 해결방

    Date2021.07.02 CategoryInstall By큐브리드_김주현 Views2264
    Read More
  2. CUBRID기반으로 XE 운영하기 – 설치가이드

    Date2012.04.13 CategoryInstall Bycubebridge Views30933
    Read More
  3. LINUX CUBRID 4.0 매니저 설치방법

    Date2011.07.19 CategoryInstall By정만영 Views23654
    Read More
  4. CUBRID Ubuntu Launchpad Installation 방법

    Date2011.07.19 CategoryInstall By정만영 Views29604
    Read More
  5. CUBRID Windows버전 삭제 및 재설치 실패시 강제 삭제하는 방법입니다.

    Date2011.07.14 CategoryInstall Byadmin Views29550
    Read More
  6. CUBRID 설치 안내 - LINUX

    Date2011.03.08 CategoryInstall By남재우 Views30414
    Read More
  7. CUBRID2008 R2.1 업그레이드시 serial 관련 문제 해결 방법

    Date2010.01.28 CategoryInstall By남재우 Views27348
    Read More
  8. CUBRID 에 텍스트큐브 설치하기

    Date2009.12.31 CategoryInstall Byinureyes Views29852
    Read More
  9. CUBRID R2.0 ISV(Independent Software Vendor)설치방법

    Date2009.11.20 CategoryInstall Bycubebridge Views27922
    Read More
  10. CUBRID 설치 및 매니저 구동하기(CUBRID 2008 R2.0)

    Date2009.08.18 CategoryInstall ByCUBRID_DEV Views30054
    Read More
  11. CUBRID 2008 + Textyle 설치 가이드

    Date2009.07.29 CategoryInstall ByPrototype Views18287
    Read More
  12. CUBRID 설치 및 매니저 구동하기(CUBRID 2008 R1.x)

    Date2009.07.18 CategoryInstall ByCUBRID_DEV Views31532
    Read More
  13. CUBRID Manager 사용시 로그인에 대하여

    Date2009.04.01 CategoryInstall Byadmin Views42045
    Read More
  14. AutoSet 4.3.2를 이용한 APACHE+PHP+CUBRID 2008 설치 가이드

    Date2009.03.13 CategoryInstall Byseongjoon Views38974
    Read More
  15. APC_Install-tools 구성 및 설치 방법

    Date2009.03.13 CategoryInstall ByPrototype Views30614
    Read More
  16. Windows 에서 CUBRID 설치하기

    Date2008.11.22 CategoryInstall By남재우 Views43645
    Read More
  17. UNIX/LINUX 에서 CUBRID 설치하기

    Date2008.11.22 CategoryInstall By남재우 Views37530
    Read More
  18. CUBRID6.6 이상에서 CUBRID2008 로 데이터베이스 이전 하기

    Date2008.11.21 CategoryInstall By남재우 Views26445
    Read More
  19. CUBRID 2008 을 하나의 머신에 여러번 설치하기(multi instance)

    Date2008.11.21 CategoryInstall Byadmin Views31459
    Read More
Board Pagination Prev 1 Next
/ 1

Contact Cubrid

대표전화 070-4077-2110 / 기술문의 070-4077-2113 / 영업문의 070-4077-2112 / Email. contact_at_cubrid.com
Contact Sales