查看: 27145|回复: 47

[精华] oracle 10G RAC之VIP探讨,抛砖引玉!

[复制链接]
论坛徽章:
4
授权会员
日期:2005-10-30 17:05:33ITPUB元老
日期:2006-01-04 23:54:55会员2006贡献徽章
日期:2006-04-17 13:46:34生肖徽章2007版:鸡
日期:2008-01-02 17:35:53
跳转到指定楼层
1#
发表于 2004-7-12 23:35 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
我探讨侧重于系统方面,希望大家继续对应用方面研究!成为一
篇完美的研究!

1.测试环境

two nodes RAC in vmware gsx2.1 for linux
系统环境:Redhat Enterprise Linux AD 3 Update 2(kernel:2.4.21-15.EL)
oracle环境: oracle 10.0.2 for linux x86
网络环境:
node       public network              private  network    VIP  network

node1      192.168.0.61                192.168.1.1           192.168.0.60

node2      192.168.0.62                192.168.1.2           192.168.0.59

节点 hosts files
#cat /etc/hosts

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1            localhost.localdomain localhost
192.168.0.61         DB1PUB  DB1PUB.SHIMU.COM.CN
192.168.0.62         DB2PUB  DB2PUB.SHIMU.COM.CN
192.168.0.60         VIPDB.SHIMU.COM.CN
192.168.0.59         VIPDB2.SHIMU.COM.CN
192.168.1.1          DB1
192.168.1.2          DB2

instance: RAC1 ,RAC2
service : RAC.SHIMU.COM.CN

2.网络环境研究

正常的两nodes的10G RAC网络环境应该是有6个ip(除了loopback),每个机器包括3个ip其正常的运行环境的网络环境
通过ifconfig 得到网络环境
node1:
[root@DB1PUB root]# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:50:56:40:00:7A
          inet addr:192.168.0.61  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:43817 errors:0 dropped:0 overruns:0 frame:0
          TX packets:38627 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:23218286 (22.1 Mb)  TX bytes:21836943 (20.8 Mb)
          Interrupt:9 Base address:0x10c0

eth0:1    Link encap:Ethernet  HWaddr 00:50:56:40:00:7A
          inet addr:192.168.0.60  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:26861 errors:0 dropped:0 overruns:0 frame:0
          TX packets:24224 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:12344753 (11.7 Mb)  TX bytes:17367061 (16.5 Mb)
          Interrupt:9 Base address:0x10c0

eth1      Link encap:Ethernet  HWaddr 00:50:56:40:00:7B
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:26861 errors:0 dropped:0 overruns:0 frame:0
          TX packets:24224 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:12344753 (11.7 Mb)  TX bytes:17367061 (16.5 Mb)
          Interrupt:14 Base address:0x10e0

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:23128 errors:0 dropped:0 overruns:0 frame:0
          TX packets:23128 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:2611715 (2.4 Mb)  TX bytes:2611715 (2.4 Mb)

node2:
[root@DB2PUB root]# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:50:56:40:00:5B
          inet addr:192.168.0.62  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:46454 errors:0 dropped:0 overruns:0 frame:0
          TX packets:36730 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:24482851 (23.3 Mb)  TX bytes:20281527 (19.3 Mb)
          Interrupt:9 Base address:0x10c0

eth0:1    Link encap:Ethernet  HWaddr 00:50:56:40:00:5B
          inet addr:192.168.0.59  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:31258 errors:0 dropped:0 overruns:0 frame:0
          TX packets:19194 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:19952760 (19.0 Mb)  TX bytes:9559431 (9.1 Mb)
          Interrupt:9 Base address:0x10c0

eth1      Link encap:Ethernet  HWaddr 00:50:56:40:00:5C
          inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:31258 errors:0 dropped:0 overruns:0 frame:0
          TX packets:19194 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:19952760 (19.0 Mb)  TX bytes:9559431 (9.1 Mb)
          Interrupt:14 Base address:0x10e0
2.listener研究
10G的listener也做了改动参见如下:
# listener.ora.db2pub Network Configuration File: /oracle/10g2/network/admin/listener.ora.db2pub
# Generated by Oracle configuration tools.

LISTENER_DB1PUB =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.61)(PORT = 1521))
      )
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.60)(PORT = 1521))
      )
    )
  )

SID_LIST_LISTENER_DB2PUB =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /oracle/10g2)
      (PROGRAM = extproc)
    )
  )

此时oracle系统的监听器是同时监听public,和vip地址一下是listener的node1的监听信息

