此範例假設有兩個叢集節點,其實體主機名稱分別為 mars.red.siroe.com 和 venus.red.siroe.com。其安裝與配置目錄位置必須是唯一的位置。如果在每個節點上的安裝與配置目錄有相同的目錄名稱 (例如 /opt/SUNWmsgsr 和 /var/opt/SUNWmsgsr),則會發生競爭的問題。競爭問題會在 venus 確實容錯移轉至 mars 時發生,且此二 Messaging Server 實例會爭用相同的安裝與配置目錄。
較好的用法是,針對安裝目錄使用 /opt/NodeMember /SUNWmsgsr 格式;針對配置目錄使用 /var/opt/NodeMember/SUNWmsgsr 格式,建立唯一的安裝與配置目錄名稱。只要目錄有唯一的名稱,便可以使用任何目錄安裝二進位檔案與配置資料。
此範例假設有兩個叢集節點,其實體主機名稱分別為 mars.red.siroe.com 和 venus.red.siroe.com。
mars.red.siroe.com 的二進位檔案會安裝在 /opt/mars/SUNWmsgsr,配置資料會安裝在 /var/opt/mars/SUNWmsgsr。
venus.red.siroe.com 的二進位檔案會安裝在 /opt/venus/SUNWmsgsr,配置資料會安裝在 /var/opt/venus/SUNWmsgsr。
我們會有兩個邏輯主機名稱 meadow 和 pasture,及其各自的邏輯 IP 位址。例如,在兩個節點上的 /etc/hosts 檔案會如下所示:
192.18.75.155 meadow.red.siroe.com meadow 192.18.75.157 pasture.red.siroe.com pasture |
在兩個節點上安裝 Messaging Server Sun Cluster 代理程式套裝軟體 (SUNWscims)。
建立四個檔案系統。
這些檔案系統可以是叢集檔案系統或本機檔案系統 (容錯移轉檔案系統)。
/var/opt/mars/SUNWmsgsr /var/opt/venus/SUNWmsgsr /opt/mars/SUNWmsgsr /opt/venus/SUNWmsgsr |
這些檔案系統應掛載於共用磁碟上。以下範例顯示四個叢集檔案系統。以下顯示的 /etc/vfstab 內容在叢集的所有節點上都應相當類似。
# cat /etc/vfstab #device device mount FS fsck mount mount to mount to fsck point type pass at_boot_options /dev/md/penguin/dsk/d500 /dev/md/penguin/rdsk/d500 /opt/mars/SUNWmsgsr ufs 2 yes logging,global /dev/md/penguin/dsk/d400 /dev/md/penguin/rdsk/d400 /var/opt/mars/SUNWmsgsr ufs 2 yes logging,global /dev/md/polarbear/dsk/d200 /dev/md/polarbear/rdsk/d200 /opt/venus/SUNWmsgsr ufs 2 yes logging,global /dev/md/polarbear/dsk/d300 /dev/md/polarbear/rdsk/d300 /var/opt/venus/SUNWmsgsr ufs 2 yes logging,global |
若要將上述四個檔案系統用做本機檔案系統 (容錯移轉檔案系統),請將 [mount at boot (開機時掛載)] 選項設定為 [no],並移除掛載選項 global 關鍵字:
|
配置主節點
在主節點上增加所需的資源類型。
如此會配置 Sun Cluster 以瞭解要使用的資源類型。若要註冊 Messaging Server 和 HAStoragePlus 資源,請使用下列指令:
# scrgadm -a -t SUNW.HAStoragePlus # scrgadm -a -t SUNW.ims |
為 Messaging Server 建立名為 MS_RG_MARS 的容錯移轉資源群組。
# scrgadm -a -g MS_RG_MARS -h mars,venus |
建立名為 meadow 的邏輯主機名稱資源,並加入資源群組以進行連線。
# scrgadm -a -L -g MS_RG_MARS -l meadow # scrgadm -c -j meadow -y R_description="LogicalHostname resource for meadow" # scswitch -Z -g MS_RG_MARS |
利用先前建立的檔案系統,建立名為 ms-hasp-mars 的 HAStoragePlus 資源。
# scrgadm -a -j ms-hasp-mars -g MS_RG_MARS -t SUNW.HAStoragePlus -x FileSystemMountPoints ="/opt/mars/SUNWmsgsr, /var/opt/mars/SUNWmsgsr" -x AffinityOn=TRUE |
啟用 HAStoragePlus 資源:
# scswitch -e -j ms-hasp-mars |
在主節點上安裝 Messaging Server。
使用 Communications Suite 安裝程式安裝 Messaging Server 套裝軟體。確認已在共用檔案系統上安裝有 Messaging Server 二進位檔案和配置資料 (請參閱步驟 2)。例如,此 Messaging Server 實例的郵件傳送二進位檔案會在 /opt/mars/SUNWmsgsr 下,而配置資料會在 /var/opt/mars/SUNWmsgsr 下。
在主節點上安裝與配置 Messaging Server (請參閱1.3 建立初始 Messaging Server 執行階段配置)。
初始執行階段配置程式會要求您提供完全合格的主機名稱。請輸入邏輯主機名稱 meadow.red.siroe.com。此程式也會要求您指定配置目錄。請輸入 /var/opt/mars/SUNWmsgsr。
在主節點上執行 ha_ip_config 程序檔,並提供邏輯 IP 位址。
它僅會執行於主節點上,而不會執行於輔助節點上。ha_ip_config 程序檔位於 sbin 目錄的安裝目錄下。例如:
# /opt/mars/SUNWmsgsr/sbin/ha_ip_config Please specify the IP address assigned to the HA logical host name. Use dotted decimal form, a.b.c.d Logical IP address: 192.18.75.155 # This value is the logical IP address of the logical hostname. Refer # to the /etc/hosts file. Please specify the path to the top level directory in which iMS is installed. iMS server root: /opt/mars/SUNWmsgsr . . . Updating the file /opt/mars/SUNWmsgsr/config/dispatcher.cnf Updating the file /opt/mars/SUNWmsgsr/config/job_controller.cnf Setting the service.listenaddr configutil parameter Setting the local.snmp.listenaddr configutil parameter Setting the service.http.smtphost configutil parameter Setting the local.watcher.enable configutil parameter Setting the local.autorestart configutil parameter Setting the metermaid.config.bindaddr configutil parameters Setting the metermaid.config.serveraddr configutil parameters Setting the local.ens.port parameter Configuration successfully updated |
修改 imta.cnf 檔案,並利用 HA 邏輯主機名稱 (meadow) 替代所有的實體主機名稱 (mars)。
將資源群組容錯移轉至輔助節點 (venus)。
容錯移轉之後,接著要配置輔助節點 (venus)。
# scswitch -z -g MS_RG_VENUS -h mars |
在輔助節點 (venus) 上執行 useconfig 公用程式。請參閱3.3.3 使用 useconfig 公用程式
您無須執行初始執行階段配置程式 (configure) 或安裝 Messaging Server 套裝軟體。
在下例中,/var/opt/mars/SUNWmsgsr 是共用的配置目錄。
# useconfig /var/opt/mars/SUNWmsgsr/setup/configure_20061201124116 cp /var/opt/mars/SUNWmsgsr/setup/configure_20061201124116/Devsetup.properties /opt/mars/SUNWmsgsr/lib/config-templates/Devsetup.properties /usr/sbin/groupadd mail /usr/sbin/useradd -g mail -d / mailsrv /usr/sbin/usermod -G mail mailsrv sed -e "s/local.serveruid/mailsrv/" -e "s/local.serveruid/mail/" -e "s:<msg·RootPath>:/opt/mars/SUNWmsgsr:" /opt/mars/SUNWmsgsr/lib/config-templates/devtypes.txt.template > /opt/mars/SUNWmsgsr/lib/config-templates/devtypes.txt sed -e "s/local.serveruid/mailsrv/" -e "s/local.serveruid/mail/" -e "s:<msg·RootPath>:/opt/mars/SUNWmsgsr:" /opt/mars/SUNWmsgsr/lib/config-templates/config.ins.template > /opt/mars/SUNWmsgsr/lib/config-templates/config.ins /opt/mars/SUNWmsgsr/lib/devinstall -l sepadmsvr:pkgcfg:config -v -m -i /opt/mars/SUNWmsgsr/lib/config-templates/config.ins /opt/mars/SUNWmsgsr/lib/config-templates /opt/mars/SUNWmsgsr/lib/jars /opt/mars/SUNWmsgsr/lib devinstall returned 0 crle -c /var/ld/ld.config -s /usr/lib/secure:/opt/SUNWmsgsr/lib:/opt/venus/SUNWmsgsr/lib:/opt/mars/SUNWmsgsr/lib -s /opt/mars/SUNWmsgsr/lib See /opt/mars/SUNWmsgsr/install/useconfiglog_20061211155037 for more details |
建立 HA Messaging Server 資源,並加以啟用。
# scrgadm -a -j ms-rs-mars -t SUNW.ims -g MS_RG_MARS -x IMS_serverroot =/opt/mars/SUNWmsgsr -y Resource_dependencies=meadow,ms-hasp-mars # scswitch -e -j mail-rs-mars |
上述指令會為 Messaging Server (安裝在 /opt/mars/SUNWmsgsr 中) 建立名為 ms-rs-mars 的 HA Messaging Server 資源。此 HA Messaging Server 資源依賴於 HA 磁碟資源 (亦即先前建立的檔案系統) 以及 HA 邏輯主機名稱 meadow。
確認一切運作正常。
將 Messaging Server 資源容錯移轉回主節點。
# scswitch -z -g MAIL-RG -h mars |
同樣地,以 venus 做為主節點,而將 mars 做為輔助節點 (或待命節點),為 Messaging Server 的第二項實例建立另一個容錯移轉資源群組。
以 venus 做為此資源群組的主節點、MS_RG_VENUS 做為資源群組、pasture 做為邏輯主機名稱以及 ms-hasp-venus 做為 HAStoragePlus 資源,重複步驟 3 到步驟 10。因此,指令將應如下所示:
若要建立資源群組 MS_RG_VENUS:
# scrgadm -a -g MS_RG_VENUS -h venus,mars |
若要建立名為 pasture 的邏輯主機名稱資源,請將其加入資源群組並進行連線:
# scrgadm -a -L -g MS_RG_VENUS -l pasture # scrgadm -c -j pasture -y R_description="LogicalHostname resource for pasture" # scswitch -Z -g MS_RG_VENUS |
若要以先前建立的檔案系統建立名為 ms-hasp-venus 的 HAStoragePlus 資源:
# scrgadm -a -j ms-hasp-venus -g MS_RG_VENUS -t SUNW.HAStoragePlus -x FileSystemMountPoints ="/opt/venus/SUNWmsgsr, /var/opt/venus/SUNWmsgsr" -x AffinityOn=TRUE |
若要啟用 HAStoragePlus 資源:
# scswitch -e -j ms-hasp-venus |
若要在主節點上執行 ha_ip_config 程序檔並提供邏輯 IP 位址:
# /opt/venus/SUNWmsgsr/sbin/ha_ip_config |
若要建立 HA Messaging Server 資源並加以啟用:
# scrgadm -a -j ms-rs-venus -t SUNW.ims -g MS_RG_VENUS -x IMS_serverroot =/opt/venus/SUNWmsgsr -y Resource_dependencies=pasture,ms-hasp-venus # scswitch -e -j mail-rs-venus |
若要將資源群組容錯移轉至輔助節點 (venus):
# scswitch -z -g MS_RG_MARS -h venus |
若要在輔助節點 (mars) 上執行 useconfig (執行 useconfig 公用程式):
# useconfig /var/opt/venus/SUNWmsgsr/setup/configure_20061201124116 |
若要透過將 Messaging Server 資源容錯移轉回主節點以驗證一切運作正常:
# scswitch -z -g MAIL-RG -h venus |