使用WebSphere中间件构建数据库环境

http://tech.ddvip.com   2007年07月03日    社区交流

内容摘要:本文向您介绍使用 IBM WebSphere® Application Server Network Deployment V6.1 作为客户端应用程序并利用 DB2 HADR 和自动客户端重新路由功能构建高可用性数据库环境的步骤。

  请参阅 DB2 文档中有关自动客户端重新路由配置的说明,了解等效的 DB2 注册表变量和其他详细信息。

  HADR 接管

  在将 WebSphere Application Server 应用程序连接到 DB2 HADR 主要计算机后,就可以着手验证 HADR 故障转移行为了。向备用服务器发出以下命令,以便发生 DB2 HADR 接管(清单 9)。

  db2 takeover hadr on db <database_name>

  较好的做法是,在接管之后检查备用计算机上的数据库是否具有“主要角色”。

  db2 get snapshot for db on <database name> | grep Role

  清单 9. 备用计算机上的数据库接管> db2 takeover hadr on db sample
  DB20000I The TAKEOVER HADR ON DATABASE command completed successfully.

  在接管之后,WebSphere Application Server 需要建立新连接才能访问备用计算机上的数据库。您将在 SystemOut.log 文件中看到以下日志消息(清单 10),指示应用程序首先尝试连接主要计算机,然后重新尝试连接备用计算机。在应用程序重新尝试连接之后,它应获得一个到备用数据库的新连接。

  清单 10. WebSphere Application Server SystemOut.log[11/1/06 17:15:39:298 CST] 00000039 ServletWrappe E  SRVE0068E: Uncaught exception
thrown in one of the service methods of the servlet: /dbview.jsp. Exceptionthrown :
javax.servlet.ServletException: A connection failed but has been re-established. The
hostname or IP address is "svtlewis.rchland.ibm.com" and the service name
or port number is 60000 . Special registers may or may not be re-attempted (Reason
code = 1 DB2ConnectionCorrelator: G9056D89.O37F.061101231714

来源:ibm.com    作者:Li-Fang Lee    责编:豆豆技术应用

正在加载评论...