12
返回列表 发新帖
楼主: wxx_126

请教关于HADR的几个疑问

[复制链接]
招聘 : c/c++研发
论坛徽章:
45
技术图书徽章
日期:2014-03-10 14:09:192012新春纪念徽章
日期:2012-02-13 15:12:092012新春纪念徽章
日期:2012-02-13 15:12:092012新春纪念徽章
日期:2012-01-04 11:51:22ITPUB十周年纪念徽章
日期:2011-11-01 16:21:15现任管理团队成员
日期:2011-05-07 01:45:082011新春纪念徽章
日期:2011-01-25 15:42:562011新春纪念徽章
日期:2011-01-25 15:42:332011新春纪念徽章
日期:2011-01-25 15:42:152011新春纪念徽章
日期:2011-01-25 15:41:50
11#
发表于 2008-6-20 00:17 | 只看该作者
1) no, since alternate server info stored on server, if client unable to connect to primary at beginning, it will not get any info about alternate server then...
2) when client connect with server, in each communication package between server and client, it will include the alternate server information. if primary down at somepoint, client got disconnected then it will try alternate server information.
3) i don't believe it will try primary again... that is deadloop based on what you describe....
4) you cannot have both primary/secondary started as HADR primary.... you need to issue TAKEOVER command on standby to make it serve requests, when primary server is up, you need to activate the database using start HADR as standby, then manually do TAKEOVER again on primary...
5) no, it will not try alternate server when hitting those messages, if they hit maxapp errors, some SQL CODE will be returned to client, so it's not TCPIP error like connection has been refused or connection timeout...


above are my understanding, never tested myself, you are more than welcome to test if you want (and let us know the result)

[ 本帖最后由 wangzhonnew 于 2008-6-20 01:23 编辑 ]

使用道具 举报

回复
论坛徽章:
18
ITPUB新首页上线纪念徽章
日期:2007-10-20 08:38:44马上有对象
日期:2014-02-19 11:55:14马上有钱
日期:2014-02-19 11:55:14马上有房
日期:2014-02-19 11:55:14马上有车
日期:2014-02-19 11:55:142012新春纪念徽章
日期:2012-02-13 15:09:522012新春纪念徽章
日期:2012-02-13 15:09:522012新春纪念徽章
日期:2012-02-13 15:09:522012新春纪念徽章
日期:2012-02-13 15:09:522012新春纪念徽章
日期:2012-02-13 15:09:52
12#
发表于 2008-6-20 08:09 | 只看该作者
QUOTE:
--------------------------------------------------------------------------------
原帖由 askgyliu 于 20/6/2008 00:46 发表


我们整个的APPLICATION都是IBM来的,所以也不知道是不是能支持HADR。

1) 若是一个普通的DB2 CLIENT,比如说我自己的PC,若是在DB2 HADR FAILOVER后,我的PC也重起了,那我的DB2 CLIENT有办法知道REROUTE到SECONDARY SERVER吗?

2) ALTERNATE SERVER INFORMATION 不是只存在于SERVER吗?还是在客户端在第一次连接成功前也能存有PRIMARY 跟 SECONDARY CATALOG INFORMATION?红皮书/MANUAL是说在SERVER中设置ALTERNATE SERVER?

3) 若是客户端在第一次连接成功前就有PRIMARY 跟 SECONDARY  CATALOG INFORMATION的话,那客户端是不是会不停地尝试连接到数据库?就是说,如果不能连接到PRIMARY,那就自动尝试SECONDARY;如果还不能,那就尝试回PRIMARY?直到连接成功为止?

4) 如果3是肯定的回答的话,那如果在FAILOVER TO SECONDARY后,因为某些原因,PRIMARY也被启动了,那会不会造成一些客户端连接到SECONDARY,而另一些(重起的)客户端连接到PRIMARY?

5) 如果3是肯定的回答的话,那如果在FAILOVER TO SECONDARY后,因为某些原因,PRIMARY也被启动了,会不会造成某些客户端即使没重起也可能连接到PRIMARY?比如说,尝试连接到SECONDARY时,遇到MAX APPLICAION,那就去尝试(REROUTE) ALTERNATE SERVER(PRIMARY SERVER IN THIS CASE)?
--------------------------------------------------------------------------------