[oracle@DB1PUB oracle]$ lsnrctl statu DB1PUB

LSNRCTL for Linux: Version 10.1.0.2.0 - Production on 12-JUL-2004 20:51:21

Copyright (c) 1991, 2004, Oracle.  All rights reserved.

Connecting to

(DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=DB1PUB.SHIMU.COM.CN))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.61)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_DB1PUB
Version                   TNSLSNR for Linux: Version 10.1.0.2.0 - Production
Start Date                12-JUL-2004 19:40:28
Uptime                    0 days 1 hr. 10 min. 53 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/10g2/network/admin/listener.ora
Listener Log File         /oracle/10g2/network/log/listener_db1pub.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.60)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.61)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=DB1PUB)(PORT=8080))(Presentation=HTTP)(Session=RAW))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=DB1PUB)(PORT=2100))(Presentation=FTP)(Session=RAW))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "RAC.SHIMU.COM.CN" has 2 instance(s).
  Instance "RAC1", status READY, has 2 handler(s) for this service...
  Instance "RAC2", status READY, has 1 handler(s) for this service...
Service "RACXDB.SHIMU.COM.CN" has 2 instance(s).
  Instance "RAC1", status READY, has 1 handler(s) for this service...
  Instance "RAC2", status READY, has 1 handler(s) for this service...
The command completed successfully

其中多了监听8080和2100起具体作用还值得研究

3.tnsnames的研究
  以下时服务RAC.SHIMU.COM.CN的tnsnames的配置
# tnsnames.ora.db2pub Network Configuration File: /oracle/10g2/network/admin/tnsnames.ora.db2pub
# Generated by Oracle configuration tools.

RAC =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.158.0.60)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.59)(PORT = 1521))
    (LOAD_BALANCE = yes)
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = RAC.SHIMU.COM.CN)
    )
  )

LISTENERS_RAC =
  (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.60)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.59)(PORT = 1521))
  )

RAC2 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.59)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = RAC.SHIMU.COM.CN)
      (INSTANCE_NAME = RAC2)
    )
  )

RAC1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = VIPDB.SHIMU.COM.CN)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = RAC.SHIMU.COM.CN)
      (INSTANCE_NAME = RAC1)
    )
  )

哈哈,终于发现秘密了,所有cluster的listener和service都是监听VIP的地址。。。
呵呵。等着好戏吧。。。
4.故障测试

  停掉node1,此时所有的连接都正常工作,检测node2的网络装况,呵呵,果不出所然:
[root@DB2PUB root]# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:50:56:40:00:5B
          inet addr:192.168.0.62  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:960 errors:0 dropped:0 overruns:0 frame:0
          TX packets:70 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:284407 (277.7 Kb)  TX bytes:4017 (3.9 Kb)
          Interrupt:9 Base address:0x10c0

eth0:1    Link encap:Ethernet  HWaddr 00:50:56:40:00:5B
          inet addr:192.168.0.59  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:734 errors:0 dropped:0 overruns:0 frame:0
          TX packets:227 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:268965 (262.6 Kb)  TX bytes:9534 (9.3 Kb)
          Interrupt:9 Base address:0x10c0

eth0:2    Link encap:Ethernet  HWaddr 00:50:56:40:00:5B
          inet addr:192.168.0.60  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:734 errors:0 dropped:0 overruns:0 frame:0
          TX packets:227 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:268965 (262.6 Kb)  TX bytes:9534 (9.3 Kb)
          Interrupt:9 Base address:0x10c0

eth1      Link encap:Ethernet  HWaddr 00:50:56:40:00:5C
          inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:734 errors:0 dropped:0 overruns:0 frame:0
          TX packets:227 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:268965 (262.6 Kb)  TX bytes:9534 (9.3 Kb)
          Interrupt:14 Base address:0x10e0

此时node2立即接管node1的VIP网络地址,所有的连接透明的连到了后台!!
论坛徽章:
4
授权会员
日期:2005-10-30 17:05:33ITPUB元老
日期:2006-01-04 23:54:55会员2006贡献徽章
日期:2006-04-17 13:46:34生肖徽章2007版:鸡
日期:2008-01-02 17:35:53
2#
 楼主| 发表于 2004-7-12 23:36 | 只看该作者
占个位置。。

使用道具 举报

回复
论坛徽章:
4
授权会员
日期:2005-10-30 17:05:33ITPUB元老
日期:2006-01-04 23:54:55会员2006贡献徽章
日期:2006-04-17 13:46:34生肖徽章2007版:鸡
日期:2008-01-02 17:35:53
3#
 楼主| 发表于 2004-7-12 23:37 | 只看该作者
