weblogic搭建總結


目錄:

一、安裝weblogic軟件

二、創建域

三、啟動管理節點

四、創建被管理節點

五、部署應用

 

一、安裝weblogic軟件

一、關閉selinux和防火牆

service iptables stop        //關閉防火牆

setenforce 0               //臨時關閉selinux

vi /etc/selinux/config   //永久關閉,要重啟

SELINUX=enforcing改為SELINUX=disabled

二、創建普通用戶管理weblogic

groupadd app

mkdir /app 

useradd -d /app/sinova -g app sinova 

echo "sinova" | passwd --stdin sinova

三、安裝JDK

1、解壓、移動到/app/sinova/ 

      tar fx jdk1.7.0_45.tar

      mv  jdk1.7.0_45  /app/sinova/ 

2、配置JDK【聲明環境變量】

      vi .bash_profile

      # .bash_profile 

      # Get the aliases and functions

        if [ -f ~/.bashrc ]; then

        . ~/.bashrc

        fi

        # User specific environment and startup programs

        JAVA_HOME=/app/sinova/jdk1.7.0_45

        PATH=${JAVA_HOME}/bin:$PATH:$HOME/bin

        export PATH JAVA_HOME

3、測試效果

        執行:java -version

        顯示:

        java version "1.7.0_45"

        Java(TM) SE Runtime Environment (build 1.7.0_45-b18)

        Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)

四、修改 打開文件最大個數、最大進程數【root用戶操作】

1、編輯  vi /etc/security/limits.conf   

              *      soft    nofile  65535

              *      hard    nofile  65535

                     sinova soft nproc 65535

                     sinova hard nproc 65535

2、校驗

  ulimit -a

五、修改  /etc/hosts 【追加上本機具體IP127.0.0.1  對應本機主機名】

127.0.0.1            localhost

192.168.101.166    localhost

六、安裝weblogic軟件 【sinova用戶 安裝目錄 /app/sinova/oracle

********開始安裝*********

java -jar wls1033_generic.jar

Extracting 0%............................100% 【解壓縮、提取文件】

Enter [Exit][Next]> 回車【默認就是Next

Enter new Middleware Home OR [Exit][Previous][Next]> /app/sinova/oracle 【重新定義安裝目錄】

 "Middleware Home" = [/u02/weblogic]

Use above value or select another option:

    1 - Enter new Middleware Home

    2 - Change to default [/u02/weblogic/Oracle/Middleware]

Enter option number to select OR [Exit][Previous][Next]> 回車 【重新定義安裝目錄完畢,直接回車】

    Warning

/u02/weblogic directory is not empty. Proceed with installation?

Enter [Exit][Previous][Next]> 回車【警告忽略】

Provide your email address for security updates and  to initiate configuration manager.

   1|Email:[]

   2|Support Password:[]

   3|Receive Security Update:[Yes]

Enter index number to select OR [Exit][Previous][Next]> 3 【修改第3項,安全更新】

Provide your email address for security updates and  to initiate configuration manager.

    "Receive Security Update:" = [Enter new value or use default "Yes"]

Enter [Yes][No]? No 【不接受,安全更新】

 ** Do you wish to bypass initiation of the configuration manager and

    **  remain uninformed of critical security issues in your configuration?

Enter [Yes][No]? Yes【確認上面的操作】

   1|Email:[]

   2|Support Password:[]

   3|Receive Security Update:[No]

Enter index number to select OR [Exit][Previous][Next]> 回車【上面操作的回顯,直接回車】

Select the type of installation you wish to perform.

 ->1|Typical

    |  Install the following product(s) and component(s):

    | - WebLogic Server

    | - Oracle Coherence

    | - Oracle Enterprise Pack for Eclipse

   2|Custom

    |  Choose software products and components to install and perform optional

    |configuration.

Enter index number to select OR [Exit][Previous][Next]> 直接回車  第1個 典型安裝

<-------------------- Oracle Installer - WebLogic 10.3.3.0 ------------------->

JDK Selection (Any * indicates Oracle Supplied VM):

---------------------------------------------------

JDK(s) chosen for use with this product installation will be installed. Supported defaults if not deselected will be used in script string-substitution.

   1|Add Local Jdk

   2|/app/sinova/jdk1.7.0_45[x]

   *Estimated size of installation:  727.6 MB

Enter 1 to add or >= 2 to toggle selection  OR [Exit][Previous][Next]>

<-------------------- Oracle Installer - WebLogic 10.3.3.0 ------------------->

Choose Product Installation Directories:

----------------------------------------

