在RAD/RSA上安装配置Portal 6.0 和优化性能并减少资源消耗的方法

如何让这些应用软件工作在一起

 

 Portal 6.0 服务器并不是和Portal 5服务器遵循相同的设计架构。对于Portal 6.0,IBM并没有提供专门用于Rational产品上的精简测试环境,而是直接使用一个完整的Portal 6.0 服务器。

 

对于安装在同一台机器上的Portal 5服务器测试环境将诸如自动重载成果物、热代码切换等功能启用。这意味着你可以直接使用Portal 5 服务器的这些便利功能进行开发而不用受任何其它限制条件。然而,这也同样意味着当你将一个完整的Portal 6.0实例安装在你的开发机器上时,它会吞噬掉你的很多资源。

 

本文的目的是提供一些要点,用来解决如何减少Portal 6.0在你机器上所消耗的资源和如何在基于你的开发需求的基础上来优化性能。本文还包含了一些其它安装配置信息,如果你想使用Rational的产品来开发WebSphere Portal 6.0的项目,它们对你来说应该是非常有用的。

 

本文用到的术语

 

为了避免重复使用长名字,本文使用了以下缩写名词:

  • Rational软件:或指Rational Application Developer(RAD) V7.0或指Rational Software Architect(RSA) V7.0,或两者都是。
  • Portal or portal, 如无其它特别说明,意指 WebSphere Portal V6.0.
  • WebSphere,  如无其它特别说明,意指IBM® WebSphere® Application Server V6.0(WAS),它是用来运行Portal 。
  • Linux ® 意指WebSphere Portal V6.0所支持的Linux操作系统和任何其它类似UNIX®的操作系统,例如IBM® AIX® 或Sun® Solaris™.

当提到磁盘位置时,以下目标路径是指:

  • WAS_HOME: WebSphere Application Server V6.0的安装目录。
  • WPS_HOME: WebSphere Portal Server V6.0 is 的安装目录。
  • WP_PROFILE: WebSphere Portal WebSphere server profile的目录。

安装要点

 

主机名

 

如果你安装的Portal将被其它机器的开发者使用,那么你输入的主机名必须是其它机器可以解析到的名称。因此,最好是用一个有效的主机名或IP地址,如图1所示。


图1:WebSphere Application Server的属性

 
为了测试你选择的名称是否可用,你可以在其它一台机器上试着ping一下你在安装向导中输入的主机名。如果可以成功ping通,那们你就可使用这个名称。

 

如果只是在本地使用,也就说portal 和 rational 软件在同一台机器上,想到所用的默认名称一般都是可以的。

 

WebSphere业务流程支持

 

WebSphere业务流程支持的启用和禁用是通过WebSphere流程服务器在安装过程中(见图2)控制的。在WebSphere Portal V6.0中,你无法再安装完成后启用或禁用它。因此,如果你需要更改它,你必须重新安装Portal服务器。

 

图2:安装过程中安装业务流程支持的选项


  

安装业物流支持意味着会增加服务器的启动时间。尽管Portal 6.0开发工具在理想情况下时无需重起服务器的,但也难免偶尔开发这需要重起服务器。因此,最好不要安装业务流程支持,除非确实需要。

 

减少启动时间

 

注:在本段中提到的方法请勿用于生产环境,因为IBM对此并不提供支持。这些方法也仅用于帮助开发人员题缩短在用本地机器上的开发周期。能够优化通过正常方式安装的portal的长期运行性能的配置方法,与缩短启动时间的方法相比较,开发人员可能对前者更感兴趣。正如前面说的,Rational软件对Portal 6.0 的支持在正常情况下是不需要重起服务器的,但难免偶尔会有开发人员需要重启服务器。庆幸地,有办法可以有效地减少portal启动时花费的时间。

 

如何启用开发方式

 

启用开发模式的第一步你可以在管理控制台完成。如果你想通过Rational软件来启动服务器,那么这一步就没有必要了,因为该软件会自动完成。如果在安装portal服务器的机器上没有Rational软件,那么你讲必须通过管理控制抬手动完成以下这些步骤:

  1. 打开管理控制台并进入到应用服务器 > WebSphere_Portal, 然后选中以开发方式运行的复选框(见图3)。 图3:选中以开发方式运行

     
  2. 接下来, 将StartupPerformanceConfig.zip文件——见 下载 ——到WPS_HOME/config目录下。 该zip文件包含了用来禁用一些非必要portal组件的脚本。
  3. 在你能够运行这些脚本之前,你必须要正确的配置WPS_HOME/config/wpconfig.properties文件。使用一个标准的文本编辑器打开此文件然后确认以下这些变量的值是正确的(在portal安装过程中你它们输入的值):
    • WasUserid: WebSphere Application Server 安全认证用户标识
    • WasPassword: WebSphere Application Server 安全认证密码
    • PortalAdminId: WebSphere portal 管理员标识
    • PortalAdminPwd: WebSphere portal 管理员密码
  4. 当这些值被正确设置好后,你可以使用一下命令来运行:
    • Microsoft® Windows®: WPS_HOME\config\WPSconfig.bat <目标>
    • Linux: WPS_HOME/config/WPSconfig.sh <目标>

     <目标> 从以下中选择:

  • action-disable-target-mapping-portlets: portal提供的所有portlet应用
  • action-disable-target-mapping-pzn: 禁用所有个性化的应用
  • action-disable-target-mapping-caiwcm: 禁用所有计算机辅助向导(CAI)和内容管理(WCM)应用
  • action-disable-target-mapping-misc: 各种应用

