歡迎您光臨本站 註冊首頁

關於redhat advance server 2.1 的cluster問題

←手機掃碼閱讀     火星人 @ 2014-03-04 , reply:0

關於redhat advance server 2.1 的cluster問題

我用advance server 2.1自帶的cluster可以做到使用塊設備(/dev/sdb3)上建立文件系統(ext3等)對oracle做ha。但無法使用lvm上建立得文件系統做ha。因為在第一種情況下,當node1 switch to node2時cluster會停止oralce service並umoun storge.然後在node2上up.擔對於lvm不是簡單的進行umount而是需要卷組在兩台節點之間進行export import后在mout然後在啟動oracle service。
    所以請問大家可有什麼解決的辦法?當然還是採用redhat advance server 2.1和lvm。
《解決方案》

關於redhat advance server 2.1 的cluster問題

我沒用過,但一定有個 pre-service 配置文件或腳本,umount 命令和網路配置就是被這個東東執行的,把 export 卷組的命令放在裡面即可。

另,你在用這個嗎?多少錢買的?用於生產還是自己玩?透露一下可否
《解決方案》

關於redhat advance server 2.1 的cluster問題

我在寫export和import的腳本。但是lvm在管理共享storge時。經常會遇到
ERROR: VGDA in kernel and lvmtab are NOT consistent。所以要經常重起機器。但在實際應用中是不可能的。
   我在測試。因為veritas的產品太貴了。除了不能用lvm外advance server 的cluster還是很不錯的。advance server 是從朋友那裡刻的。
《解決方案》

關於redhat advance server 2.1 的cluster問題

解決了:-)
《解決方案》

關於redhat advance server 2.1 的cluster問題

能不能共享你有成功經驗,我也準備做linuxADV21的雙機測試。以前我用redhat7.3加rose HA.
《解決方案》

關於redhat advance server 2.1 的cluster問題

軟體:   
操作系統:redhat advance server2.1
卷管理:lvm_1.0.7.tar.gz
文件系統:我用的是reiserfs
資料庫:oracle 9i

硬體:
磁碟陣列。兩台pc server 。兩塊網卡。其中一塊連lan,一塊互連。

1)首先兩台主機都能認到磁碟陣列
2)然後安裝lvm
       tar vxfz lvm_x.x.x.tar.gz
       cd lvm_x.x.x
       ./configure
       make
       make install
3)編譯內核
  (將Multi-device support (RAID and LVM)->;Logical volume manager (LVM) support選中)
  (將filesystem -->; <M>; Reiserfs support選中)
  然後編譯內核,改變lilo.conf文件
  當然如果你不使用lvm和reiserfs那麼這步就不做了
  
4)需要注意的裝了lvm在很多文檔中介紹將vgscan 和vgchange -a y 加入rc.local,但在雙機一定不能同時加,
   (最好不要加,在後面的腳本中來解決)。然後修改rc.sysinit也將啟動vg的語句註釋掉。
   
5)使兩台主機能用root rsh (當然會存在安全問題,但沒有辦法誰叫我們用lvm呢。)

6) 磁碟分區(最少三個區)
    fdisk /dev/sdb
    sdb1和sdb2隻要有100m就夠了。剩下的隨你怎麼分配
    修改兩台主機得/etc/sysconfig/rawdevices文件加入:
    /dev/raw/raw1 /dev/sdb1
    /dev/raw/raw2 /dev/sdb2
    后reboot


7)建立物理卷,建立卷組,建立卷,建立文件系統。然後手工在兩台主機之間將卷export import mount umount。
   如果沒有問題就成功一半了

7) 接下來配置cluster,我們分別將兩台主機命名為clu1 clu2。<>;表示輸入的.
   兩台的hosts文件
   127.0.0.1                localhost.localdomain localhost
   192.168.1.1              clu1
   10.0.0.1                 eclu1
   192.168.1.2              clu2
   10.0.0.2                 eclu2
   192.168.1.3              culalis
   
   /sbin/cluconfig
   Red Hat Cluster Manager Configuration Utility (running on clu1)
   - Configuration file exists already.
  Would you like to use those prior settings as defaults? (yes/no) :<yes>;
  Enter cluster name:<clutest>;
  Enter IP address for cluster alias:<192.168.1.3>;
  --------------------------------