占个位置

使用道具 举报

回复
论坛徽章:
4
授权会员
日期:2005-10-30 17:05:33ITPUB元老
日期:2006-01-04 23:54:55会员2006贡献徽章
日期:2006-04-17 13:46:34生肖徽章2007版:鸡
日期:2008-01-02 17:35:53
4#
 楼主| 发表于 2004-7-12 23:38 | 只看该作者
占个位置

使用道具 举报

回复
论坛徽章:
4
授权会员
日期:2005-10-30 17:05:33ITPUB元老
日期:2006-01-04 23:54:55会员2006贡献徽章
日期:2006-04-17 13:46:34生肖徽章2007版:鸡
日期:2008-01-02 17:35:53
5#
 楼主| 发表于 2004-7-12 23:38 | 只看该作者
VIP网络连接示意图

使用道具 举报

回复
招聘 : 数据库管理员
论坛徽章:
66
ITPUB元老
日期:2005-07-16 18:49:11授权会员
日期:2005-10-30 17:05:33ITPUB新首页上线纪念徽章
日期:2007-10-20 08:38:44现任管理团队成员
日期:2011-05-07 01:45:08版主3段
日期:2012-05-15 15:24:11
6#
发表于 2004-7-13 09:19 | 只看该作者
你给的那个进址没有办法登陆哦?

使用道具 举报

回复
论坛徽章:
62
马上加薪
日期:2014-02-19 11:55:142011新春纪念徽章
日期:2011-02-18 11:43:332010广州亚运会纪念徽章:田径
日期:2011-02-17 18:03:352011新春纪念徽章
日期:2011-01-25 15:42:562011新春纪念徽章
日期:2011-01-25 15:42:332011新春纪念徽章
日期:2011-01-25 15:42:152011新春纪念徽章
日期:2011-01-25 15:41:502011新春纪念徽章
日期:2011-01-25 15:41:012010广州亚运会纪念徽章:三项全能
日期:2010-11-15 13:36:51ITPUB9周年纪念徽章
日期:2010-10-08 09:34:02
7#
发表于 2004-7-13 09:24 | 只看该作者
8080和2100 和为了支持xml监听的

使用道具 举报

回复
招聘 : 数据库管理员
论坛徽章:
66
ITPUB元老
日期:2005-07-16 18:49:11授权会员
日期:2005-10-30 17:05:33ITPUB新首页上线纪念徽章
日期:2007-10-20 08:38:44现任管理团队成员
日期:2011-05-07 01:45:08版主3段
日期:2012-05-15 15:24:11
8#
发表于 2004-7-13 16:36 | 只看该作者
Shutting down interface eth0:  Device eth0 has different MAC address than expected, ignoring.
[FAILED]
Shutting down interface eth1:  Device eth1 has different MAC address than expected, ignoring.
[FAILED]

我的node2是拷贝的,每次重启网卡时都报这个错,可以解决吗?

使用道具 举报

回复
论坛徽章:
4
授权会员
日期:2005-10-30 17:05:33ITPUB元老
日期:2006-01-04 23:54:55会员2006贡献徽章
日期:2006-04-17 13:46:34生肖徽章2007版:鸡
日期:2008-01-02 17:35:53
9#
 楼主| 发表于 2004-7-13 18:32 | 只看该作者
最初由 xzh2000 发布
[B]Shutting down interface eth0:  Device eth0 has different MAC address than expected, ignoring.
[FAILED]
Shutting down interface eth1:  Device eth1 has different MAC address than expected, ignoring.
[FAILED]

我的node2是拷贝的,每次重启网卡时都报这个错,可以解决吗? [/B]

在第二节点中把网卡删掉,在加一个试试。。

使用道具 举报

回复
招聘 : 数据库管理员
论坛徽章:
66
ITPUB元老
日期:2005-07-16 18:49:11授权会员
日期:2005-10-30 17:05:33ITPUB新首页上线纪念徽章
日期:2007-10-20 08:38:44现任管理团队成员
日期:2011-05-07 01:45:08版主3段
日期:2012-05-15 15:24:11
10#
发表于 2004-7-13 21:23 | 只看该作者
最初由 shimu 发布
[B]
在第二节点中把网卡删掉,在加一个试试。。 [/B]


有没有用过ocfs2来创建oracle cluster filesystem的?
偶用了ocfs2,dbca硬是说mount的ocfs2分区不是
有效的oracle cluster filesystem?

使用道具 举报

回复

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

本版积分规则 发表回复

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