通过将目标中的“disable”替换为“enable”然后运行相同命令,可以将这些逐渐重新启用。因此,例如,禁用个性化应用,你会运行一下命令(在windows里):

WPS_HOME\config\WPSconfig.bat action-disable-target-mapping-pzn

如果你之后你想重新启用个性化,你将使用此命令:
WPS_HOME\config\WPSconfig.bat action-enable-target-mapping-pzn

注:

如果你禁用了个性化、CAI和WCM或各种应用,那么它们在服务器上就不再可用了。In contrast, disabling the portlet applications does not make them unavailable. It simply defers loading them until they are actually needed.

Debug mode

Starting the server in debug mode is required if you want to be able to debug your applications from Rational software but running in debug mode results in a performance hit especially in the startup time. As well as the generic startup improvements of the previous section there is another step you can take which improves the startup time when running in debug mode. If you intend on starting the server in debug from Rational software then you may skip this section as Rational software automatically performs this optimization. If the server is on a remote machine which does not have a Rational software installation then you should use this.

  1. To configure a server to start in debug mode, click the Debugging Service properties link in the Application servers > WebSphere_Portal panel (see Figure 4).

Figure 4. Setting Debugging Service properties


 

  1. Then select the Enable service at server startup check box (see Figure 5).

Figure 5. Enabling the Debugging Service


 

  1. When you have done this, you can optimize the debug mode startup by tweaking the Java™ Virtual Machine (JVM) arguments for the portal, as Figure 6 shows:
    1. First expand the Java™ and Process Management item in the WebSphere_Portal panel.
    2. Then and click Process Definition.

Figure 6. Optimizing debug mode startup


 
 

Tip: Notice that the ‘Run in development mode’ checkbox is selected as per the instructions in the previous section).

  1. In the Process Definition panel (Figure 7), click the link for Java Virtual Machine properties:

Figure 7. Process Definition panel
 

  1. In the Debug arguments field, add the argument –Xj9 so that the field value is as Listing 1 shows (assuming defaults for other arguments).

Listing 1. Adding a debug argument

 

                
-Djava.compiler=NONE -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=
n,address=7777 -Xj9

  

  1. The –Xj9 switch improves performance, but it interferes with two arguments in Generic JVM arguments. To remedy this, you need to remove the –Xp???k,??k and –Xk????? arguments, which by default are: -Xp128k,64k -Xk40000. This makes the field value for Generic JVM arguments what you see in Listing 2, assuming defaults for other arguments. (See Figure 8 also.)

Listing 2. Adding a debug argument

 

                
${WPS_JVM_ARGUMENTS_EXT} -Ddb2j.system.home=${WPS_HOME}/cloudscape

 Figure 8. Deleting debug mode arguments

 

  1. After you have done this, save your configuration to the master configuration and restart the server. The server will now be in debug mode, and its startup will have taken less time than if you had not tweaked the JVM settings.

Backup and recovery

Rational software operates directly on the portal server. Therefore, it may be useful to be able to save a particular configuration and to be able to restore it if your server becomes unstable or if you want to restore the portal to a certain state.

Backing up and restoring the portal

It is important that you make backups of two directories in your portal installation.

  • The first is the WebSphere profile directory for the portal profile. On Windows. this defaults to the C:\ibm\WebSphere\profiles\wp_profile, and on Linux, it defaults to the WAS_HOME/profiles/wp_profile. A WebSphere profile defines the runtime environment for the server, such as what applications to run, what the security settings are, and what data sources are defined.
  • The second useful backup directory is the portal database directory, which defaults to WPS_HOME/cloudscape on both Windows and Linux. This directory contains the database that defines the layout of the portal.

When restoring either of these backups, you will need to stop your server, delete the current contents of the directory, and then copy the contents of the backup into the now empty directory. After doing this, you can start your server again, and the portal that you backed up should be restored. You can backup and restore these directories individually, but it is far better that you backup and restore both of them together and at the same time, because there are certain elements in each that rely on elements in the other.

Reinstalling the portal