Information for Cluster Member 0
--------------------------------
Enter name of cluster member <clu1>;
Looking for host clutest2 (may take a few seconds)...
Enter number of heartbeat channels (minimum = 1) : <1>;
Information about Channel 0
Channel type: net or serial :<net>;
Enter hostname of the cluster member on heartbeat channel 0:<eclu1>;
Information about Quorum Partitions
Enter Primary Quorum Partition : 回車
Enter Shadow Quorum Partition : 回車
Information About the Power Switch That Power Cycles Member 'clutest2'
Choose one of the following power switches:
  o NONE
  o RPS10
  o BAYTECH
  o APCSERIAL
  o APCMASTER
  o WTI_NPS
  o SW_WATCHDOG
Power switch : <none>;
Note: Operating a cluster without a remote power switch does not provide
maximum data integrity guarantees.
--------------------------------
Information for Cluster Member 1
--------------------------------
Enter name of cluster member :<clu2>;
Looking for host clutest1 (may take a few seconds)...
Information about Channel 0
Enter hostname of the cluster member on heartbeat channel 0:<eclu2>;
Information about Quorum Partitions
Enter Primary Quorum Partition : 回車
Enter Shadow Quorum Partition : 回車
Information About the Power Switch That Power Cycles Member 'clutest2'
Choose one of the following power switches:
  o NONE
  o RPS10
  o BAYTECH
  o APCSERIAL
  o APCMASTER
  o WTI_NPS
  o SW_WATCHDOG
Power switch : <none>;
Heartbeat channels: 1
Channel type: net, Name: eclutest2
Power switch IP address or hostname: clutest2
Identifier on power controller for member clutest2: unused
--------------------
Member 1 Information
--------------------
Name: clutest1
Primary quorum partition: /dev/raw/raw1
Shadow quorum partition: /dev/raw/raw2
Heartbeat channels: 1
Channel type: net, Name: eclutest1
Power switch IP address or hostname: clutest1
Identifier on power controller for member clutest1: unused
--------------------------
Power Switch 0 Information
--------------------------
Power switch IP address or hostname: clutest2
Type: NONE
Login or port: unused
Password: unused
--------------------------
Power Switch 1 Information
--------------------------
Power switch IP address or hostname: clutest1
Type: NONE
Login or port: unused
Password: unused
Save the cluster member information? yes/no : <yes>;
Writing to configuration file...done
Configuration information has been saved to /etc/cluster.conf.
----------------------------
Setting up Quorum Partitions
----------------------------
Running cludiskutil -I to initialize the quorum partitions: done
Saving configuration information to quorum partitions: done
Do you wish to allow remote monitoring of the cluster? yes/no : <yes>;
----------------------------------------------------------------
Configuration on this member is complete.
To configure the next member, invoke the following command on that system:
# /sbin/cluconfig --init=/dev/raw/raw1
Refer to the Red Hat Cluster Manager Installation and Administration Guide
for details.

上面太長了,沒關係。只要注意」<>;「和「回車」就可以了。接下來運行
# /sbin/cluconfig --init=/dev/raw/raw1
然後做一些監測
/sbin/cludiskutil -p
----- Shared State Header ------
Magic# = 0x39119fcd
Version = 1
Updated on Thu Sep 14 05:43:18 2000
Updated by node 0
--------------------------------
在兩台主機都運行,顯示的相同就可以了。
clustonith -S
null device OK.
監測完畢。

接這在兩主機上安裝oracle。最好在一台主機裝好測試過後打包在另一台主機在解包。
oracle 安裝好后,寫三個腳本
(1):/home/oracle/oracleclu (擁有者是root)
#!/bin/bash

#
# Cluster service script to start/stop oracle
#

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin;export PATH

case "$1" in
    start)
            rsh clu1 umount /data1
            rsh clu1 /sbin/vgchange -a n
            rsh clu1 /sbin/vgexport search
            /sbin/vgscan
            /sbin/vgimport -f search /dev/sdb3
            mount /dev/search/data1 /data1
            su - oracle -c /home/oracle/startdb
            su - oracle -c "lsnrctl start"
       ;;
    stop)
       su - oracle -c /home/oracle/stopdb
       su - oracle -c "lsnrctl stop"
       umount /data1
       vgchange -a n
       vgexport search   
       ;;
