Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2224576
  • 博文数量: 533
  • 博客积分: 8689
  • 博客等级: 中将
  • 技术积分: 7046
  • 用 户 组: 普通用户
  • 注册时间: 2010-11-26 10:00
文章分类

全部博文(533)

文章存档

2024年(2)

2023年(4)

2022年(16)

2014年(90)

2013年(76)

2012年(125)

2011年(184)

2010年(37)

分类: AIX

2013-10-16 14:57:22


Weblogic升级JDK方法.docx




 

 

SOLUTION

赵老师:

          你好~附件为Oracle官方的weblogic升级JDK的方法,可供参考。因平安的系统采取自己编制的脚本startServer.sh启动,需修改文件略有差别,以下为大致方法,仅供参考,如有问题,请与我联系,谢谢~


1.停止weblogic相关进程

2.获取需更新的JDK包,并解压至/wls/wls81/bea/


3. 修改启动weblogic的JAVA_HOME变量

[wls81@cnsz031527 PrdCSFWLDom380]$ cat servers.env|grep JAVA_HOME

VAR_JAVA_HOME:::JAVA_HOME=/wls/wls81/bea/jrockit-j2sdk1.4.2_08   --修改成新的JDK路径即可

4.重新启动weblogic

5. 验证

         Thanks & Best regards

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

平安银行 总行科技运营部  系统管理室

深圳市福田保税区市花路16号深平安银行信息科技中心2F


 

如下所示:

 

Alternatives

There are two different approaches that can be used to achieve the required goal. Both will be described briefly:

A) Installing a new JDK home, and using symbolic link to "rename" the existing and new JDK directories.

Following this approach, the JDK location originally used during the installation will not change and hence it has the minimal drawback that it might keep a versioned name as for example "$INSTALL_HOME/jdk_".

In any of the cases, this approach is simpler and less error prone than Approach B)

B) Installing a new JDK home directory and replacing the JAVA_HOME environmental variable in *** all *** the scripts referring to it.

This is the preferred approach if you want to do a partial upgrade (affecting to specific domains only, or not affecting to nodemanager), but its difficulty is around on how to know which files do refer to a JDK location.

The initial list of files to change will be :

* $INSTALL_HOME/wlserver_10.3/common/bin/commEnv.sh
* $INSTALL_HOME/user_projects/domains//bin/setDomainEnv.sh
* $INSTALL_HOME/wlserver_10.3/common/nodemanager/nodemanager.properties
* $INSTALL_HOME/utils/bsu/bsu.sh 
* $INSTALL_HOME/utils/quickstart/quickstart.sh
* $INSTALL_HOME/utils/uninstall/uninstall.sh

even that a more exhaustive way to determine them, will be to run the following command:

find . -type f -name "*.sh" -exec grep -il JAVA_HOME {} \;

Step by Step Actions

Approach A)

1) Assume the source and target locations are the following:

sourceJDK: /oracle/wls1033/jdk160_18 
targetJDK: /oracle/wls1033/jdk1.6.0_24

2) Stop all processes that use the current FMW_HOME. This refers to 

- all the AdminServer and managed_servers in all domains, 
- all the nodemanager processes running in this FMW_HOME, and
- potentially processes running Bea SmartUpgrade at that specific moment.

3) Rename directories:

a) Go to the parent directory of the source JDK:

% cd $INSTALL_HOME/

b) You can determine whether the location is a symbolic link or not by executing the command "ls -ld jdk":

% ls -ld jdk160_18

If the listed information shows jdk160_18 with attributes lrwxrwxrwx (notice the first 'l') this is a link.
If the listed information shows jdk160_18 with attributes drwxrwxrwx (notice the first 'd') this is a directory.

c) Move the existing JDK location to a "backup name", as for example:

% mv jdk160_18 jdk160_18.orig

This will rename jdk160_18 to jdk160_18.orig in either case, being it a directory or a link. 

d) And create a symbolic link like this:

% ln -s /oracle/wls1033/jdk1.6.0_24 jdk160_18

e) Validate that this step has been completed successfully by running the following command:

% $INSTALL_HOME/jdk160_18/bin/java -fullversion

If this does not return the expected version string of the installed JSDK, please check the 
validity of the symbolic link or seek additional assistance from your UNIX system administrator.

4) Only in the case that you are using WLS 10.3.6 and the targetJDK is using a certified version of JAVA 7 (version 1.7.0_x) , you will need to copy manually some jar files as follows:

Copy the following files from $INSTALL_HOME/modules to  the directory  targetJDK/jre/lib/endorsed

javax.annotation_1.0.0.0_1-0.jar

javax.xml.bind_2.1.1.jar

javax.xml.ws_2.1.1.jar

5) Restart the processes as normal, they should take the new JDK version.

Approach B)

1) Locate the involved JDK versions.

a) sourceJDK: Let's assume the JDK used is $INSTALL_HOME/jdk

For installations done with WLS platform installers (32 bit Windows, Linux, Solaris) the JDK used will be $INSTALL_HOME/jdk .
For installations done with WLS generic installer (64 bit and all other platforms) the JDK location can be any other place in the filesystem.



