[Oracle]Part 5)쉽고 완벽한 Weblogic과 Webtier 설치하기

일반적으로 Oracle WebLogic Server(wls)는 Java EE 애플리케이션을 실행하고 관리하는 데 사용되며, Oracle Webtier(ohs, Oracle HTTP Server)는 정적 및 동적 웹 콘텐츠를 서비스하고 보안 기능을 제공하여 웹 애플리케이션 환경을 보완합니다. 이 두 제품은 혼합하여 사용되어 Java 애플리케이션을 실행하고 프론트 엔드 웹 서버로부터 요청을 처리하는 효율적인 웹 애플리케이션 스택을 구축하는 데 도움을 줍니다. Oracle Database 11gR2가 설치된 VM(oel7.8)에 wls와 ohs를 설치하도록 하겠습니다.

  1. Part 1. 설치 준비하기
  2. Part 2. ohs(Oracle HTTP Server) 설치하기
  3. Part 3. wls(Weblogic Server) 설치하기
  4. Part 4. 응용 프로그램 배치
  5. Part 5. 클러스터 구성
  6. Part 6. 데이터 소스 연결

1. 새 클러스터 생성

  • “클러스터” 메뉴 선택 → “잠금 및 편집” 버튼 클릭 → ‘새로 만들기 > 클러스터” 메뉴를 선택합니다
  • “새 클러스터 생성” 화면에서 이름(Cluster1)을 입력하고, 메시징 모드는 “유니캐스트”를 선택하고 “확인” 버튼을 클릭합니다.
  • 기본 로드 알고리즘은 “라운드 로빈” 방식으로 설정되며, “변경 내용 활성화” 버튼을 클릭하여 반영합니다.

 

2. 등록된 Managed Server들을 클러스터링

  • “환경 > 서버” 메뉴로 이동하여 클러스터링할 Managed Server들의 상태를 확인합니다. 상태가 “SHUTDOWN”이 아니면 아래와 같이 “지금 강제 종료”를 선택하여 “SHUTDOWN” 상태로 변경합니다.


  • 위 화면에서 “Server1″을 클릭하고 “잠금 및 편집” 버튼을 클릭, “일반” 메뉴 탭으로 이동한 후 클러스터 필드에서 “Cluster1″을 선택하고 “저장” 버튼을 클릭합니다.
  • “Server2″도 동일한 방법으로 클러스터를 지정하고 “변경 내용 활성화” 버튼을 클릭합니다.
  • Managed Server(Server1/Server2)를 다시 실행합니다.
    [weblogic@oel7u8 scripts]$ ./startServer1.sh
    [weblogic@oel7u8 scripts]$ ./startServer2.sh
    

 

3. 클러스터링을 적용하기 위해 응용 프로그램 업데이트

  • 응용 프로그램의 “weblogic.xml” 파일 수정
    [root@oel7u8 /]# cd /app/installtest/WEB-INF/ [root@oel7u8 WEB-INF]# vi weblogic.xml
    <!-- <session-descriptor> <timeout-secs>3600</timeout-secs> <invalidation-interval-secs>60</invalidation-interval-secs> <persistent-store-type>memory</persistent-store-type> <url-rewriting-enabled>true</url-rewriting-enabled> </session-descriptor> --> <!-- 아래 내용 추가 --> <session-descriptor> <persistent-store-type>replicated_if_clustered</persistent-store-type> <timeout-secs>3600</timeout-secs> <cookie-name>JSESSIONID</cookie-name> </session-descriptor>
  • 배포된 응용 프로그램 업데이트





 

4. 브라우저에서 응용 프로그램의 Session 페이지 접속

  • 7101 포트와 7102 포트가 세션 정보를 공유하는 것을 확인할 수 있습니다.

 

