用于 WebLogic Server 的 Sun Cluster 数据服务指南(适用于 Solaris OS)

替代 Sun Cluster HA for BEA WebLogic Server 配置

本章中的安装、注册和配置过程假定您安装的是简单配置中介绍的简单配置。本节提供了其他可能的 Sun Cluster HA for BEA WebLogic Server 配置的示例。

创建简单的 BEA WebLogic Server 资源

此配置假定 START 脚本 startWebLogic.sh 可以在不使用任何脚本参数的情况下启动 BEA WebLogic Server。启动 BEA WebLogic Server 所需的 usernamepassword 可以在此 START 脚本或 boot.properties 文件中进行配置。


# scrgadm -a -j bea-rs -t SUNW.wls- -g bea-rg\
-x Confdir_list=/global/bea/beahome/weblogic700\
-x Server_url=http://logical_host1:7001\
-x Start_script=/global/bea/beahome/user_projects/petstore/startWebLogic.sh

使用服务器名称参数创建资源

如果 BEA WebLogic Server START 脚本 startManagedWebLogic.sh 将受管理服务器名称用作参数,则可以设置扩展特性 Server_name。可以使用 START 脚本 startManagedWebLogic.sh 启动若干个受管理服务器。必须在 START 脚本中配置 ADMIN_URL。要手动启动 BEA WebLogic Server,请使用以下命令。


cluster-node-1> cd /global/wls/user_projects/petstore
cluster-node-1> ./startManagedWebLogic.sh petstore1

要配置其 START 脚本采用服务器名称 petstore1 的 Sun Cluster HA for BEA WebLogic Server 资源,请使用以下命令。


# scrgadm -a -j bea-rs -t SUNW.wls -g bea-rg\
-x Confdir_list=/global/bea/beahome/weblogic700\
-x Server_url=http://logical_host1:7001\
-x Start_script=/global/bea/beahome/user_projects/petstore/startWebLogic.sh\
-x Server_name=petstore1

要配置将同一 START 脚本用于其他服务器 petstore2 的另一个 Sun Cluster HA for BEA WebLogic Server 资源,请使用以下命令。


# scrgadm -a -j bea-rs -t SUNW.wls -g bea-rg\
-x Confdir_list=/global/bea/beahome/weblogic700\
-x Server_url=http://logical_host1:7001\
-x Start_script=/global/bea/beahome/user_projects/petstore/startWebLogic.sh\
-x Server_name=petstore2

创建将顺序关闭的资源

Sun Cluster HA for BEA WebLogic Server STOP 方法的缺省设置将终止 BEA WebLogic Server 进程以关闭实例。如果这种方法不合意,请将 Smooth_shutdown 扩展特性设置为 TRUE 以启用 BEA WebLogic Server 的顺序关闭。如果启用了此扩展特性,则必须在 START 脚本中设置 WLS_USERWLS_PW。如果这是安全性重要事项,则必须使 Sun Cluster HA for BEA WebLogic Server 执行缺省强制关闭(终止进程)。

要配置将顺序关闭的资源,请使用以下命令。


# scrgadm -a -j bea-rs -t SUNW.wls -g bea-rg\
-x Confdir_list=/global/bea/beahome/weblogic700\
-x Server_url=http://logical_host1:7001\
-x Start_script=/global/bea/beahome/user_projects/petstore/startWebLogic.sh\
-x Server_name=petstore1\
-x Smooth_shutdown=TRUE

创建将探测数据库的资源

Sun Cluster HA for BEA WebLogic Server 不探测数据库的运行状况。如果数据库在 Sun Cluster HA for BEA WebLogic Server 启动时关闭,数据服务将无法启动。如果需要 Sun Cluster HA for BEA WebLogic Server 探测数据库,则可以将您自己的数据库探测脚本作为扩展特性提供给 Sun Cluster HA for BEA WebLogic Server。此数据库探测必须返回零(表示成功)或非零(表示失败)。

要使用 DB_probe 脚本扩展特性集配置资源,请使用以下命令。


# scrgadm -a -j bea-rs -t SUNW.wls -g bea-rg\
-x Confdir_list=/global/bea/beahome/weblogic700\
-x Server_url=http://logical_host1:7001\
-x Start_script=/global/bea/beahome/user_projects/petstore/startWebLogic.sh\
-x Server_name=petstore1\
-x Smooth_shtudown=TRUE\
-x DB_probe_script=/global/bea/script/db_probe_script

创建监视 URI 的资源

要启用 Sun Cluster HA for BEA WebLogic Server 资源以监视由 BEA WebLogic Server(在资源中进行了配置)提供服务的 URI,请使用以下命令设置扩展特性 Monitor_uri_list


# scrgadm -a -j bea-rs -t SUNW.wls -g bea-rg\
-x Confdir_list=/global/bea/beahome/weblogic700\
-x Server_url=http://logical_host1:7001\
-x Start_script=/global/bea/beahome/user_projects/petstore/startWebLogic.sh\
-x Server_name=petstore1\
Smooth_shutdown=TRUE\
DB_probe_script=/global/bea/script/db_probe_script\
-x Monitor_uri_list=http://logical_host1:7001/petstore,http://logical_host1:7001/bookstore