b) targetJDK: Lets assume the new JDK is located at /opt/newjdk

For the examples above the following are used:

sourceJDK: /oracle/wls1033/jdk160_18 
targetJDK: /oracle/wls1033/jdk1.6.0_24

2) Stop all processes that use the current FMW_HOME. This refers to 

- all the AdminServer and managed_servers in all domains, 
- all the nodemanager processes running in this FMW_HOME, and
- potentially processes running Bea SmartUpgrade at that specific moment.

3) Edit $INSTALL_HOME/wlserver_10.3/common/bin/commEnv.sh and change the JAVA_HOME location. For example, change from:

# Reset JAVA_HOME, JAVA_VENDOR and PRODUCTION_MODE unless JAVA_HOME
# and JAVA_VENDOR are pre-defined.
if [ -z "${JAVA_HOME}" -o -z "${JAVA_VENDOR}" ]; then
# Set up JAVA HOME
JAVA_HOME="/oracle/wls1033/jdk160_18"
# Set up JAVA VENDOR, possible values are
#Oracle, HP, IBM, Sun ...
JAVA_VENDOR=Sun
# PRODUCTION_MODE, default to the development mode
PRODUCTION_MODE=""
fi

To:

# Reset JAVA_HOME, JAVA_VENDOR and PRODUCTION_MODE unless JAVA_HOME
# and JAVA_VENDOR are pre-defined.
if [ -z "${JAVA_HOME}" -o -z "${JAVA_VENDOR}" ]; then
# Set up JAVA HOME
JAVA_HOME="/oracle/wls1033/jdk1.6.0_24"
# Set up JAVA VENDOR, possible values are
#Oracle, HP, IBM, Sun ...
JAVA_VENDOR=Sun
# PRODUCTION_MODE, default to the development mode
PRODUCTION_MODE=""
fi

4) For every domain, change the domain "setDomainEnv.sh" script to accommodate for the net JAVA_HOME .

For default location and default scripts, the setDomainEnv.sh will be placed here:

$INSTALL_HOME/user_projects/domains//bin/setDomainEnv.sh

Check carefully where and how the JAVA_HOME environment variable is changed as this might change accros versions.

For example in WLS 10.3.3 this will be as follows:

BEA_JAVA_HOME="/oracle/wls1033/jrockit_160_17_R28.0.0-679"
export BEA_JAVA_HOME

SUN_JAVA_HOME="/oracle/wls1033/jdk160_18"
export SUN_JAVA_HOME

if [ "${JAVA_VENDOR}" = "Oracle" ] ; then
JAVA_HOME="${BEA_JAVA_HOME}"
export JAVA_HOME
else
if [ "${JAVA_VENDOR}" = "Sun" ] ; then
JAVA_HOME="${SUN_JAVA_HOME}"
export JAVA_HOME
else
JAVA_VENDOR="Sun"
export JAVA_VENDOR
JAVA_HOME="/oracle/wls1033/jdk160_18"
export JAVA_HOME
fi
fi

And hence, the change will have to be done for SUN_JAVA_HOME, to specify the new location:

SUN_JAVA_HOME="/oracle/wls1033/jdk1.6.0_24"
export SUN_JAVA_HOME

5) Change the JDK location specified in nodemanager.properties for the default and any other existing nodemanager process:

a) Take a backup of $INSTALL_HOME/wlserver_10.3/common/nodemanager/nodemanager.properties

From:

PropertiesVersion=10.3
javaHome=/oracle/wls1033/jdk160_18
AuthenticationEnabled=true
NodeManagerHome=/oracle/wls1033/wlserver_10.3/common/nodemanager
JavaHome=/oracle/wls1033/jdk160_18/jre
LogLevel=INFO

To:

PropertiesVersion=10.3
javaHome=/oracle/wls1033/jdk1.6.0_24
AuthenticationEnabled=true
NodeManagerHome=/oracle/wls1033/wlserver_10.3/common/nodemanager
JavaHome=/oracle/wls1033/jdk1.6.0_24/jre
LogLevel=INFO

6) Replace the new JDK location on all the minor tools used in the same FMW_HOME, such as BSU, uninstall.sh, etc.

For the Bea SmartUpgrade tool $INSTALL_HOME/utils/bsu/bsu.sh

Update this line:

from
JAVA_HOME="/opt/JDK1.6.14"
to
JAVA_HOME="/oracle/wls1033/jdk1.6.0_24"

Similarly, change JAVA_HOME values for the remaining three files

* $INSTALL_HOME/utils/quickstart/quickstart.sh
* $INSTALL_HOME/utils/uninstall/uninstall.sh

7) Only in the case that you are using WLS 10.3.6 and the targetJDK is using a certified version of JAVA 7 (version 1.7.0_x) , you will need to copy manually some jar files as follows:

Copy the following files from $INSTALL_HOME/modules to  the directory  targetJDK/jre/lib/endorsed

javax.annotation_1.0.0.0_1-0.jar

javax.xml.bind_2.1.1.jar

javax.xml.ws_2.1.1.jar

8) Restart all the required processes.



阅读(3213) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~