Middleware Home Directory: [/app/sinova/Oracle]

Product Installation Directories:

   1|WebLogic Server: [/app/sinova/Oracle/wlserver_10.3]

   2|Oracle Coherence: [/app/sinova/Oracle/coherence_3.5]

Enter index number to select OR [Exit][Previous][Next]> 直接回車

<-------------------- Oracle Installer - WebLogic 10.3.3.0 ------------------->

The following Products and JDKs will be installed:

--------------------------------------------------

    WebLogic Platform 10.3.3.0

    |_____WebLogic Server

    |    |_____Core Application Server

    |    |_____Administration Console

    |    |_____Configuration Wizard and Upgrade Framework

    |    |_____Web 2.0 HTTP Pub-Sub Server

    |    |_____WebLogic SCA

    |    |_____WebLogic JDBC Drivers

    |    |_____Third Party JDBC Drivers

    |    |_____WebLogic Server Clients

    |    |_____WebLogic Web Server Plugins

    |    |_____UDDI and Xquery Support

    |    |_____Evaluation Database

    |_____Oracle Coherence

         |_____Coherence Product Files

    *Estimated size of installation: 727.7 MB

Enter [Exit][Previous][Next]> 直接回車

Enter [Exit][Previous][Next]>

Feb 14, 2015 3:32:30 AM java.util.prefs.FileSystemPreferences$1 run

INFO: Created user preferences directory.

<-------------------- Oracle Installer - WebLogic 10.3.3.0 ------------------->

Installing files..

0%          25%          50%          75%          100%

[------------|------------|------------|------------]

[***************************************************]

Performing String Substitutions...

<-------------------- Oracle Installer - WebLogic 10.3.3.0 ------------------->

Configuring OCM...

0%          25%          50%          75%          100%

[------------|------------|------------|------------]

[***************************************************]

 Creating Domains...

<-------------------- Oracle Installer - WebLogic 10.3.3.0 -------------------> 

Installation Complete 

Congratulations! Installation is complete.

Press [Enter] to continue or type [Exit]> exit【安裝完畢,退出】

<-------------------- Oracle Installer - WebLogic 10.3.3.0 ------------------->

Clean up process in progress ...

 

二、創建域

[sinova@localhost ~]$ cd /app/sinova/Oracle/wlserver_10.3/common/bin

[sinova@localhost bin]$ ./config.sh

Unable to instantiate GUI, defaulting to console mode.

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Welcome:

--------

 

Choose between creating and extending a domain. Based on your selection,

the Configuration Wizard guides you through the steps to generate a new or

extend an existing domain.

 

 ->1|Create a new WebLogic domain

    |    Create a WebLogic domain in your projects directory.  

 

   2|Extend an existing WebLogic domain

    |    Use this option to add new components to an existing domain and modify     |configuration settings.

 

Enter index number to select OR [Exit][Next]> 1 #1選擇創建一個新的domain,第2選擇使用一個已經存在的domian

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Select Domain Source:

---------------------

 

Select the source from which the domain will be created. You can create the

domain by selecting from the required components or by selecting from a

list of existing domain templates.

 

 ->1|Choose Weblogic Platform components

    |    You can choose the Weblogic component(s) that you want supported in

    |your domain.

 

   2|Choose custom template

    |    Choose this option if you want to use an existing  template. This

    |could be a custom created template using the Template Builder.

 

Enter index number to select OR [Exit][Previous][Next]> 1 #1選擇weblogic的組件

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Application Template Selection:

-------------------------------

 

    Available Templates

    |_____Basic WebLogic Server Domain - 10.3.3.0 [wlserver_10.3]x

    |_____WebLogic Advanced Web Services for JAX-RPC Extension - 10.3.3.0 [wlserver_10.3] [2]

    |_____WebLogic Advanced Web Services for JAX-WS Extension - 10.3.3.0 [wlserver_10.3] [3]

 

    ** Invalid input, not selectable

 

Enter number exactly as it appears in brackets to toggle selection OR [Exit][Previous][Next]>   #直接回車

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

Edit Domain Information:

------------------------

 

    |  Name  |    Value    |

   _|________|_____________|

   1| *Name: | base_domain |

 

 

Enter value for "Name" OR [Exit][Previous][Next]>  #更改域的名稱,這里使用默認,直接回車。

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Select the target domain directory for this domain:

---------------------------------------------------

 

    "Target Location" = [Enter new value or use default

"/app/sinova/Oracle/Middleware/user_projects/domains"]

 

