[Oracle]Part 2)쉽고 완벽한 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. ohs를 silent mode로 설치하기

silent 모드로 설치하기 위해서는 응답 파일(ohs_install.rsp)와 Oracle Inventory 위치를 나타내는 파일(ohs_oraInst.loc)이 필요합니다. Part 1)생성한 webtier 사용자로 접속해서 진행해야 합니다.
  • “ohs_install.rsp” 파일 생성하기
    [webtier@oel7u8 ~]$ cd /oracle/sw/ohs [webtier@oel7u8 ohs]$ vi ohs_install.rsp
    [ENGINE] Response File Version=1.0.0.0.0 [GENERIC] ORACLE_HOME=/oracle/fmw/ohs INSTALL_TYPE=Standalone HTTP Server (Managed independently of WebLogic server) DECLINE_SECURITY_UPDATES=true SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
  • “ohs_oraInst.loc” 파일 생성하기
    [webtier@oel7u8 ohs]$ vi ohs_oraInst.loc
    inventory_loc=/oracle/oraInventory/ohs inst_group=webtier
  • silent mode로 webtier 설치하기 및 결과 확인
    옵션에 지정된 파일은 절대 경로로 설정해야 합니다.
    [webtier@oel7u8 ohs]$ ./fmw_12.2.1.4.0_ohs_linux64.bin -silent -force \ > -responseFile /oracle/sw/ohs/ohs_install.rsp \ > -invPtrLoc /oracle/sw/ohs/ohs_oraInst.loc
    Launcher log file is /tmp/OraInstall2023-09-26_05-03-38PM/launcher2023-09-26_05-03-38PM.log. Checking if CPU speed is above 300 MHz. Actual 2112.002 MHz Passed Checking swap space: must be greater than 512 MB. Actual 2047 MB Passed Checking if this platform requires a 64-bit JVM. Actual 64 Passed (64-bit not required) Checking temp space: must be greater than 300 MB. Actual 2436 MB Passed Preparing to launch the Oracle Universal Installer from /tmp/OraInstall2023-09-26_05-03-38PM Log: /tmp/OraInstall2023-09-26_05-03-38PM/install2023-09-26_05-03-38PM.log Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved. Reading response file.. Skipping Software Updates Starting check : CertifiedVersions Expected result: One of redhat-7, redhat-6, oracle-6, oracle-7, SuSE-11, SuSE-12, SuSE-15 Actual Result: oracle-7.9 Check complete. The overall result of this check is: Passed CertifiedVersions Check: Success. Starting check : Packages Checking for binutils-2.23.52.0.1; found binutils-2.27-44.base.0.3.el7_9.1-x86_64. Passed Checking for compat-libcap1-1.10; found compat-libcap1-1.10-7.el7-x86_64. Passed Checking for compat-libstdc++-33-3.2.3-x86_64; found compat-libstdc++-33-3.2.3-72.el7-x86_64. Passed Checking for libgcc-4.8.2-x86_64; found libgcc-4.8.5-44.0.3.el7-x86_64. Passed Checking for libstdc++-4.8.2-x86_64; found libstdc++-4.8.5-44.0.3.el7-x86_64. Passed Checking for libstdc++-devel-4.8.2-x86_64; found libstdc++-devel-4.8.5-44.0.3.el7-x86_64. Passed Checking for sysstat-10.1.5; found sysstat-10.1.5-20.0.3.el7_9-x86_64. Passed Checking for gcc-4.8.2; found gcc-4.8.5-44.0.3.el7-x86_64. Passed Checking for gcc-c++-4.8.2; found gcc-c++-4.8.5-44.0.3.el7-x86_64. Passed Checking for ksh-...; found ksh-20120801-144.0.1.el7_9-x86_64. Passed Checking for make-3.82; found make-1:3.82-24.el7-x86_64. Passed Checking for glibc-2.17-x86_64; found glibc-2.17-326.0.9.el7_9-x86_64. Passed Checking for glibc-devel-2.17-x86_64; found glibc-devel-2.17-326.0.9.el7_9-x86_64. Passed Checking for libaio-0.3.109-x86_64; found libaio-0.3.109-13.el7-x86_64. Passed Checking for libaio-devel-0.3.109-x86_64; found libaio-devel-0.3.109-13.el7-x86_64. Passed Check complete. The overall result of this check is: Passed Packages Check: Success. Starting check : Kernel Checking for VERSION=3.8.0; found VERSION=5.4.17-2136.323.8.2.el7uek.x86_64. Passed Checking for hardnofiles=4096; found hardnofiles=65535. Passed Checking for softnofiles=4096; found softnofiles=65535. Passed Check complete. The overall result of this check is: Passed Kernel Check: Success. Starting check : TotalMemory Expected result: 1024MB Actual Result: 1680MB Check complete. The overall result of this check is: Passed TotalMemory Check: Success. Starting check : CheckJDKVersion Expected result: 1.8.0_191 Actual Result: 1.8.0_211 Check complete. The overall result of this check is: Passed CheckJDKVersion Check: Success. Validations are enabled for this session. Verifying data Copying Files Percent Complete : 10 Percent Complete : 20 Percent Complete : 30 Percent Complete : 40 Percent Complete : 50 Percent Complete : 60 Percent Complete : 70 Percent Complete : 80 Percent Complete : 90 Percent Complete : 100 The installation of Oracle HTTP Server 12.2.1.4.0 completed successfully. Unable to copy the logs to the permanent location: Unable to copy the logs to their permanent location: /oracle/oraInventory/ohs/logs/launcher2023-09-26_05-03-38PM.log (No space left on device).. The log(s) can be found here: /tmp/OraInstall2023-09-26_05-03-38PM.
    [webtier@oel7u8 ohs]$ tree -R -L 1 /oracle/fmw/ohs/
    /oracle/fmw/ohs/ ├── bin ├── cdata ├── crs ├── css ├── cv ├── has ├── install ├── inventory ├── jlib ├── ldap ├── lib ├── network ├── nls ├── ohs ├── OPatch ├── oracle_common ├── oracore ├── oraInst.loc ├── oui ├── perl ├── plsql ├── plugins ├── precomp ├── QOpatch ├── racg ├── rdbms ├── root.sh ├── slax ├── sqlplus ├── srvm ├── webgate ├── wlserver └── xdk

 

