OCFS安裝續3

wmlm發表於2008-11-21
續3[@more@]

安裝OCFS的過程

1 查詢作業系統版本號
$ uname -a

2 下載相應的安裝包

3 FTP上傳下面三個檔案:

ocfs-tools-1.0.10-1.i386.rpm

ocfs-support-1.0.10-1.i386.rpm

ocfs-2.4.21-EL-1.0.10-1.i686.rpm

4 安裝ocfs

[root@rac1 ocfs_setup]# ls

ocfs-2.4.21-EL-1.0.10-1.i686.rpm ocfs-support-1.0.10-1.i386.rpm

ocfs-2.4.21-EL-hugemem-1.0.10-1.i686.rpm ocfs-tools-1.0.10-1.i386.rpm

ocfs-2.4.21-EL-smp-1.0.10-1.i686.rpm

[root@rac1 ocfs_setup]#

[root@rac1 ocfs_setup]# rpm -ivh ocfs-support-1.0.10-1.i386.rpm

Preparing... ########################################### [100%]

1:ocfs-support ########################################### [100%]

[root@rac1 ocfs_setup]#

[root@rac1 ocfs_setup]# rpm -ivh ocfs-tools-1.0.10-1.i386.rpm

Preparing... ########################################### [100%]

1:ocfs-tools ########################################### [100%]

[root@rac1 ocfs_setup]# rpm -ivh ocfs-2.4.21-EL-1.0.10-1.i686.rpm

Preparing... ########################################### [100%]

1:ocfs-2.4.21-EL ########################################### [100%]

Linking OCFS module into the module path [ OK ]

在圖形化介面下,執行ocfs

To generate the /etc/ocfs.conf file, run the ocfstool tool.

su - root

ocfstool

 - Select "Task" - Select "Generate Config"

 - Select the interconnect interface (private network interface), e.g. rac1prv

 - Confirm the values displayed and exit

To load the ocfs.o kernel module, run:

su - root

# /sbin/load_ocfs

/sbin/insmod ocfs node_name=rac1prv ip_address=92.168.1.1 ip_port=7000 cs=1812 guid=582A8C17A7555FA41D350010B5C05E7F

Using /lib/modules/2.4.9-e-ABI/ocfs/ocfs.o

#

6 Creating OCFS File Systems

su - root

ocfstool

- Select "Task" - Select "Format"

su - root

mkfs.ocfs -F -b 128 -L /var/opt/oracle/oradata/orcl -m /var/opt/oracle/oradata/orcl 

          -u `id -u oracle` -g `id -g oracle` -p 0775 
#

注意:

初次產生配置檔案兩節點都要做,此後的格式化只在一個節點上做,再後的掛載兩節點都要做。

此處要選擇共享儲存,我這裡是/dev/sdb,使用fdisk -l可以檢視未分割槽的共享儲存

格式化成功後,會在Free Space中顯示出容量

之後,在ocfs圖形介面中掛載 或者使用命令掛載mount -t ocfs /dev/sdb /oracle

[root@rac1 root]# df -h

Filesystem Size Used Avail Use% Mounted on

/dev/sda2 3.9G 2.1G 1.7G 57% /

/dev/sda1 99M 9.2M 85M 10% /boot

none 250M 0 250M 0% /dev/shm

/dev/cdrom 634M 634M 0 100% /mnt/cdrom

/dev/sdb 2.0G 12M 2.0G 1% /oracle

再到2號節點上,掛載共享儲存

[root@rac2 ocfs_setup]# mount -t ocfs /dev/sdb /oracle

[root@rac2 ocfs_setup]# df -h

Filesystem Size Used Avail Use% Mounted on

/dev/sda2 3.9G 2.1G 1.7G 57% /

/dev/sda1 99M 9.2M 85M 10% /boot

none 250M 0 250M 0% /dev/shm

/dev/cdrom 634M 634M 0 100% /mnt/cdrom

/dev/sdb 2.0G 23M 2.0G 2% /oracle

如果使用圖形建立時,沒有選擇屬主oracle,使用命令列重新建立

id oracle看看oracle的使用者號500 與組號501

[root@rac1 root]# mkfs.ocfs -F -b 128 -L /oracle -m /oracle -u 500 -g 501 -p 077

5 /dev/sdb

重建後,再依次在1號機和2號機上進行掛載.

su - root

# mount -t ocfs /dev/sda1 /var/opt/oracle/oradata/orcl

Now run the ls command on all RAC nodes to check the ownership:

# ls -ld /var/opt/oracle/oradata/orcl

8 Configuring the OCFS File Systems to Mount Automatically at Startup

Add lines to the /etc/fstab file similar to the following example:

/dev/sda1 /var/opt/oracle/oradata/orcl ocfs _netdev 0 0

To make sure the ocfs.o kernel module is loaded and the OCFS file systems are mounted during the boot process, run:

su - root

# chkconfig --list ocfs

ocfs 0:off 1:off 2:off 3:on 4:on 5:on 6:off

If the flags are not set to "on" as marked in bold, run the following command:

su - root

# chkconfig ocfs on

You can also start the "ocfs" service manually by running:

su - root

# service ocfs start

When you run this command it will not only load the ocfs.o kernel module but it will also mount the OCFS filesystems as configured in /etc/fstab.

檢查所需要的linux模組以及補丁

在兩個節點上分別確定以下這些rpm包是否都存在。

make-3.79
binutils-2.11
openmotif-2.2.2-16
setarch-1.3-1

compat-libstdc++-7.3-2.96.122

compat-libstdc++-devel-7.3-2.96.122
compat-gcc-7.3-2.96.122

compat-gcc-c++-7.3-2.96.122
compat-db-4.0.14-5

如果沒有,則從AS3的安裝介質上找到這些包並加以安裝。

安裝好上面這些模組以後,需要打補丁,補丁號為:3006854

可以到oracle官方網站下載該補丁,傳送到兩個節點上以後,執行:
# unzip p3006854_9204_LINUX.zip

# chmod u+x rhel3_pre_install.sh

# sh rhel3_pre_install.sh

在在執行時提示找不到GCC ,找來1#安裝盤,補充上開發工具.

centos5上還要安裝libXp-1.0.0-8

安裝Oracle Cluster Manager

生成OCM管理檔案,放在裸裝置或共享儲存上

# su - oracle

$ dd if=/dev/zero of=/dev/raw/raw1 bs=1024 count=1024

此處沒有進行上述操作,因為直接放在共享目錄/oracle之下。

安裝OCM

$ su - root

# mv /usr/bin/gcc /usr/bin/gcc323

# ln -s /usr/bin/gcc296 /usr/bin/gcc

# mv /usr/bin/g++ /usr/bin/g++323

# ln -s /usr/bin/g++296 /usr/bin/g++

檢驗一下gccg++的版本。

# gcc -v

Reading specs from /usr/lib/gcc-lib/i386-redhat-linux7/2.96/specs gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-122)

# g++ -v

Reading specs from /usr/lib/gcc-lib/i386-redhat-linux7/2.96/specs gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-122)

將下載下來的oracle安裝介質(筆者下載的是ship_9204_linux_disk1.cpio.gzship_9204_linux_disk2.cpio.gzship_9204_linux_disk3.cpio.gz)複製到其中一個節點上。

磁碟空間不夠,再新增一塊共享磁碟來放置安裝檔案來用

C:win2kvmwareVMware Server>vmware-vdiskmanager.exe -c -q -a buslogic -s 6Gb -t 0 c:vmsharedisk02.vmdk

將第二塊共享盤掛在scsi1:1 並修改虛擬機器的vmx配置檔案 新增

scsi1:1.mode = "persistent"

同樣的方法格式化成ocfs磁碟.並修改fstab,使之自動掛載

# mkdir /oracle2

# mkfs.ocfs -F -b 128 -L  /oracle2 -m  /oracle2 

          -u `id -u oracle` -g `id -g oracle` -p 0775 /dev/sdc

/etc/fstab中新增對oracl2的掛載

/dev/sdc /oracle2 ocfs _netdev 0 0

使用FTP(或其它方式)上傳三張安裝盤

ship_9204_linux_disk1.cpio.gz

ship_9204_linux_disk2.cpio.gz

ship_9204_linux_disk3.cpio.gz

上傳完成之後,檢查一下完整性,較慢,可選操作

$ cksum *.gz

gunzip

cpio -idmv <

安裝Oracle Cluster Manager

設定xhost +

# xhost +

開始安裝OCM

# su - oracle

$ /oracle/setup/Disk1/runInstall.sh

在介面上,選擇安裝oracle cluster manager。點選next,會要求你輸入public node,這時你分兩行輸入linux1linux2。點選next,會要求你輸入private node,這時你分兩行輸入linux1-prvlinux2-prv。點選next,會要求輸入Quorum檔案,這時

在共享儲存上建立quorum.ora檔案

$ touch /oracle/quorum.ora

在輸入處輸入/oracle/quorum.ora

點選next開始安裝cluster manager軟體。這個軟體很小,安裝很快就會結束。

這一步完成後要到另外一個節點上去檢查,是否oracm檔案被複制過去了.另外在輸入公共節點與私有節點名稱時,要把本機的名稱放在上面.另外一臺主機的名稱放在下面.否則不會RCP. -----WW

配置OCM

在兩個節點上修改cmcfg.ora 目錄

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/271063/viewspace-1013665/,如需轉載,請註明出處,否則將追究法律責任。

相關文章