当前位置:  数据库>oracle

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

    来源: 互联网  发布时间:2017-04-28

    本文导语: Oracle RAC 负载均衡与local_listener、remote_listener两个参数的配置关系 RAC的负载均衡主要由客户端和服务器端两种实现方式。  1,客户端的实现,直接在tnsnames.ora中配置LOAD_BALANCE参数来实现。默认值是NO clinet_LB =  (DESCRIPTION =    (...

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)
    )
  )
































































































    
 
 

您可能感兴趣的文章:

  • [Oracle] RAC 之 - 负载均衡深入解析
  •  
    本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
    本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。












  • 相关文章推荐
  • Oracle 12c发布简单介绍及官方下载地址
  • 在linux下安装oracle,如何设置让oracle自动启动!也就是让oracle那个服务自动启动,不是手动的
  • oracle 11g最新版官方下载地址
  • 请问su oracle 和su - oracle有什么不同?
  • Oracle 数据库(oracle Database)Select 多表关联查询方式
  • 虚拟机装Oracle R12与Oracle10g
  • Oracle数据库(Oracle Database)体系结构及基本组成介绍
  • Oracle 数据库开发工具 Oracle SQL Developer
  • 如何设置让Oracle SQL Developer显示的时间包含时分秒
  • Oracle EBS R12 支持 Oracle Database 11g
  • Oracle 10g和Oracle 11g网格技术介绍
  • SCO unix下安装oracle,但没有光盘,请大家推荐一个oracle下载站点(unix版本的)。谢谢!!!!
  • oracle中如何把表中具有相同值列的多行数据合并成一行
  • 请问大家用oracle数据库, 用import oracle.*;下的东西么? 还是用标准库?
  • Oracle 数据库(oracle Database)性能调优技术详解
  • Linux /$ORACLE_HOME $ORACLE_HOME
  • ORACLE日期相关操作
  • Linux系统下Oracle的启动与Oracle监听的启动
  • ORACLE数据库常用字段数据类型介绍
  • 请问在solaris下安装ORACLE,用root用户和用oracle用户安装有什么区别么?
  • Oracle 12c的九大最新技术特性介绍
  • 网间Oracle的连接,远程连接Oracle服务器??


  • 站内导航:


    特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

    ©2012-2021,