1. Yes. Only after your client (type 2) has been able to connect to the server prior to HADR FAILOVER. 'Update alternate server' command is run on SERVER. The first time when client connects to the server it grabs those information and stores them in the client's local database directory. It doesn't matter how many times you bounce your client & the server since then. The client has already known where the alternate server is.

2. Already explain in 1.

3. No. If the client is failed to connect to PRIMARY or SESONDARY, it stops trying and will give you some message.

4. The symptoms that having two PRIMARY ("dual heads") sometimes could be happening when PRIMARY is disconnected from clients and SECONDARY, then DBA issued TAKEOVER BY FORCE on SECONDARY. All existing clients will be connecting to this new 'PRIMARY' at this point in time. All of a suddent the link between the old PRIMARY and clients is active again. Then all those new clients comming through will definately connect to the old PRIMARY. In this case, there will be dual heads. Hence DBA should be extremly cautious when issuing TAKEOVER BY FORCE command.

5. Client rerouting only happens when TCP/IP layer has problems.

[ 本帖最后由 wangzhonnew 于 2008-6-20 09:20 编辑 ]

使用道具 举报

回复
招聘 : c/c++研发
论坛徽章:
45
技术图书徽章
日期:2014-03-10 14:09:192012新春纪念徽章
日期:2012-02-13 15:12:092012新春纪念徽章
日期:2012-02-13 15:12:092012新春纪念徽章
日期:2012-01-04 11:51:22ITPUB十周年纪念徽章
日期:2011-11-01 16:21:15现任管理团队成员
日期:2011-05-07 01:45:082011新春纪念徽章
日期:2011-01-25 15:42:562011新春纪念徽章
日期:2011-01-25 15:42:332011新春纪念徽章
日期:2011-01-25 15:42:152011新春纪念徽章
日期:2011-01-25 15:41:50
13#
发表于 2008-6-20 08:20 | 只看该作者
sorry to the above, clicked wrong button

are you sure about 1)?

on infocenter i see the following:
Regardless of whether you have authority to update the database directory at the client machine, the alternate server information is always kept in memory. In other words, if you did not have authority to update the database directory (or because it is a read-only database directory), other applications will not be able to determine and use the alternate server, because the memory is not shared among applications.

http://publib.boulder.ibm.com/in ... 5%72%76%65%72%22%20

[ 本帖最后由 wangzhonnew 于 2008-6-20 09:37 编辑 ]

使用道具 举报

回复
招聘 : c/c++研发
论坛徽章:
45
技术图书徽章
日期:2014-03-10 14:09:192012新春纪念徽章
日期:2012-02-13 15:12:092012新春纪念徽章
日期:2012-02-13 15:12:092012新春纪念徽章
日期:2012-01-04 11:51:22ITPUB十周年纪念徽章
日期:2011-11-01 16:21:15现任管理团队成员
日期:2011-05-07 01:45:082011新春纪念徽章
日期:2011-01-25 15:42:562011新春纪念徽章
日期:2011-01-25 15:42:332011新春纪念徽章
日期:2011-01-25 15:42:152011新春纪念徽章
日期:2011-01-25 15:41:50
14#
发表于 2008-6-20 08:41 | 只看该作者
hmm... i think maybe you are right anyway it's good to have some tests... or maybe you already tested it before?

使用道具 举报

回复
论坛徽章:
0
15#
 楼主| 发表于 2008-6-20 10:57 | 只看该作者
type2和type是否时通过在WAS上的设置后,不管中间主/备服务器角色又切换了几次,都是终身受用了???
db2 client和catalog没有直接关系吧?只要catalog 到起始主服务器,经过一次重路由设置后,而不管中间主/备服务器角色又切换了几次,都不用再管了???

[ 本帖最后由 wxx_126 于 2008-6-20 11:04 编辑 ]

使用道具 举报

