Oracle RAC 负载均衡与local_listener、remote_listener两个参数的配置关系

ORACLE RAC 负载均衡与local_listener、remote_listener两个参数的配置关系 RAC的负载均衡主要由客户端和服务器端两种实现方式。

oracle rac 负载均衡与local_listener、remote_listener两个参数的配置关系
 rac的负载均衡主要由客户端和服务器端两种实现方式。
 
 1,客户端的实现,直接在tnsnames.ora中配置load_balance参数来实现。默认值是no
 clinet_lb =
  (description =
    (load_balance = yes)
    (address = (protocol = tcp)(host = 10.4.124.243)(port = 1521))
    (address = (protocol = tcp)(host = 10.4.124.244)(port = 1521))
    (address = (protocol = tcp)(host = 10.4.124.245)(port = 1521))
    (address = (protocol = tcp)(host = 10.4.124.246)(port = 1521))
    (connect_data =
      (service_name = srv_epm1)
    )
  )
  2,服务器端的负载均衡lb设置。主要是通过两个初始化参数local_listener、remote_listener来实现的。通过这两个参数,oracle分别向这两个参数指向的listener进行注册,这样,listener就能知道各个服务的状态,,进而进行连接分发。
  11gr2版本,这两个参数默认设置为如下

sql> show parameter listener

name                                 type        value
———————————— ———– ——————————
listener_networks                    string
local_listener                       string      (description=(address_list=(ad
                                                 dress=(protocol=tcp)(host=10.4
                                                 .124.244)(port=1521))))
remote_listener                      string      dtydb-scan2:1521

由于以上设置,数据库实例分别向local_listener和remote_listener进行注册。

本地listener只注册了+asm2和epmdb2两个实例

lsnrctl> set current_listener listener
current listener is listener
lsnrctl> service
connecting to (description=(address=(protocol=ipc)(key=listener)))
services summary…
service “+asm” has 1 instance(s).
  instance “+asm2”, status ready, has 1 handler(s) for this service…
    handler(s):
      “dedicated” established:10765 refused:0 state:ready
         local server
service “epmdb” has 1 instance(s).
  instance “epmdb2”, status ready, has 1 handler(s) for this service…
    handler(s):
      “dedicated” established:10 refused:0 state:ready
         local server
the command completed successfully

scan listener注册了所有数据库实例默认service和运行在epmdb1实例上的服务srv_epm1
查看服务注册情况,scan

lsnrctl> set current_listener listener_scan1
current listener is listener_scan1
lsnrctl> service
connecting to (description=(address=(protocol=ipc)(key=listener_scan1)))
services summary…
service “epmdb” has 3 instance(s).
  instance “epmdb1”, status ready, has 1 handler(s) for this service…
    handler(s):
      “dedicated” established:0 refused:0 state:ready
         remote server
         (description=(address=(protocol=tcp)(host=10.4.124.243)(port=1521)))
  instance “epmdb2”, status ready, has 1 handler(s) for this service…
    handler(s):
      “dedicated” established:0 refused:0 state:ready
         remote server
         (description=(address=(protocol=tcp)(host=10.4.124.244)(port=1521)))
  instance “epmdb3”, status ready, has 1 handler(s) for this service…
    handler(s):
      “dedicated” established:4 refused:0 state:ready
         remote server
         (description=(address=(protocol=tcp)(host=10.4.124.245)(port=1521)))
service “srv_epm1” has 1 instance(s).
  instance “epmdb1”, status ready, has 1 handler(s) for this service…
    handler(s):
      “dedicated” established:0 refused:0 state:ready
         remote server
         (description=(address=(protocol=tcp)(host=10.4.124.243)(port=1521)))
the command completed successfully

tnsnames.ora的配置如下
tydb_srv_epm1 =
  (description =
    (load_balance = no)
    (address = (protocol = tcp)(host = 10.4.124.243)(port = 1521))
    (address = (protocol = tcp)(host = 10.4.124.244)(port = 1521))
    (address = (protocol = tcp)(host = 10.4.124.245)(port = 1521))
    (address = (protocol = tcp)(host = 10.4.124.246)(port = 1521))
    (connect_data =
      (service_name = epmdb)
    )
  )
epmdb_scan =
  (description =
    (load_balance = no)
    (address = (protocol = tcp)(host = 10.4.124.230)(port = 1521))
    (connect_data =
      (service_name = epmdb)
    )
  )

linux

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至253000106@qq.com举报,一经查实,本站将立刻删除。

发布者:PHP中文网,转转请注明出处:https://www.chuangxiangniao.com/p/1928408.html

(0)
上一篇 2025年2月22日 20:48:26
下一篇 2025年2月22日 20:48:42

AD推荐 黄金广告位招租... 更多推荐

相关推荐

发表回复

登录后才能评论