加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

Oracle的load_balance和failover

发布时间:2020-12-12 15:05:42 所属栏目:百科 来源:网络整理
导读:jdbc:oracle:thin:@ (description=(TRANSPORT_CONNECT_TIMEOUT=1) (address_list=(load_balance=off)(failover=on) (address=(protocol=tcp)(host=RAC1-vip)(port=1521)) (address=(protocol=tcp)(host=RAC2-vip)(port=1521)) (address=(protocol=tcp)(host=
jdbc:oracle:thin:@
(description=(TRANSPORT_CONNECT_TIMEOUT=1)
(address_list=(load_balance=off)(failover=on)
(address=(protocol=tcp)(host=RAC1-vip)(port=1521))
(address=(protocol=tcp)(host=RAC2-vip)(port=1521))
(address=(protocol=tcp)(host=RAC3-vip)(port=1521)))
(connect_data=(service_name=orcl)(failover_mode=(type=select)(method=basic)))
)

LOAD_BALANCE=OFF,客户端进程首先会尝试连接 RAC1-vip,如果连不上,则会尝试RAC2-vip,如果再连不上就尝试RAC3-vip。如果设置为ON则会随机的选择一个做均衡负载。LOAD_BALANCE =on负载均衡,FAILOVER = on 失败自动切换,这两个参数是搭配在一起的。


LOAD_BALANCE
Purpose

To enable or disable client load balancing for multiple protocol addresses.
When you set the parameter to on,yes,or true,Oracle Net progresses the list of addresses in a random sequence,balancing the load on the various listener or Oracle Connection Manager protocol addresses. When you set the parameter to off,no,or false,Oracle Net tries the first address in the address list. If the connection fails and the failover parameter is enabled,then Oracle Net tries the addresses sequentially until one succeeds.
Put this parameter under either the DESCRIPTION_LIST parameter,the DESCRIPTION parameter,or the ADDRESS_LIST parameter.
Default
on for DESCRIPTION_LIST
Values
yes | on | true
no | off | false
Example
net_service_name=
(DESCRIPTION=
(LOAD_BALANCE=on)
(ADDRESS=(PROTOCOL=tcp)(HOST=sales1-svr)(PORT=1521))
(ADDRESS=(PROTOCOL=tcp)(HOST=sales2-svr)(PORT=1521)))
(CONNECT_DATA=(SERVICE_NAME=sales.us.example.com))

FAILOVER
Purpose

To enable or disable connect-time failover for multiple protocol addresses.
When you set the parameter to on,Oracle Net,at connect time,fails over to a different address if the first protocol address fails. When you set the parameter to off,Oracle Net tries one protocol address.
Put this parameter under the DESCRIPTION_LIST parameter,or the ADDRESS_LIST parameter.
Default
on for DESCRIPTION_LIST,DESCRIPTION,and ADDRESS_LIST.
Values
yes | on | true
no | off | false
Example net_service_name= (DESCRIPTION= (FAILOVER=on) (ADDRESS=(PROTOCOL=tcp)(HOST=sales1-svr)(PORT=1521)) (ADDRESS=(PROTOCOL=tcp)(HOST=sales2-svr)(PORT=1521))) (CONNECT_DATA=(SERVICE_NAME=sales.us.example.com)))

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读