為你完全解析Oracle 10 gas全面叢集配置

來源:互聯網
上載者:User
 

所以本文主要講如何建立 filebased-Repository 的cluster。對於基於 databased-Repository 的方式的叢集,以後再深入講。對於大規模的企業級應用來講,沒有叢集是不太現實的,考慮到可擴充性和高可用性,在通常的生產環境中,都會應用到中介軟體叢集這種技術。

 

本文主要講述了10 gas相關的叢集配置,一般的管理方面的內容。

 

10 gas的叢集分為兩大類

1.基於管理的叢集:

基於管理的叢集主要通過 Repository 來記錄 整個叢集得相關配置資訊,比如叢集發布的程式阿等等。

這個方式下,管理員需要手工操作的東西比較少。比如發布一個程式,只要對整個叢集做一次發布即可。

 

2..手工管理的叢集方式:

在這種方式下,除了最基本的session複製以及ejb cluster 外,10gas不提供更多的管理手段,

如果需要發布程式,你需要對參與叢集的所有instance做發布。你可以想象再你有10幾台伺服器的情況下,如果每次發布程式,都需要一台台去發布,不但工作量大,而且很容易搞錯。

所以建議採用基於管理的方式來做叢集。

 

基於管理的叢集主要用到需要 Repository 來儲存相關的配置資訊。由於 Repository 的重要性,這裡花點時間講一下 Repository得相關資訊。

Repository 有兩種儲存方式,databased-Repository 和 filebased-Repository。其中 filebased-Repository 是 10gas才新心出來的功能。主要是解決以前只能建立databased-Repository cluster 的問題,而databased-Repository 需要安裝Infrastructure 。這個Infrastructure 是大家頗為頭疼的東西,不太龐大,而且極容易出問題。所以才有了filebased-Repository。

 

存放在 Repository 的資訊主要有下面幾種:

1.Product metadata;

2.Management metadata;

3.Idendity Management metadata (databased-Repository 才有)。

 

對於叢集主要需要用到的資訊是 1.Product metadata 和 2.Management metadata。

 

J2EE andWeb Cache installation type ,這個安裝方式預設就是採用 filebased-Repository .當然也可以遷移到 databased-Repository。

 

 

建立叢集的要求

1.所有的 application server instance 必須再同一個farm ,也就是要用同一個 Repository來存放管理資訊。

2.所有的參與叢集的 application server instance 都必須安裝同樣的os。

3.每個參與叢集的 application server instance 只能由一個ohs server。

4.每一個 application server instance 可以有多個oc4j instance。每個oc4j instance可以有多個 oc4j process。

5.當然要求所有的application server instance 版本一樣了。

 

涉及的 application server instance 有兩個ip 都是 10.1.18.1 ,在同一 物理server 用兩個使用者安裝兩個 application server instance ,每個 application server instance 用不同的連接埠。作業系統是 redhat 3.0 update 2。

 

使用者 ias10g 啟用ohs,連接埠7778,使用者 ias10g2隻啟用oc4j.。其中 ias10g使用者 作為 filebased-Repository host。

 

1.測試該 application server instance 是否已經屬於某個 farm。

檢查 instance 1:

 


su - ias10g [ias10g@finproduction home]$ dcmctl whichFarmStandalone instance

顯示該instance還沒有加入 farm。如果顯示已經加入farm,請執行下面的命令離開:

 


farmdcmctl leaveFarm檢查 instance 2su - ias10g2[ias10g2@finproduction ias10g2]$ dcmctl whichFarmStandalone instance[ias10g2@finproduction ias10g2]$

2.初始化 Repository:

 


su - ias10g 獲得當前的 id 號碼[ias10g@finproduction home]$ dcmctl getRepositoryidfinproduction.tplife.com:7101[ias10g@finproduction home]$ 初始化farm dcmctl joinFarm -r finproduction.tplife.com:7101

其中 finproduction.tplife.com:7101 就是前面通過 getRepositoryid 獲得資訊。

 

現在在來看看 是否已經加入 farm :

 


[ias10g@finproduction home]$ dcmctl whichFarmFarm Name: .tpdata.ias10g.OraHome1.dcm.repositoryHost Instance: iastest.finproduction.tplife.comHost Name: finproduction.tplife.comRepository Type: Distributed File Based (host)SSL In Use: false

可以看到 已經加入 File Based farm .而且這個 instance是 host.

 

3.加入 instance2:

 


su - ias10g2 dcmctl joinFarm -r finproduction.tplife.com:7101

加入成功,看看 現在的 farm 資訊。

 


[ias10g2@finproduction ias10g2]$ dcmctl whichFarmFarm Name: .tpdata.ias10g.OraHome1.dcm.repositoryHost Instance: iastest.finproduction.tplife.comHost Name: finproduction.tplife.comRepository Type: Distributed File BasedSSL In Use: false[ias10g2@finproduction ias10g2]$

可以看到,已經加入成功 file-based Repository .

 

4.建立叢集:(兩種方式)

一、通過 em 管理介面建立;

二、通過dcmctl手工建立。

 

由於通過 em 建立比較簡單,且建立叢集屬於比較高階的內容,我這裡主要講如何手工建立:su - ias10g。

 

看看是否已經建立叢集:dcmctl listclusters。沒有輸出,說明還沒有建立。

 

建立一個叢集:[ias10g@finproduction home]$ dcmctl createcluster -cl mycluster

 

1、mycluster:

 

-cl 指定 叢集的名字,可以隨便取。

[ias10g@finproduction home]$ dcmctl listclusters1 mycluster

 

可以看到已經建立一個cluster。

 

先把 instance1 加入叢集:

 


[ias10g@finproduction home]$ dcmctl joincluster -cl mycluster 1 iastest.finproduction.tplife.com

接著把 instance2加入叢集:

 


su - ias10g2 [ias10g2@finproduction ias10g2]$ dcmctl joincluster -cl mycluster 1 iastest2.finproduction.tplife.com2 iastest.finproduction.tplife.com

可以看到已經再叢集mycluster中已經有兩個instance。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.