偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

RAC負(fù)載均衡命令展示

網(wǎng)絡(luò) 網(wǎng)絡(luò)優(yōu)化 網(wǎng)絡(luò)運(yùn)維
本文為大家做了一個(gè)關(guān)于數(shù)據(jù)庫(kù)RAC負(fù)載均衡的配置總結(jié)。首先我們需要把服務(wù)器端和客戶端的配置分開(kāi)來(lái)說(shuō)明。那么中間的細(xì)節(jié)問(wèn)題,還請(qǐng)大家瀏覽下文。

不管是大型的數(shù)據(jù)中心,還是個(gè)人的數(shù)據(jù)庫(kù)學(xué)習(xí),我們都可以看到負(fù)載均衡的應(yīng)用。那么,現(xiàn)在我們就來(lái)介紹一下RAC的負(fù)載均衡問(wèn)題。為了更好的為大家將這部分知識(shí)內(nèi)容總結(jié)好,我們根據(jù)一個(gè)例子來(lái)幫助大家將配置過(guò)程進(jìn)行分解,希望大家能掌握其中的要點(diǎn)。

RAC負(fù)載均衡主要是指新會(huì)話連接到RAC數(shù)據(jù)庫(kù)時(shí),如何判定這個(gè)新的連接要連到哪個(gè)節(jié)點(diǎn)進(jìn)行工作。在RAC中,負(fù)載均衡分為兩種,一種是基于客戶端連接的,另外一種是基于服務(wù)器端的。

客戶端的負(fù)載均衡配置相對(duì)簡(jiǎn)單,只需要在tnsnames.ora中添加LOAD_BALANCE=ON這么一個(gè)選項(xiàng)即可。比如下面的TNS:

  1. RAC =  
  2. (DESCRIPTION =  
  3. (ADDRESS = (PROTOCOL = TCP)(HOST = rac1-vip)(PORT = 1521))  
  4. (ADDRESS = (PROTOCOL = TCP)(HOST = rac2-vip)(PORT = 1521))  
  5. (LOAD_BALANCE = ON)  
  6. (FAILOVER = ON)  
  7. (CONNECT_DATA =  
  8. (SERVER = DEDICATED)  
  9. (SERVICE_NAME = rac)  
  10. )  

這樣當(dāng)客戶端連接RAC數(shù)據(jù)庫(kù)時(shí),會(huì)隨機(jī)在TNS里面挑個(gè)監(jiān)聽(tīng)地址進(jìn)行連接。在Oracle10g以前,假如有節(jié)點(diǎn)宕機(jī)或者類似事故時(shí),客戶端可能還是選擇連接到這個(gè)節(jié)點(diǎn),這樣會(huì)發(fā)生較長(zhǎng)時(shí)間的TCP等待超時(shí)。而在10g以后,由于VIP和FAN的引入,這樣的情況可以得到很大程度的改善。客戶端的負(fù)載均衡在通常情況下能夠較好地工作,但是由于連接是在客戶端隨機(jī)發(fā)起的,這樣客戶端并不知道RAC各節(jié)點(diǎn)的負(fù)荷及連接數(shù)情況,有可能負(fù)荷大的節(jié)點(diǎn)還會(huì)源源不斷地增加新的連接,導(dǎo)致RAC節(jié)點(diǎn)無(wú)法均衡工作。

從Oracle 10g開(kāi)始,服務(wù)器端的負(fù)載均衡可以根據(jù)RAC中各節(jié)點(diǎn)的負(fù)荷及連接數(shù)情況,而判定將新的客戶端連接分配到負(fù)荷最小的節(jié)點(diǎn)上去。RAC中各節(jié)點(diǎn)的PMON 進(jìn)程每3秒會(huì)將各自節(jié)點(diǎn)的負(fù)荷(包括LOAD、***LOAD、CPU使用率)及連接數(shù)更新到service_register里面,然后假如節(jié)點(diǎn)的負(fù)荷有發(fā)生變化,將會(huì)通知到監(jiān)聽(tīng)程序,由監(jiān)聽(tīng)程序再?zèng)Q定新的客戶端連接分配至哪個(gè)節(jié)點(diǎn)。假如RAC中一個(gè)節(jié)點(diǎn)的監(jiān)聽(tīng)失敗了,PMON每一分鐘會(huì)去檢查一次是否已經(jīng)恢復(fù)正常。

服務(wù)器端的監(jiān)聽(tīng)配置是在各節(jié)點(diǎn)的tnsnames.ora里面添加一個(gè)連接到各個(gè)節(jié)點(diǎn)監(jiān)聽(tīng)的條目,然后再在初始化參數(shù)里面設(shè)置 remote_listeners這個(gè)參數(shù)。比如:

  1. LISTENERS_RAC =  
  2. (ADDRESS_LIST =  
  3. (ADDRESS = (PROTOCOL = TCP)(HOST = rac1-vip)(PORT = 1521))  
  4. (ADDRESS = (PROTOCOL = TCP)(HOST = rac2-vip)(PORT = 1521))  
  5. )  
  6.  
  7. ALTER SYSTEM SET REMOTE_LISTENER = LISTENERS_RAC