5. Weblogic 클러스터와 Webtier 연결

  • wls와 ohs간의 통신을 구성하는 환경 설정 파일(mod_wl_ohs.conf)을 변경합니다.
    [webtier@oel7u8 comp1]$ pwd /oracle/fmw/ohs/domains/orcl_domain/config/fmwconfig/components/OHS/comp1 [webtier@oel7u8 comp1]$ vi mod_wl_ohs.conf
    # NOTE : This is a template to configure mod_weblogic. LoadModule weblogic_module "${PRODUCT_HOME}/modules/mod_wl_ohs.so" # This empty block is needed to save mod_wl related configuration from EM to this file when changes are made at the Base Virtual Host Level <IfModule weblogic_module> # WebLogicHost # WebLogicPort MatchExpression * WeblogicCluster 192.168.56.104:7101, 192.168.56.104:7102 </IfModule> #<Location /> # SetHandler weblogic-handler # PathTrim /weblogic # ErrorPage http:/WEBLOGIC_HOME:WEBLOGIC_PORT/ #</Location>
  • ohs의 default port를 변경합니다(7777 → 80). 오라클의 웹 문서를 잠고하세요.
    [webtier@oel7u8 comp1]$ vi httpd.conf
    #[Listen] OHS_LISTEN_PORT #Listen 7777 Listen 80 User webtier Group webtier #ServerName http://oel7u8:7777 ServerName http://192.168.56.104:80
  • 80포트를 사용하기 위해서는 launch 파일의 소유권을 root 사용자로 변경해야 합니다.
    [webtier@oel7u8 comp1]$ cd /oracle/fmw/ohs/ohs/bin [webtier@oel7u8 bin]$ ll
    total 3580 -rwxr-x---. 1 webtier webtier 347967 Sep 12 2019 ab -rwxr-x---. 1 webtier webtier 6900 Sep 12 2019 apr-1-config -rwxr-x---. 1 webtier webtier 6516 Sep 12 2019 apu-1-config -rwxr-x---. 1 webtier webtier 24444 Sep 12 2019 apxs -rwxr-x---. 1 webtier webtier 320737 Sep 12 2019 htcacheclean -rwxr-x---. 1 webtier webtier 347100 Sep 12 2019 htpasswd -rwxr-x---. 1 webtier webtier 1291910 Sep 12 2019 httpd -rwxr-x---. 1 webtier webtier 307203 Sep 12 2019 httxt2dbm -rwxr-x---. 1 webtier webtier 36712 Sep 12 2019 launch -rwxr-x---. 1 webtier webtier 230580 Sep 12 2019 logresolve -rwxr-x---. 1 webtier webtier 428829 Sep 12 2019 odl_rotatelogs -rwxr-x---. 1 webtier webtier 292157 Sep 12 2019 rotatelogs -rwxr-x---. 1 webtier webtier 118 Sep 12 2019 version.txt
    [webtier@oel7u8 bin]$ cp launch launch.bak [webtier@oel7u8 bin]$ su root
    Password:
    [root@oel7u8 bin]# chown root:webtier launch [root@oel7u8 bin]# chmod 4750 launch [root@oel7u8 bin]# ll
    total 3616 -rwxr-x---. 1 webtier webtier 347967 Sep 12 2019 ab -rwxr-x---. 1 webtier webtier 6900 Sep 12 2019 apr-1-config -rwxr-x---. 1 webtier webtier 6516 Sep 12 2019 apu-1-config -rwxr-x---. 1 webtier webtier 24444 Sep 12 2019 apxs -rwxr-x---. 1 webtier webtier 320737 Sep 12 2019 htcacheclean -rwxr-x---. 1 webtier webtier 347100 Sep 12 2019 htpasswd -rwxr-x---. 1 webtier webtier 1291910 Sep 12 2019 httpd -rwxr-x---. 1 webtier webtier 307203 Sep 12 2019 httxt2dbm -rwsr-x---. 1 root webtier 36712 Sep 12 2019 launch -rwxr-x---. 1 webtier webtier 36712 Oct 13 13:14 launch.bak -rwxr-x---. 1 webtier webtier 230580 Sep 12 2019 logresolve -rwxr-x---. 1 webtier webtier 428829 Sep 12 2019 odl_rotatelogs -rwxr-x---. 1 webtier webtier 292157 Sep 12 2019 rotatelogs -rwxr-x---. 1 webtier webtier 118 Sep 12 2019 version.txt
    [root@oel7u8 bin]# exit
    exit
  • ohs를 다시 시작합니다.(컴포넌트 중지 → 노드 매니저 중지 → 노드 매니저 시작 → 컴포넌트 시작)
    [webtier@oel7u8 bin]$ cd /oracle/fmw/ohs/domains/orcl_domain/bin
    [webtier@oel7u8 bin]$ ./stopComponent.sh comp1
    [webtier@oel7u8 bin]$ ./stopNodeManager.sh
    [webtier@oel7u8 bin]$ ./startNodeManager.sh &
    [webtier@oel7u8 bin]$ ./startComponent.sh comp1 storeUserConfig
    
  • ohs의 상태를 체크합니다.
    만일 “RUNNING”이 아니라 “FAILED”라는 메세지가 출력되면 wls와 ohs를 재가동해 봅니다.

    [webtier@oel7u8 bin]$ ../ohs_status.sh
    Initializing WebLogic Scripting Tool (WLST) ... Welcome to WebLogic Server Administration Scripting Shell Type help() for help on available commands Connecting to Node Manager ... Successfully Connected to Node Manager. RUNNING Exiting WebLogic Scripting Tool.
  • 브라우저에서 http://192.168.56.104로 접속되는지 확인합니다.

You may also like...

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다