esac

(2)/home/oracle/startdb (擁有者是oracle)
#!/bin/bash
ORACLE_RELEASE=9.2.0
export ORACLE_SID=searchdb
export ORACLE_HOME=/home/oracle/920
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
PATH=$HOME/bin:$ORACLE_HOME/bin:/usr/local/jdk/bin:$PATH
sqlplus /nolog<<EOF
connect / as sysdba
startup pfile=/home/oracle/admin/searchdb/pfile/initsearchdb.ora
EOF
exit

(2)/home/oracle/stopdb (擁有者是oracle)
#!/bin/bash
ORACLE_RELEASE=9.2.0
export ORACLE_SID=searchdb
export ORACLE_HOME=/home/oracle/920
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
PATH=$HOME/bin:$ORACLE_HOME/bin:/usr/local/jdk/bin:$PATH
sqlplus /nolog<<EOF
connect / as sysdba
shutdown immediate
EOF
exit

在cluster中添加service
在兩台主機上都執行service cluster start
/sbin/cluadmin
cluadmin>;service add oracle
Preferred member : <clu1>;
Relocate when the preferred member joins the cluster (yes/no/?) \
: <no>;
User script (e.g., /usr/foo/script or None) \
: </home/oracle/oracleclu>;
Do you want to add an IP address to the service (yes/no/?): yes
IP Address Information
IP address: <192.168.1.4>;    #client connect oracle ip
Netmask (e.g. 255.255.255.0 or None) : <255.255.255.0>;
Broadcast (e.g. X.Y.Z.255 or None) : <192.168.1.255>;
Do you want to (a)dd, (m)odify, (d)elete or (s)how an IP address,
or are you (f)inished adding IP addresses: f
Do you want to add a disk device to the service (yes/no/?): yes #如果使用lvm這裡輸入no
Disk Device Information
Device special file (e.g., /dev/sda1): </dev/sda3>;
Filesystem type (e.g., ext2, reiserfs, ext3 or None): <ext3>;
Mount point (e.g., /usr/mnt/service1 or None) :</oradata>;
Mount options (e.g., rw, nosuid): 回車
Forced unmount support (yes/no/?) : <yes>;
Do you want to (a)dd, (m)odify, (d)elete or (s)how devices,
or are you (f)inished adding device information: <f>;



應用:
clustat 察看cluster狀態
cluadmin>; cluster status
Cluster Status Monitor (eachnet)                                        15:58:26

Cluster alias: cluster

=========================  M e m b e r   S t a t u s  ==========================

  Member         Status     Node Id    Power Switch
  -------------- ---------- ---------- ------------
  clutest2       Up         0          Good        
  clutest1       Up         1          Good        

=========================  H e a r t b e a t   S t a t u s  ====================

  Name                           Type       Status   
  ------------------------------ ---------- ------------
  eclutest2    <-->; eclutest1    network    ONLINE              

=========================  S e r v i c e   S t a t u s  ========================

                                         Last             Monitor  Restart
  Service        Status   Owner          Transition       Interval Count   
  -------------- -------- -------------- ---------------- -------- -------
  oracle         started  clutest2       15:57:48 Jul 03  30       0      
cluadmin>;service relocate oracle 把oracle從一台主機切到另一台。
《解決方案》

關於redhat advance server 2.1 的cluster問題

很好就是沒實際做過,red hat ad 2.1 cluster是不是支持ha 和nlb(負載均衡)兩種模式,還是只支持ha.   

              謝謝
《解決方案》

關於redhat advance server 2.1 的cluster問題

除了LVM以外,有沒有其它的東西了?
《解決方案》

關於redhat advance server 2.1 的cluster問題

以上的這些相關的軟體包到哪裡找呀!
《解決方案》

關於redhat advance server 2.1 的cluster問題

Thank you for  sharing,Thank you for  brother.

[火星人 ] 關於redhat advance server 2.1 的cluster問題已經有682次圍觀

http://coctec.com/docs/service/show-post-10235.html