回复
论坛徽章:
18
ITPUB新首页上线纪念徽章
日期:2007-10-20 08:38:44马上有对象
日期:2014-02-19 11:55:14马上有钱
日期:2014-02-19 11:55:14马上有房
日期:2014-02-19 11:55:14马上有车
日期:2014-02-19 11:55:142012新春纪念徽章
日期:2012-02-13 15:09:522012新春纪念徽章
日期:2012-02-13 15:09:522012新春纪念徽章
日期:2012-02-13 15:09:522012新春纪念徽章
日期:2012-02-13 15:09:522012新春纪念徽章
日期:2012-02-13 15:09:52
16#
发表于 2008-6-20 12:47 | 只看该作者
Simply just do a test by yourself.
Suppose you've got a DB2 instance on AIX as PRIMARY instance which has a HADR connection set up with another instance as SECONDARY.

Install a DB2 administation client on your XP.
1. UPDATE alternate server on PRIMARY & SECONDARY.
2. catalog PRIMARY DB in your XP client.
3. db2 list db directory <--- alternate server hostname would be blank.
4. db2 connect to PRIMARY DB
5. db2 list db directory <--- you will see alternate server infor should has been fetched from server.

Since then, you'll never have to recatalog your PRIMARY/SECONDARY DB again. Those alternate server infor has been stored in your local db directory.

使用道具 举报

回复
论坛徽章:
18
ITPUB新首页上线纪念徽章
日期:2007-10-20 08:38:44马上有对象
日期:2014-02-19 11:55:14马上有钱
日期:2014-02-19 11:55:14马上有房
日期:2014-02-19 11:55:14马上有车
日期:2014-02-19 11:55:142012新春纪念徽章
日期:2012-02-13 15:09:522012新春纪念徽章
日期:2012-02-13 15:09:522012新春纪念徽章
日期:2012-02-13 15:09:522012新春纪念徽章
日期:2012-02-13 15:09:522012新春纪念徽章
日期:2012-02-13 15:09:52
17#
发表于 2008-6-20 12:53 | 只看该作者
原帖由 wxx_126 于 20/6/2008 12:57 发表
type2和type是否时通过在WAS上的设置后,不管中间主/备服务器角色又切换了几次,都是终身受用了???
db2 client和catalog没有直接关系吧?只要catalog 到起始主服务器,经过一次重路由设置后,而不管中间主/备服务器角色又切换了几次,都不用再管了???



When you configured WAS to access DB2 by using type 2 (you have a local administration client installed), once alternate server has been configured on servers and WAS connects to one of the servers. That's it. No further recatalog actions are required after TAKEOVER or WAS server being bounced (restarted). In this case, WEB clients talk to WAS instead of DB2 server directly.

使用道具 举报

回复
招聘 : c/c++研发
论坛徽章:
45
技术图书徽章
日期:2014-03-10 14:09:192012新春纪念徽章
日期:2012-02-13 15:12:092012新春纪念徽章
日期:2012-02-13 15:12:092012新春纪念徽章
日期:2012-01-04 11:51:22ITPUB十周年纪念徽章
日期:2011-11-01 16:21:15现任管理团队成员
日期:2011-05-07 01:45:082011新春纪念徽章
日期:2011-01-25 15:42:562011新春纪念徽章
日期:2011-01-25 15:42:332011新春纪念徽章
日期:2011-01-25 15:42:152011新春纪念徽章
日期:2011-01-25 15:41:50
18#
发表于 2008-6-20 19:55 | 只看该作者
原帖由 unixnewbie 于 2008-6-20 13:47 发表
Simply just do a test by yourself.
Suppose you've got a DB2 instance on AIX as PRIMARY instance which has a HADR connection set up with another instance as SECONDARY.

Install a DB2 administation client on your XP.
1. UPDATE alternate server on PRIMARY & SECONDARY.
2. catalog PRIMARY DB in your XP client.
3. db2 list db directory  

good point thanks

使用道具 举报

回复
论坛徽章:
0
19#
发表于 2013-1-21 17:43 | 只看该作者
在websphere上的db2 hadr-jdbc-failover配置 http://twistman.buyberry.net/was-6-config-db2-hadr-jdbc-failover/
在weblogic上的db2 hadr jdbc failover 配置:http://twistman.buyberry.net/web ... hadr-jdbc-failover/

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表