You should use the Portal uninstaller to remove a Portal installation from the machine but in certain cases such as an aborted installation this may not work. If you want to make sure that your machine is clean before reinstalling Portal and then take the following steps:

  1. If the WPS_HOME directory exists then delete it and its contents.
  2. If the WAS_HOME directory exists then delete it and its contents.
  3. If your profiles directory is not stored under WAS_HOME then you need to delete this directory as well. This is likely to occur on Windows where the default location is C:\ibm\WebSphere\profiles irrespective of where you have installed Portal or WebSphere.
  4. Windows only: Open the Registry Editor and delete these keys:
    • HKEY_LOCAL_MACHINE\SOFTWARE\IBM\WebSphere Portal Server\6.0.0.0
    • HKEY_LOCAL_MACHINE\SOFTWARE\IBM\WebSphere Application Server Network Deployment\6.0.0.0
  5. Locate the vpd.properties file. In Windows, this is in C:\Windows or C:\WinNT, and in Linux, it is in /root. Edit this file to remove any entries that refer to a location in WPS_HOME or WAS_HOME for the portal that you are trying to uninstall. Alternatively, you can just delete this file, but that advisable only if you have no other portal installations of any version on this machine.
  6. In your home directory (for example, /root on Linux or C:\Documents And Settings\<username> on Windows), delete these three files if they exist. Note that on Linux these files may be hidden, because they start with a period. Ensure that this is not the case.
    • .ITLMRegistry
    • ._cie.trace.xml.lck
    • .WebSphereRegistry

Other ways to optimize performance

There are various other changes or tweaks that can improve stability and functionality. Among the most important to know about are how to switch the wps.ear file and how to control caches to boost performance.

Change the JAR file

Rational software requires the main portal enterprise application, wps.ear, to be running for its tools to work. In cases where this application is not working or has become corrupt, the software attempts to automatically restore it from the wps.ear file in WPS_HOME/installableApps/wps.ear. Part of this wps.ear archive is a Java™ Archive (JAR) file that the portal uses, wp.scheduler.ejb.jar. The version of this JAR in the wps.ear file in installableApps has not been prepared for deployment in Portal 6.0. Therefore, when Rational software needs to restore the portal from this file, this Enterprise JavaBeans™ (EJB™ technology will not get correctly deployed, so you may see console exceptions or odd behavior from the portal.

To fix this wps.ear file, replace the version of the wp.scheduler.ejb.jar file with the version of the file that you find in the WP_PROFILE/installedApps/wps.ear directory.

  • On Windows, WP_PROFILE is, by default, C:\ibm\WebSphere\profiles\wp_profile.
  • On Linux, it is WAS_HOME/profiles/wp_profile.

You can distinguish a prepared version of this JAR from an unprepared version by their file sizes. The prepared version of the JAR, which you find in the installedApps directory, should be 104 KB, and the unprepared version in the wps.ear file in installableApps is 44 KB.

Control caches

WebSphere Portal 6 contains many caching services that help to boost long-term performance when the server is being used in a production environment. In a development environment, long-term performance of the server is not likely to be a priority, and content will change more frequently, thus the caches can become a hindrance rather than a help.

You can control which caches are enabled by editing the CacheManagerService.properties file, which is contained within the WPS_HOME/shared/app/wp.services.properties.jar file. The first group of settings in this file are the global cache settings. (See Listing 3.)

Listing 3. Sample code listing at maximum width

 

                
#######################################################
######################
#
# Global settings. These can be overridden for individual caches.
# The evaluation order for parameters is:
#       1. Parameters given when requesting a cache (in the program code)
#       2. Parameters for the cache given in this files (see last part of file)
#       3. The following list of default values.
#
#######################################################
######################

# Is caching enabled? [specify true, yes (or false, no)]
#
# Default: true
cacheglobal.enabled=true

# Default cache size, in number of entries
#
# Default: 1000
cacheglobal.size=1000

# Cache sharing
# 
# Default: false
cacheglobal.shared=false

# Shall cacheinstances use java.lang.ref.SoftReferences to hold
# cacheentries or not. This can be turned on/off for each individual instance
#
# Default: false
cacheglobal.softref=false

 

  

These settings are used to specify the settings for caches that do not have their own entries in the file. Because, by default, all caches have entries, modifying this has no effect unless you delete the cache entries later on in the file. To enable or disable a cache, locate its cache entry and set the enabled value to false. Listing 4 shows an example.

Listing 4. Sample code listing at maximum width

 

                
cacheinstance.com.ibm.wps.ac.AccessControlUserContextCache.shared=true
cacheinstance.com.ibm.wps.ac.AccessControlUserContextCache.enabled=true
cacheinstance.com.ibm.wps.ac.AccessControlUserContextCache.lifetime=1200
cacheinstance.com.ibm.wps.ac.AccessControlUserContextCache.size=8000
cacheinstance.com.ibm.wps.ac.AccessControlUserContextCache.replacement=moderate
cacheinstance.com.ibm.wps.ac.AccessControlUserContextCache.admit-threshold=0

 

  

Please note that you should not disable the caches on servers that will be used in a production environment, because this will result in a performance penalty. You can find more information about configuring caches in the WebSphere Portal InfoCenter (see Resources).

 

 

 

 

 下载 

 

 

描述文件名下载尺寸下载方式
本文的样式脚本StartupPerformanceConfig.zip5KBHTTP

 

  

如果你不喜欢阅读中文,或者我的译文有翻译不当让你理解不了,请参阅本文的英文原版

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值