2. 도메인 및 컴포넌트 생성

  • 도메인 및 컴포넌트 위치 등 정보를 설정하는 파일(domain.py) 생성
    [webtier@oel7u8 ohs]$ vi ohs_domain.py
    selectTemplate('Oracle HTTP Server (Standalone)', '12.2.1.3.0') loadTemplates() cd('SystemComponent/ohs1') # WANTED_OHS_COMPONENT_NAME set('Name','comp1') "◀ 컴포넌트 등록" cd('/SecurityConfiguration/base_domain') set('NodemanagerUsername','webtier') set('NodemanagerPasswordEncrypted','oracle1234') cd('/') # INSTALL_DOMAIN_POSITION writeDomain('/sw/webtier/domains/orcl_domain') "◀ 도메인 설치 경로 등록" closeTemplate() exit()
  • 도메인 생성 스크립트 실행 및 결과 확인
    [webtier@oel7u8 ohs]$ cd /oracle/fmw/ohs/oracle_common/common/bin [webtier@oel7u8 bin]$ ./wlst.sh /oracle/sw/ohs/ohs_domain.py
    Initializing WebLogic Scripting Tool (WLST) ... Jython scans all the jar files it can find at first startup. Depending on the system, this process may take a few minutes to complete, and WLST may not return a prompt right away. Welcome to WebLogic Server Administration Scripting Shell Type help() for help on available commands Exiting WebLogic Scripting Tool.
    [webtier@oel7u8 bin]$ ll ~/.wlst
    total 8 -rw-r-----. 1 webtier webtier 233 Sep 26 18:30 nm-cfg-orcl_domain.props -rw-r-----. 1 webtier webtier 80 Sep 26 18:30 nm-key-orcl_domain.props
    [webtier@oel7u8 bin]$ ll /oracle/fmw/ohs/domains/orcl_domain/config/fmwconfig/components/OHS
    total 4 drwxr-x---. 5 webtier webtier 4096 Sep 26 18:12 comp1 "◀ domain.py에 설정된 컴포넌트" drwxr-x---. 3 webtier webtier 19 Sep 26 18:12 instances

 