這樣服務(wù)器端的LOAD BALANCE便配置完成。

但是有時(shí)候由于PMON取節(jié)點(diǎn)負(fù)荷的延遲,導(dǎo)致客戶端連接可能還是會(huì)連接到負(fù)荷較大的節(jié)點(diǎn)上,這時(shí)候便可以在服務(wù)器各節(jié)點(diǎn)的listener.ora里面加入PREFER_LEAST_LOADED_NODE=OFF這么一行,這樣服務(wù)器端的負(fù)載均衡將不再根據(jù)節(jié)點(diǎn)的負(fù)荷來(lái)進(jìn)行分配,而是根據(jù)節(jié)點(diǎn)的連接數(shù)進(jìn)行分配,達(dá)到各個(gè)節(jié)點(diǎn)連接數(shù)比較平衡的效果。

另外一個(gè)不得不說(shuō)的便是并行操作,假如有個(gè)會(huì)話連接以后要進(jìn)行并行操作。由于連接時(shí)是按負(fù)荷或連接數(shù)連接,這樣可能連接時(shí)各個(gè)節(jié)點(diǎn)連接數(shù)和負(fù)荷等比較平衡,但是這個(gè)并行會(huì)話啟動(dòng)多個(gè)并行進(jìn)程以后,那么這個(gè)節(jié)點(diǎn)的負(fù)荷及連接數(shù)就會(huì)有可能上升得比較快。如果在RAC中開(kāi)啟了節(jié)點(diǎn)并行,那么有可能會(huì)把并行進(jìn)程分配到多個(gè)節(jié)點(diǎn)運(yùn)行以達(dá)到負(fù)載均衡的效果。

從Oracle 10.2開(kāi)始,Oracle引入了Load Balance Advisor,對(duì)負(fù)載均衡有了進(jìn)一步的改進(jìn)。結(jié)合Service,可以對(duì)不同的SERVICE設(shè)置不同的負(fù)載均衡策略。Load Balance Advisor的配置可以通過(guò)DBMS_SERVICE包對(duì)SERVICE進(jìn)行更改而完成。在Load Balance Advisor首先必須柚肧ERVICE負(fù)載均衡的目標(biāo),目標(biāo)分為3種:

GOAL_NONE Disables the load balancing advisory

GOAL_SERVICE_TIME The LBA calculates a weighted moving average of the total elapsed time for completed work plus the bandwidth that's available to the service to calculate the service goodness. This goal is ideal for services whose workload may change dramatically over a short period of time, e.g. an application that services a “clicks and mortar" store that provides customer self-service through an internet-based shopping web site.

GOAL_THROUGHPUT The LBA calculates a weighted moving average of throughput (i.e. the rate at which work is completed) in addition to the bandwidth available to the service to calculate the service goodness. This goal is best suited for long-duration tasks that are typically queued to run serially, e.g. scheduled jobs that handle large batches of transactions.
另外可以額外設(shè)置連接的負(fù)載均衡:

CLB_GOAL_SHORT The Load Balancing Advisory will be used for connection load balancing only if it is enabled (i.e. set to other than GOAL_NONE). If the LBA has been disabled, connection load balancing will utilize abridged advice determined by CPU utilization.

CLB_GOAL_LONG Connection load balancing will be determined by first tallying the total number of connections per instance, and then by counting the number of sessions per each service. Oracle recommends using this setting for services whose applications tend to connect for long periods of time (e.g. Oracle Forms). The Load Balancing Advisory can be used in conjunction with this setting as long as the connection pool has been sized to accommodate “gravitation “ within the pool without adding or subtracting connections. Oracle recommends this option as the most efficient design. 

責(zé)任編輯:佟健 來(lái)源: 互聯(lián)網(wǎng)
相關(guān)推薦

2010-04-21 12:57:33

RAC負(fù)載均衡配置

2010-04-21 13:18:33

RAC負(fù)載均衡配置

2017-07-03 08:08:25

負(fù)載均衡分類

2010-04-22 17:19:49

負(fù)載均衡群集通訊

2010-04-22 17:32:21

負(fù)載均衡通訊

2019-03-18 10:44:41

負(fù)載均衡DNSUDP

2019-07-09 10:24:14

Oracle腳本負(fù)載均衡

2010-05-04 16:10:51

負(fù)載均衡算法

2010-05-05 18:51:25

Varnish負(fù)載均衡

2010-05-07 14:27:16

IPVS負(fù)載均衡

2010-05-10 16:20:32

負(fù)載均衡策略

2012-07-31 09:25:42

nginx負(fù)載均衡反向代理

2010-05-05 22:58:46

2013-04-22 11:29:14

Nginx

2021-04-21 14:56:28

負(fù)載均衡高并發(fā)優(yōu)化技術(shù)架構(gòu)

2022-05-06 09:21:57

工作負(fù)載SPDK線程

2010-04-20 12:49:27

負(fù)載均衡策略

2010-05-06 15:00:58

集群負(fù)載均衡

2010-05-10 14:15:54

DNS負(fù)載均衡

2010-04-21 14:34:33

websphere負(fù)載
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)