Enter new Target Location OR [Exit][Previous][Next]> /app/sinova/domains   #域的安裝路徑修改為 /app/sinova/domains

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Configure Administrator User Name and Password:

-----------------------------------------------

 

Create a user to be assigned to the Administrator role. This user is the

default administrator used to start development mode servers.

 

    |          Name           |                  Value                  |

   _|_________________________|_________________________________________|

   1|         *Name:          |                weblogic                 |

   2|     *User password:     |                                         |

   3| *Confirm user password: |                                         |

   4|      Description:       | This user is the default administrator. |

 

Use above value or select another option:

    1 - Modify "Name"

    2 - Modify "User password"

    3 - Modify "Confirm user password"

    4 - Modify "Description"

 

Enter option number to select OR [Exit][Previous][Next]> 2      #修改第2項,給weblogic用戶設置密碼。密碼設置為weblogic010

 

Enter option number to select OR [Exit][Previous][Next]> 3  #修改第3項,確認密碼。

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Configure Administrator User Name and Password:

-----------------------------------------------

 

Create a user to be assigned to the Administrator role. This user is the

default administrator used to start development mode servers.

 

    "*Confirm user password:" = []

 

Enter new *Confirm user password: OR [Exit][Reset][Accept]> weblogic010

 

-----------------------------------------------

 

Create a user to be assigned to the Administrator role. This user is the

default administrator used to start development mode servers.

 

    |          Name           |                  Value                  |

   _|_________________________|_________________________________________|

   1|         *Name:          |                weblogic                 |

   2|     *User password:     |               ***********               |

   3| *Confirm user password: |               ***********               |

   4|      Description:       | This user is the default administrator. |

 

Use above value or select another option:

    1 - Modify "Name"

    2 - Modify "User password"

    3 - Modify "Confirm user password"

    4 - Modify "Description"

    5 - Discard Changes

 

Enter option number to select OR [Exit][Previous][Next]>   #直接回車

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Domain Mode Configuration:

--------------------------

 

Enable Development or Production Mode for this domain.

 

 ->1|Development Mode

 

   2|Production Mode

 

Enter index number to select OR [Exit][Previous][Next]> 2  #1是開發模式,我們選擇2,生產模式

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Java SDK Selection:

-------------------

 

 ->1|Sun SDK 1.6.0_45 @ /app/sinova/jdk1.6.0_45

   2|Other Java SDK

 

Enter index number to select OR [Exit][Previous][Next]>  #選擇JDK,直接回車

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Select Optional Configuration:

------------------------------

 

   1|Administration Server [ ]

   2|Managed Servers, Clusters and Machines [ ]

   3|RDBMS Security Store [ ]

 

Enter index number to select OR [Exit][Previous][Next]> 1 #選擇1,只配置Admin Server,其它可以以后在控制台配置。

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Select Optional Configuration:

------------------------------

 

   1|Administration Server [x]

   2|Managed Servers, Clusters and Machines [ ]

   3|RDBMS Security Store [ ]

 

Enter index number to select OR [Exit][Previous][Next]>  #回車確認

 

Configure the Administration Server:

------------------------------------

 

Enter adminstration server configurations. Each WebLogic Server domain must

have one Administration Server. The Administration Server hosts the

Administration Console which is used to perform administrative tasks.

 

    |       Name       |        Value        |

   _|__________________|_____________________|

   1|      *Name:      |     AdminServer     |

   2| *Listen address: | All Local Addresses |

   3|   Listen port:   |        7001         |

   4| SSL listen port: |         N/A         |

   5|   SSL enabled:   |        false        |

 

Use above value or select another option:

    1 - Modify "Name"

    2 - Modify "Listen address"

    3 - Modify "Listen port"

    4 - Modify "SSL enabled"

 

Enter option number to select OR [Exit][Previous][Next]>  #回車確認,使用默認的端口7001

 

<------------------- Fusion Middleware Configuration Wizard ------------------>

 

Creating Domain...

 

0%          25%          50%          75%          100%

[------------|------------|------------|------------]

[***************************************************]

 

**** Domain Created Successfully! ****

配置完成。

 

三、啟動管理節點

一、管理服務器----認證管理

[sinova@localhost ~]$ cd /app/sinova/domains/base_domain/servers/AdminServer這個要手動起之后才會有這個目錄

[sinova@localhost AdminServer]$ mkdir security

[sinova@localhost AdminServer]$ cd security/

[sinova@localhost security]$ vi boot.properties

username=weblogic

password=weblogic010

二、創建目錄【后面腳本會使用到】

mkdir -p /app/sinova/bin