3. NodeManager(노드 매니저) 및 Component(컴포넌트) 실행

  • 노드 매니저 및 컴포넌트를 시작하기 위한 스크립트가 저장된 디렉터리로 이동
    [webtier@oel7u8 bin]$ cd /oracle/fmw/ohs/domains/orcl_domain/bin [webtier@oel7u8 bin]$ ll
    total 32 -rwxr-x---. 1 webtier webtier 2460 Sep 26 18:12 restartComponent.sh -rwxr-x---. 1 webtier webtier 946 Sep 26 18:12 setNMJavaHome.sh -rwxr-x---. 1 webtier webtier 2450 Sep 26 18:12 startComponent.sh -rwxr-x---. 1 webtier webtier 1073 Sep 26 18:12 startNodeManager.sh -rwxr-x---. 1 webtier webtier 695 Sep 26 18:12 startRSDaemon.sh -rwxr-x---. 1 webtier webtier 2114 Sep 26 18:12 stopComponent.sh -rwxr-x---. 1 webtier webtier 997 Sep 26 18:12 stopNodeManager.sh -rwxr-x---. 1 webtier webtier 817 Sep 26 18:12 stopRSDaemon.sh
  • 노드 매니저를 Background(&)로 먼저 실행
    [webtier@oel7u8 bin]$ ./startNodeManager.sh &
    [1] 29278 [webtier@oel7u8 bin]$ NODEMGR_HOME is already set to /oracle/fmw/ohs/domains/orcl_domain/nodemanager CLASSPATH=/oracle/fmw/ohs/oracle_common/jdk/jre/lib/tools.jar:/oracle/fmw/ohs/wlserver/server/lib/weblogic.jar:/oracle/fmw/ohs/wlserver/../oracle_common/modules/thirdparty/ant-contrib-1.0b3.jar:/oracle/fmw/ohs/wlserver/modules/features/oracle.wls.common.nodemanager.jar::/oracle/fmw/ohs/wlserver/..:/oracle/fmw/ohs/wlserver/modules/features/oracle.wls.common.grizzly.jar + /oracle/fmw/ohs/oracle_common/jdk/jre/bin/java -server -Xms32m -Xmx200m -Djdk.tls.ephemeralDHKeySize=2048 -Dcoherence.home=/oracle/fmw/ohs/wlserver/../coherence -Dbea.home=/oracle/fmw/ohs/wlserver/.. -Dweblogic.RootDirectory=/oracle/fmw/ohs/domains/orcl_domain -Djava.system.class.loader=com.oracle.classloader.weblogic.LaunchClassLoader -Djava.security.policy=/oracle/fmw/ohs/wlserver/server/lib/weblogic.policy -Dweblogic.nodemanager.JavaHome=/oracle/fmw/ohs/oracle_common/jdk/jre weblogic.NodeManager -v <Sep 26, 2023 6:27:16 PM KST> <INFO> <Loading domains file: /oracle/fmw/ohs/domains/orcl_domain/nodemanager/nodemanager.domains> <Sep 26, 2023 6:27:16 PM KST> <INFO> <Loading identity key store: FileName=/oracle/fmw/ohs/domains/orcl_domain/security/DemoIdentity.jks, Type=jks, PassPhraseUsed=true> <Sep 26, 2023 6:27:16 PM KST> <INFO> <Loaded NodeManager configuration properties from '/oracle/fmw/ohs/domains/orcl_domain/nodemanager/nodemanager.properties'> Node manager v12.2.1.4.0 < > Configuration settings: DomainsFile=/oracle/fmw/ohs/domains/orcl_domain/nodemanager/nodemanager.domains LogLimit=0 DomainsDirRemoteSharingEnabled=false AuthenticationEnabled=true LogLevel=INFO DomainsFileEnabled=true ListenAddress=localhost NativeVersionEnabled=true ProcessDestroyTimeout=20000 ListenPort=5556 LogToStderr=true SecureListener=true LogCount=1 LogAppend=true StateCheckInterval=500 CrashRecoveryEnabled=false LogFile=/oracle/fmw/ohs/domains/orcl_domain/nodemanager/nodemanager.log LogFormatter=weblogic.nodemanager.server.LogFormatter ListenBacklog=50 NodeManagerHome=/oracle/fmw/ohs/domains/orcl_domain/nodemanager RestEnabled=false isLogLockingEnabled=true weblogic.startup.JavaHome=/oracle/fmw/ohs/oracle_common/jdk/jre weblogic.startup.MW_Home= coherence.startup.JavaHome=/oracle/fmw/ohs/oracle_common/jdk/jre coherence.startup.MW_Home= Domain name mappings: orcl_domain -> /oracle/fmw/ohs/domains/orcl_domain <Sep 26, 2023 6:27:16 PM KST> <INFO> <Node manager v12.2.1.4.0> <Sep 26, 2023 6:27:17 PM KST> <INFO> <Server Implementation Class: weblogic.nodemanager.server.NMServer$ClassicServer.> <Sep 26, 2023 6:27:17 PM KST> <INFO> <Secure socket listener started on port 5556, host localhost/127.0.0.1>
  • 컴포넌트 실행
    [webtier@oel7u8 bin]$ ./startComponent.sh comp1 storeUserConfig
    Starting system Component comp1 ... Initializing WebLogic Scripting Tool (WLST) ... Welcome to WebLogic Server Administration Scripting Shell Type help() for help on available commands Reading domain from /oracle/fmw/ohs/domains/orcl_domain Please enter Node Manager password: "◀ domain.py 파일에 등록한 비밀번호 입력" Creating the key file can reduce the security of your system if it is not kept in a secured location after it is created. Creating new key... The username and password that were used for this WebLogic NodeManager connection are stored in /home/webtier/.wlst/nm-cfg-orcl_domain.props and /home/webtier/.wlst/nm-key-orcl_domain.props. Connecting to Node Manager ... Successfully Connected to Node Manager. Starting server comp1 ... Sep 26, 2023 6:30:25 PM oracle.ohs.plugin.nodemanager.OhsDomain <init> INFO: Domain initialized for /oracle/fmw/ohs/domains/orcl_domain <Sep 26, 2023 6:30:25 PM KST> <INFO> <orcl_domain> <comp1> <Creating directory "/oracle/fmw/ohs/domains/orcl_domain/system_components/OHS/comp1/logs"> <Sep 26, 2023 6:30:25 PM KST> <INFO> <orcl_domain> <comp1> <Creating directory "/oracle/fmw/ohs/domains/orcl_domain/system_components/OHS/comp1/security"> <Sep 26, 2023 6:30:25 PM KST> <INFO> <orcl_domain> <comp1> <Creating directory "/oracle/fmw/ohs/domains/orcl_domain/system_components/OHS/comp1/data/nodemanager"> <Sep 26, 2023 6:30:25 PM KST> <INFO> <orcl_domain> <comp1> <Creating directory "/oracle/fmw/ohs/domains/orcl_domain/system_components/OHS/comp1/tmp"> Sep 26, 2023 6:30:25 PM oracle.ohs.plugin.nodemanager.OhsProcessManagementPlugin$ProcessImpl start INFO: Starting server comp1 Sep 26, 2023 6:30:25 PM oracle.ohs.plugin.nodemanager.OhsRunCommand execute INFO: Running /oracle/fmw/ohs/wlserver/../ohs/bin/launch httpd -DOHS_MPM_EVENT -d /oracle/fmw/ohs/domains/orcl_domain/config/fmwconfig/components/OHS/instances/comp1 -k start -f /oracle/fmw/ohs/domains/orcl_domain/config/fmwconfig/components/OHS/instances/comp1/httpd.conf Sep 26, 2023 6:30:25 PM oracle.ohs.plugin.nodemanager.OhsRunCommand runGeneric INFO: [Tue Sep 26 18:30:25.623188 2023] [so:warn] [pid 29637:tid 140214453577088] AH01574: module ossl_module is already loaded, skipping Sep 26, 2023 6:30:25 PM oracle.ohs.plugin.nodemanager.OhsRunCommand runGeneric INFO: Errors will be logged into /oracle/fmw/ohs/domains/orcl_domain/servers/comp1/logs/comp1.log Sep 26, 2023 6:30:26 PM oracle.ohs.plugin.nodemanager.OhsRunCommand execute INFO: /oracle/fmw/ohs/wlserver/../ohs/bin/launch httpd -DOHS_MPM_EVENT -d /oracle/fmw/ohs/domains/orcl_domain/config/fmwconfig/components/OHS/instances/comp1 -k start -f /oracle/fmw/ohs/domains/orcl_domain/config/fmwconfig/components/OHS/instances/comp1/httpd.conf: exit status = 0 Sep 26, 2023 6:30:26 PM oracle.ohs.plugin.nodemanager.OhsProcessHandler buildProcess INFO: Check the instance log file for more information: /oracle/fmw/ohs/domains/orcl_domain/servers/comp1/logs/comp1.log <Sep 26, 2023 6:30:28 PM KST> <INFO> <orcl_domain> <comp1> <The server 'comp1' is running now.> Successfully started server comp1 ... Successfully disconnected from Node Manager. Exiting WebLogic Scripting Tool. Done
  • 실행 결과 확인
    httpd 프로세스가 실행되고 있으면 Webtier를 정상적으로 설치한 겁니다.
    [webtier@oel7u8 bin]$ ps -el | grep httpd
    1 S 54323 29644 1 0 80 0 - 69241 poll_s ? 00:00:00 httpd 1 S 54323 29649 29644 0 80 0 - 66980 skb_wa ? 00:00:00 httpd 1 S 54323 29650 29644 0 80 0 - 141013 pipe_w ? 00:00:00 httpd 1 S 54323 29651 29644 0 80 0 - 141013 pipe_w ? 00:00:00 httpd 1 S 54323 29652 29644 0 80 0 - 255701 pipe_w ? 00:00:00 httpd
  • OHS default listen 포트(7777) 확인 및 브라우저 접속
    [webtier@oel7u8 bin]$ cd /oracle/fmw/ohs/domains/orcl_domain/config/fmwconfig/components/OHS/comp1 [webtier@oel7u8 comp1]$ vi httpd.conf
    #[Listen] OHS_LISTEN_PORT Listen 7777

    ohs default web page

  • ohs 상태 체크 스크립트 작성 및 실행
    Daily Health Check Script에 추가하면 ohs 상태를 주기적으로 점검할 수 있습니다.
    [webtier@oel7u8 comp1]$ cd /oracle/fmw/ohs/domains/orcl_domain [webtier@oel7u8 orcl_domain]$ vi ohs_status.py
    try: nmConnect('webtier','oracle1234', 'localhost', '5556','orcl_domain') nmServerStatus('comp1',serverType='OHS') exit() except Exception,e: print 'Error:', sys.exc_info()[1] exit(exitcode=1)
    [webtier@oel7u8 orcl_domain]$ vi ohs_status.sh
    /oracle/fmw/ohs/oracle_common/common/bin/wlst.sh /oracle/fmw/ohs/domains/orcl_domain/ohs_status.py 2>&1
    [webtier@oel7u8 orcl_domain]$ chmod 750 ohs_status.sh [webtier@oel7u8 orcl_domain]$ ./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.

 

