溫馨提示×

WebLogic在CentOS上的集群部署實踐

小樊
52
2025-06-20 17:09:50
欄目: 智能運維

在CentOS上部署WebLogic集群涉及多個步驟,包括安裝WebLogic、配置集群、啟動集群等。以下是一個基本的指南,幫助你完成WebLogic在CentOS上的集群部署:

準備工作

  1. 安裝JDK:確保所有節點上已安裝相同版本的JDK,并配置好環境變量。
  2. 上傳WebLogic安裝包:將所有需要的WebLogic安裝包上傳到所有節點。
  3. 創建用戶和組:創建用于管理WebLogic的用戶和組。
    groupadd weblogic
    useradd -g weblogic weblogic
    passwd weblogic
    
  4. 配置主機名:編輯 /etc/hostname 文件,設置每臺服務器的主機名。
  5. 配置Java環境變量:編輯 /home/weblogic/.bash_profile 文件,添加以下內容:
    export JAVA_HOME=/path/to/jdk
    export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
    export PATH=$JAVA_HOME/bin:$PATH
    export LANG=en
    

安裝WebLogic

  1. 解壓WebLogic安裝包
    tar -zxvf wls_14.1.1.0.0_wls_lite_generic.jar
    
  2. 創建安裝目錄
    mkdir -p /WebLogic/oracle/middleware
    
  3. 配置安裝響應文件:創建 Install.rsp 文件,配置安裝選項。
    vi /WebLogic/oracle/Install.rsp
    
    示例配置:
    [ENGINE] Response File Version=1.0
    [GENERIC]
    The oracle home location. This can be an existing Oracle Home or a new Oracle Home.
    ORACLE_HOME /WebLogic/oracle/middleware
    Set this variable value to the Installation Type selected. e.g. Fusion Middleware Infrastructure, Fusion Middleware Infrastructure With Examples.
    INSTALL_TYPE WebLogic Server
    Provide the My Oracle Support Username. If you wish to ignore Oracle Configuration Manager configuration provide empty string for user name.
    MYORACLESUPPORT_USERNAME your_support_username
    Provide the My Oracle Support Password MYORACLESUPPORT_PASSWORD your_support_password
    Set this to true if you wish to decline the security updates. Setting this to true and providing empty string for My Oracle Support username will ignore the Oracle Configuration Manager configuration.
    DECLINE_SECURITY_UPDATES false
    Set this to true if My Oracle Support Password is specified.
    SECURITY_UPDATES_VIA_MYORACLESUPPORT false
    Provide the Proxy Host PROXY_HOST your_proxy_host
    Provide the Proxy Port PROXY_PORT your_proxy_port
    Provide the Proxy Username PROXY_USER your_proxy_user
    Provide the Proxy Password PROXY_PWD your_proxy_password
    Type String (URL format) Indicates the OCM Repeater URL which should be of the format [scheme[Http /Https]]: // [repeater host]:[repeater port]
    COLLECTOR_SUPPORTHUB_URL http://your_collector_hub_url
    
  4. 安裝WebLogic:使用響應文件進行安裝。
    su - weblogic
    java -jar /WebLogic/oracle/middleware/fmw_14.1.1.0.0_wls.jar -silent -invPtrLoc /etc/oraInst.loc -responseFile /WebLogic/oracle/Install.rsp
    

創建WebLogic域

  1. 創建域:在任意一個節點上執行以下命令創建域。
    cd /path/to/weblogic/user_projects/domains
    ./config.sh
    
    按照提示完成域的創建,并設置管理服務器和受管服務器的相關信息。

配置集群成員

  1. 配置集群成員:在域的配置文件中(通常是 config/config.xml),找到 <clusters> 標簽,并添加集群成員信息。例如:
    <cluster name="mycluster">
        <member name="node1" host="node1.example.com" port="7001"/>
        <member name="node2" host="node2.example.com" port="7002"/>
    </cluster>
    

啟動集群

  1. 啟動管理服務器
    cd /path/to/weblogic/installation/bin
    ./startWebLogic.sh
    
  2. 啟動托管服務器:在每臺托管服務器上執行以下命令。
    ./startManagedWebLogic.sh server1 http://admin_server_ip:7001
    ./startManagedWebLogic.sh server2 http://admin_server_ip:7001
    

驗證集群狀態

  1. 使用WebLogic控制臺:打開瀏覽器,訪問管理控制臺(URL: http://<管理服務器IP>:7001/console),驗證集群是否正常運行。
  2. 部署應用:在管理控制臺中,將應用部署到集群中的所有受管服務器。

注意事項

  • 網絡配置:確保所有節點在同一網絡中,并且可以相互通信。
  • 防火墻配置:配置防火墻以允許必要的端口通信。
  • 安全性:在生產環境中,確保使用適當的安全措施,如SSL和訪問控制。

通過以上步驟,你可以在CentOS上成功部署WebLogic集群。請根據具體需求和環境調整配置。

0
亚洲午夜精品一区二区_中文无码日韩欧免_久久香蕉精品视频_欧美主播一区二区三区美女