mkdir -p /app/sinova/logs/www

三、編寫 管理服務器啟動腳本【管理節點給1G內存】

1cd /app/sinova/bin

2vi restart-admin.sh

#!/bin/bash

DATE=`date +%Y%m%d`

USER_MEM_ARGS="-Xms1024m -Xmx1024m -XX:MaxPermSize=256m"

export USER_MEM_ARGS JAVA_OPTIONS

ps -ef | grep java | grep weblogic | grep AdminServer | awk '{print $2}' | xargs kill -9 > /dev/null 2>&1

nohup /app/sinova/domains/base_domain/bin/startWebLogic.sh > /app/sinova/logs/www/admin-${DATE}.log 2>&1 &    ##weblogic安裝啟動文件

3、chmod +x restart-admin.sh

4、執行  ./restart-admin.sh

5、登錄控平台   http://192.168.101.166:7001/console               【用戶:  weblogic  密碼:  weblogic010

附上:啟動管理節點出錯的情況  我們手動起 先改這個配置

啟動報錯1【修改  vi /app/sinova/Oracle/wlserver_10.3/common/bin/commEnv.sh

Exception in thread "Timer-1"

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Timer-1"

Exception in thread "[STANDBY] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'"

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "[STANDBY] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'"

Exception in thread "DynamicListenThread[Default]"

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "DynamicListenThread[Default]"

./startWebLogic.sh: line 175: 58635 Killed                  ${JAVA_HOME}/bin/java ${JAVA_VM} ${MEM_ARGS} -Dweblogic.Name=${SERVER_NAME} -Djava.security.policy=${WL_HOME}/server/lib/weblogic.policy ${JAVA_OPTIONS} ${PROXY_SETTINGS} ${SERVER_CLASS}

修改:【第152行,原 JAVA_VM=-jrockit

148 # Set up JVM options base on value of JAVA_VENDOR

149 if [ "$PRODUCTION_MODE" = "true" ]; then

150   case $JAVA_VENDOR in

151   Oracle)

152     JAVA_VM=-server

153     MEM_ARGS="-Xms128m -Xmx256m"

 

啟動報錯2【修改 /etc/hosts,增加上本機IP127.0.0.1

<Jan 29, 2015 11:57:23 AM CST> <Error> <Security> <BEA-090870> <The realm "myrealm" failed to be loaded: weblogic.security.service.SecurityServiceException: java.lang.ExceptionInInitializerError.

weblogic.security.service.SecurityServiceException: java.lang.ExceptionInInitializerError

at weblogic.security.service.CSSWLSDelegateImpl.initializeServiceEngine(CSSWLSDelegateImpl.java:342)

at weblogic.security.service.CSSWLSDelegateImpl.initialize(CSSWLSDelegateImpl.java:221)

at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.InitializeServiceEngine(CommonSecurityServiceManagerDelegateImpl.java:1783)

at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initializeRealm(CommonSecurityServiceManagerDelegateImpl.java:442)

at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.loadRealm(CommonSecurityServiceManagerDelegateImpl.java:840)

Truncated. see log file for complete stacktrace

 

Caused By: java.lang.ExceptionInInitializerError

at com.octetstring.vde.util.guid.GuidGenerator.nextGuidInBytes(GuidGenerator.java:125)

at com.octetstring.vde.util.guid.Guid.<init>(Guid.java:84)

at com.octetstring.vde.backend.standard.BackendStandard.add(BackendStandard.java:379)

at com.octetstring.vde.backend.BackendHandler.add(BackendHandler.java:460)

at com.octetstring.vde.util.LDIF.importLDIF(LDIF.java:279)

Truncated. see log file for complete stacktrace

 

Caused By: java.lang.NullPointerException

at java.lang.System.arraycopy(Native Method)

at com.octetstring.vde.util.guid.GuidParamGenerator.generateNodeID(GuidParamGenerator.java:47)

at com.octetstring.vde.util.guid.GuidStateManager.initializeGUIDParameters(GuidStateManager.java:59)

at com.octetstring.vde.util.guid.GuidStateManager.<init>(GuidStateManager.java:30)

at com.octetstring.vde.util.guid.GuidStateManager.<clinit>(GuidStateManager.java:23)

Truncated. see log file for complete stacktrace

>

<Jan 29, 2015 11:57:23 AM CST> <Notice> <Security> <BEA-090082> <Security initializing using security realm myrealm.>

<Jan 29, 2015 11:57:23 AM CST> <Critical> <WebLogicServer> <BEA-000362> <Server failed. Reason:

 