4. 노드 매니저 및 컴포넌트 중지 절차

  • 컴포넌트를 먼저 중지시켜야 합니다.
    [webtier@oel7u8 orcl_domain]$ cd bin/ [webtier@oel7u8 bin]$ ./stopComponent.sh comp1
    Stopping System Component comp1 ... Initializing WebLogic Scripting Tool (WLST) ... Jython scans all the jar files it can find at first startup. Depending on the system, this process may take a few minutes to complete, and WLST may not return a prompt right away. Welcome to WebLogic Server Administration Scripting Shell Type help() for help on available commands Reading domain from /oracle/fmw/ohs/domains/orcl_domain Connecting to Node Manager ... Successfully Connected to Node Manager. Killing server comp1 ... This Exception occurred at Fri Oct 13 08:58:23 KST 2023. weblogic.nodemanager.NMException: Received error message from Node Manager Server: [OHS Server 'comp1' is not currently running]. Please check Node Manager log for details. Error: Error occurred while performing nmKill : Error killing server comp1 : Received error message from Node Manager Server: [OHS Server 'comp1' is not currently running]. Please check Node Manager log for details. Use dumpStack() to view the full stacktrace : Exiting WebLogic Scripting Tool. Done
  • 노드 매니저를 중지시킵니다.
    [webtier@oel7u8 bin]$ ./stopNodeManager.sh
    <2023-10-13 KST 08:58:29> <2023-10-13 KST 08:58:29> <2023-10-13 KST 08:58:29> <2023-10-13 KST 08:58:29> <2023-10-13 KST 08:58:29> <2023-10-13 KST 08:58:29> <2023-10-13 KST 08:58:30> /oracle/fmw/ohs/domains/orcl_domain/nodemanager/stopnodemanager.log was copied to /oracle/fmw/ohs/domains/orcl_domain/nodemanager/nodemanager.log

You may also like...

답글 남기기

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