使用WebSphere中间件构建数据库环境
http://tech.ddvip.com 2007年07月03日 社区交流
内容摘要:本文向您介绍使用 IBM WebSphere® Application Server Network Deployment V6.1 作为客户端应用程序并利用 DB2 HADR 和自动客户端重新路由功能构建高可用性数据库环境的步骤。
清单 1. 用于“Sample”数据库的两个 HADR 端口>more /etc/services
# HADR ports assigned by user
ha_sample 51012/tcp
ha_sample_int 51013/tcp
您需要编辑 /etc/services 文件 (UNIX/Linux) 或 c:windowssystem32driversetcservices (Windows) 来指定端口。(注意,只有管理员帐户才能够编辑这些文件。)
为主要计算机上的每个数据库配置 HADR 变量。(此处显示的步骤仅适用于主要计算机。)必须对每个数据库重复此过程。在设置这些变量时,请验证 hard_local_host 和 hard_remote_host 变量是否引用了正确的计算机。而且,hadr_local_svc 和 hadr_remote_svc 变量必须与上述 /etc/services 文件中定义的名称相匹配。下面我们以“Sample”数据库为例进行说明:
清单 2. Sample 数据库的 HADR 变量>db2 update db cfg for Sample using hadr_local_host <primary machine IP address>
>db2 update db cfg for Sample using hadr_remote_host <standby machine IP address>
>db2 update db cfg for Sample using hadr_local_svc ha_sample
>db2 update db cfg for Sample using hadr_remote_svc ha_sample_int
>db2 update db cfg for Sample using hadr_remote_inst <DB2 instance name on the standby>
>db2 update db cfg for Sample using hadr_timeout 120
>db2 update db cfg for Sample using hadr_syncmode nearsync
>db2 update db cfg for Sample using logretain on
>db2 update db cfg for Sample using LOGINDEXBUILD on
>db2 update alternate server for database Sample using hostname <Standby IP address>
port 60000
来源:ibm.com 作者:Li-Fang Lee 责编:豆豆技术应用