There are 1 nested errors:

 

weblogic.security.service.SecurityServiceRuntimeException: [Security:090399]Security Services Unavailable

at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.doBootAuthorization(CommonSecurityServiceManagerDelegateImpl.java:916)

at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initialize(CommonSecurityServiceManagerDelegateImpl.java:1050)

at weblogic.security.service.SecurityServiceManager.initialize(SecurityServiceManager.java:875)

at weblogic.security.SecurityService.start(SecurityService.java:141)

at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)

at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)

at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

 

啟動報錯3【內存不夠,使用我編寫的啟動腳本就不會報錯了】

<Feb 14, 2015 3:43:56 AM CST> <Error> <JMX> <BEA-149500> <An exception occurred while registering the MBean com.bea:ServerRuntime=AdminServer,Name=AdminServer,Type=SingleSignOnServicesRuntime.

java.lang.OutOfMemoryError: PermGen space

        at java.lang.ClassLoader.defineClass1(Native Method)

        at java.lang.ClassLoader.defineClass(ClassLoader.java:800)

        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)

        at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)

        at java.net.URLClassLoader.access$100(URLClassLoader.java:71)

        Truncated. see log file for complete stacktrace

>

<Feb 14, 2015 3:43:58 AM CST> <Error> <JMX> <BEA-149500> <An exception occurred while registering the MBean com.bea:ServerRuntime=AdminServer,Name=DataRetirementWorkManager,Type=MaxThreadsConstraintRuntime.

java.lang.OutOfMemoryError: PermGen space

        at java.lang.Class.getDeclaredConstructors0(Native Method)

        at java.lang.Class.privateGetDeclaredConstructors(Class.java:2493)

        at java.lang.Class.getConstructor0(Class.java:2803)

        at java.lang.Class.getDeclaredConstructor(Class.java:2053)

        at weblogic.management.provider.internal.BeanInfoAccessImpl.buildBeanInfo(BeanInfoAccessImpl.java:400)

        Truncated. see log file for complete stacktrace

四、創建被管理節點

一、登錄控制台

http://192.168.101.166:7001/console

用戶:  weblogic  密碼:  weblogic010

 

 

 

二、創建集群

點擊“鎖定並編輯”,接下來可新建服務器或集群。

 

 

 

點擊“新建”

 

 

 

點擊“下一步”

 

 

 

節點2創建方法和節點1一樣

 

 

狀態為“unknown”,這是因為還沒啟動節點。

點擊“激活更改”保存配置。 

 

三、被管理服務器----密碼認證

cd /app/sinova/domains/base_domain/bin

vi startManagedWebLogic.sh

 [查找,並修改,如下]

WLS_USER="weblogic"

export WLS_USER

WLS_PW="weblogic010"

export WLS_PW

 

四、編寫重啟被管理節點腳本

cd /app/sinova/bin

1、vi restart_redgift_node1.sh

#!/bin/bash

DATE=`date +%Y%m%d`

WLS_NODE="redgift_node1"    【換成對應的Note名稱】

USER_MEM_ARGS="-Xms1024m -Xmx1024m -XX:MaxPermSize=512m"

JAVA_OPTIONS="-DUseSunHttpHandler=true"

ServiceIP=192.168.101.166 【管理服務器IP

export USER_MEM_ARGS JAVA_OPTIONS WLS_NODE ServiceIP

ps -ef | grep java | grep weblogic | grep -w ${WLS_NODE} | awk '{print $2}' | xargs kill -9 > /dev/null 2>&1

rm -rf /app/sinova/domains/base_domain/servers/${WLS_NODE}/tmp/*

sleep 1

nohup /app/sinova/domains/base_domain/bin/startManagedWebLogic.sh ${WLS_NODE} http://192.168.101.166:7001/ >/app/sinova/logs/www/${WLS_NODE}-${DATE}.log 2>&1 & 【這里的ip是管理服務器的ip和端口】

2vi restart_redgift_all.sh 

#!/bin/bash

/app/sinova/bin/restart_redgift_node1.sh

/app/sinova/bin/restart_redgift_node2.sh

3、授權   chmod +x *.sh 

4、執行啟動所有節點  ./restart_redgift_all.sh

五、控制台查看節點狀態

 

 

五、部署應用

  1. 新建應用目錄:

  [sinova@localhost ~]$ cd /app/sinova/

  [sinova@localhost ~]$ mkdir application

  1. 上傳應用至application目錄並解壓
  2. 將解壓后的應用同步至其它節點
  3. 控制台上部署應用:

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM