linux配置multipath 並安裝rac

myownstars發表於2011-04-20
1024x768 Normal 0 7.8 磅 0 2 false false false EN-US ZH-CN X-NONE[root@rac2 ~]# /etc/init.d/iscsi start

Checking iscsi config:  [FAILED]

檢查iscsi是否已經安裝

[root@testdb2 ~]# rpm -qa | grep iscsi

尚未安裝

[root@testdb2 ~]# yum install iscsi*

Setting up Install Process

Setting up repositories

Reading repository metadata in from local files

Parsing package install arguments

Resolving Dependencies

--&gt Populating transaction set with selected packages. Please wait.

---&gt Downloading header for iscsi-initiator-utils to pack into transaction set.

iscsi-initiator-utils-4.0 100% |=========================| 6.9 kB    00:00    

---&gt Package iscsi-initiator-utils.i386 0:4.0.3.0-7 set to be updated

--&gt Running transaction check

--&gt Processing Dependency: libsysfs.so.1 for package: iscsi-initiator-utils

--&gt Restarting Dependency Resolution with new changes.

--&gt Populating transaction set with selected packages. Please wait.

---&gt Downloading header for sysfsutils to pack into transaction set.

sysfsutils-1.2.0-1.i386.r 100% |=========================| 4.0 kB    00:00    

---&gt Package sysfsutils.i386 0:1.2.0-1 set to be updated

--&gt Running transaction check

 

Dependencies Resolved

 

=============================================================================

 Package                 Arch       Version          Repository        Size

=============================================================================

Installing:

 iscsi-initiator-utils   i386       4.0.3.0-7        yihaodian          92 k

Installing for dependencies:

 sysfsutils              i386       1.2.0-1          yihaodian          56 k

 

Transaction Summary

=============================================================================

Install      2 Package(s)        

Update       0 Package(s)        

Remove       0 Package(s)        

Total download size: 148 k

Is this ok [y/N]: y

Downloading Packages:

(1/2): sysfsutils-1.2.0-1 100% |=========================|  56 kB    00:00    

(2/2): iscsi-initiator-ut 100% |=========================|  92 kB    00:00    

Running Transaction Test

Finished Transaction Test

Transaction Test Succeeded

Running Transaction

  Installing: sysfsutils                   ######################### [1/2]

  Installing: iscsi-initiator-utils        ######################### [2/2]

 

Installed: iscsi-initiator-utils.i386 0:4.0.3.0-7

Dependency Installed: sysfsutils.i386 0:1.2.0-1

Complete! [root@rac2 ~]# rpm -qa | grep iscsi

iscsi-initiator-utils-4.0.3.0-8

[root@rac2 ~]# cat /etc/initiatorname.iscsi

GenerateName=yes

已經安裝成功,編輯檔案,加入儲存地址,預設埠號3260可以省略

[root@rac2 ~]# cat /dev/null > /etc/iscsi.conf

[root@rac2 ~]# vi /etc/iscsi.conf

DiscoveryAddress=*.*.*.*

重啟iscsi服務

[root@rac2 ~]# service iscsi restart

Searching for iscsi-based multipath maps

Found 0 maps

Stopping iscsid: iscsid not running

 

Checking iscsi config:  [  OK  ]

Loading iscsi driver:  [  OK  ]

Starting iscsid: [  OK  ]

配置成功

[root@rac2 ~]# more /etc/initiatorname.iscsi

## DO NOT EDIT OR REMOVE THIS FILE!

## If you remove this file, the iSCSI daemon will not start.

## If you change the InitiatorName, existing access control lists

## may reject this initiator.  The InitiatorName must be unique

## for each iSCSI initiator.  Do NOT duplicate iSCSI InitiatorNames.

InitiatorName=iqn.1987-05.com.cisco:01.e94b10fc7a5e

配置iscsi隨機器開啟自動啟動

[root@rac2 ~]# chkconfig  iscsi --list

iscsi           0:off   1:off   2:off   3:off   4:off   5:off   6:off

[root@rac2 ~]# chkconfig  iscsi on

[root@rac2 ~]# chkconfig  iscsi --list

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

[root@rac2 ~]# chkconfig  multipathd --list

multipathd      0:off   1:off   2:off   3:off   4:off   5:off   6:off

[root@rac2 ~]# chkconfig  multipathd on

[root@rac2 ~]# chkconfig  multipathd --list

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

接下來連線到儲存頁面,新增lun group

 

建立了linux主機到儲存的關聯,接著建立一個lun

 

接著將其對映到剛剛新建的組中

 

重啟Linuxiscsi服務

[root@rac2 ~]# service iscsi restart

Searching for iscsi-based multipath maps

Found 0 maps

Stopping iscsid: [  OK  ]

Removing iscsi driver: [  OK  ]

Checking iscsi config:  [  OK  ]

Loading iscsi driver:  [  OK  ]

Starting iscsid: [  OK  ]

可以透過fdisk –l看到剛剛新對映的lun

[root@rac2 ~]# fdisk -l

 

Disk /dev/sda: 898.3 GB, 898319253504 bytes

255 heads, 63 sectors/track, 109214 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

 

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1         522     4192933+  83  Linux

/dev/sda2             523       16840   131074335   82  Linux swap

/dev/sda3           16841       22062    41945715   83  Linux

/dev/sda4           22063      109214   700048440    5  Extended

/dev/sda5           22063      109214   700048408+  83  Linux

 

Disk /dev/sdb: 209 MB, 209715200 bytes

7 heads, 58 sectors/track, 1008 cylinders

Units = cylinders of 406 * 512 = 207872 bytes

 

Disk /dev/sdb doesn't contain a valid partition table

編輯multipath.conf檔案,將下面一段記錄註釋

#devnode_blacklist {       

#        devnode "*"

#}

[root@rac2 ~]# multipath -F

[root@rac2 ~]# multipath -v2

create: mpath1 (360a9800050336d38565a63486f626370)

[size=200 MB][features="1 queue_if_no_path"][hwhandler="0"]

\_ round-robin 0 [prio=2]

 \_ 9:0:0:1 sdb 8:16 [ready]

成功將Lun對映

[root@rac2 ~]# more /var/lib/multipath/bindings

# Multipath bindings, Version : 1.0

# NOTE: this file is automatically maintained by the multipath program.

# You should not need to edit this file in normal circumstances.

#

# Format:

# alias wwid

#

mpath0 36842b2b06e778700148674ea06677df0

mpath1 360a9800050336d38565a63486f626370mpath1改為ocr1

[root@rac2 ~]# cd /dev/mapper

[root@rac2 mapper]# multipath -F

[root@rac2 mapper]# multipath -v2

create: ocr1 (360a9800050336d38565a63486f626370)

[size=200 MB][features="1 queue_if_no_path"][hwhandler="0"]

\_ round-robin 0 [prio=2]

 \_ 9:0:0:1 sdb 8:16 [ready]

 

[root@rac2 mapper]# ls -altr

total 0

brw-rw----   1 root disk 253,  0 Apr 18 04:35 ocr1

drwxr-xr-x   2 root root      80 Apr 18 04:35 .

drwxr-xr-x  10 root root    6340 Apr 18 04:35 ..

crw-------   1 root root  10, 63 Apr 18  2011 control

編輯/etc/multipath.conf檔案,新增以下內容

multipaths {

        multipath {

                wwid            360a9800050336d38565a63486f626370

                alias                   ocr1

                path_grouping_policy    multibus

                path_checker            readsector0

                path_selector           "round-robin 0"

                failback                manual

                rr_weight               priorities

                no_path_retry           5

        }

}

對剛剛載入的lun ocr1進行分割槽

[root@rac2 mapper]# fdisk ocr1

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel

Building a new DOS disklabel. Changes will remain in memory only,

until you decide to write them. After that, of course, the previous

content won't be recoverable.

 

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

 

Command (m for help): p

 

Disk ocr1: 209 MB, 209715200 bytes

7 heads, 58 sectors/track, 1008 cylinders

Units = cylinders of 406 * 512 = 207872 bytes

 

Device Boot      Start         End      Blocks   Id  System

 

Command (m for help): n

Command action

   e   extended

   p   primary partition (1-4)

p

Partition number (1-4): 1

First cylinder (1-1008, default 1): 1

Last cylinder or +size or +sizeM or +sizeK (1-1008, default 1008): +100M

 

Command (m for help): n

Command action

   e   extended

   p   primary partition (1-4)

p

Partition number (1-4): 2

First cylinder (483-1008, default 483):

Using default value 483

Last cylinder or +size or +sizeM or +sizeK (483-1008, default 1008):

Using default value 1008

 

Command (m for help): w

The partition table has been altered!

 

Calling ioctl() to re-read partition table.

 

WARNING: Re-reading the partition table failed with error 22: Invalid argument.

The kernel still uses the old table.

The new table will be used at the next reboot.

Syncing disks

然後重啟,重新啟動之後Linux才會真正能夠使用該分割槽

[root@rac2 mapper]#  reboot

 

Broadcast message from root (pts/1) (Mon Apr 18 04:37:46 2011):

 

The system is going down for reboot NOW!

重啟完成,配置raw對映

[root@rac2 ~]# vi /etc/sysconfig/rawdevices

/dev/raw/raw1 /dev/mapper/ocr1p2

/dev/raw/raw2 /dev/mapper/ocr2p2

/dev/raw/raw3 /dev/mapper/vote1p2

/dev/raw/raw4 /dev/mapper/vote2p2

/dev/raw/raw5 /dev/mapper/vote3p2

/dev/raw/raw6 /dev/mapper/datap1

/dev/raw/raw7 /dev/mapper/recoveryp1

然後開啟rawdevicesfuw

[root@rac1 ~]# service rawdevices restart

Assigning devices:

           /dev/raw/raw1  --&gt   /dev/mapper/ocr1p2

/dev/raw/raw1:  bound to major 253, minor 18

           /dev/raw/raw2  --&gt   /dev/mapper/ocr2p2

/dev/raw/raw2:  bound to major 253, minor 8

           /dev/raw/raw3  --&gt   /dev/mapper/vote1p2

/dev/raw/raw3:  bound to major 253, minor 15

           /dev/raw/raw4  --&gt   /dev/mapper/vote2p2

/dev/raw/raw4:  bound to major 253, minor 17

           /dev/raw/raw5  --&gt   /dev/mapper/vote3p2

/dev/raw/raw5:  bound to major 253, minor 16

           /dev/raw/raw6  --&gt   /dev/mapper/datap1

/dev/raw/raw6:  bound to major 253, minor 10

           /dev/raw/raw7  --&gt   /dev/mapper/recoveryp1

/dev/raw/raw7:  bound to major 253, minor 13

done

[root@rac1 raw]# chown -R oracle:oinstall /dev/raw/*

[root@rac1 raw]# chmod -R 660 /dev/raw/*

[root@rac1 raw]# vi /etc/udev/permissions.d/50-udev.permissions

# raw devices

ram*:oracle:dba:0660

raw/*:oracle:dba:0660

 

[root@rac2 ~]# chkconfig --list rawdevices

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

[root@rac2 ~]# chkconfig rawdevices on

[root@rac2 ~]# chkconfig --list rawdevices

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

 

儲存配置完成了,開始安裝oracle

1 配置/etc/hosts

2 配置使用者等價性

3 配置系統引數

4 安裝clusterware

  預先檢查[oracle@rac1 cluvfy]$ ./runcluvfy.sh stage -pre crsinst -n rac1,rac2 –verbose

OraCrs10g_home

/home/oracle/oracle/product/10.2.0/crs

 

最後執行root.sh的時候一直不成功

 

[root@rac1 bin]# ./clsfmt.bin ocr /dev/raw/raw1

clsfmt: Failure trying to resize OCR file from 109340672 bytes to 109342720 bytes

clsfmt: Received unexpected error 4 from skgfifi

skgfifi: Additional information: -2

Additional information: 109340672

經查證是bug http://blog.csdn.net/tianlesoftware/archive/2010/11/27/6039210.aspx

[oracle@rac1 ~]$ unzip p4679769_10201_Linux-x86-64.zip

Archive:  p4679769_10201_Linux-x86-64.zip

   creating: 4679769/

  inflating: 4679769/README.txt     

  inflating: 4679769/clsfmt.bin 

[oracle@rac1 ~]$ cp 4679769/clsfmt.bin  /home/oracle/oracle/product/10.2.0/crs/bin/

[root@rac1 bin]# ./clsfmt.bin ocr /dev/raw/raw1

clsfmt: Failure trying to resize OCR file from 109340672 bytes to 109342720 bytes

clsfmt: successfully initialized file /dev/raw/raw1

 

執行vipca

 

執行runinstall安裝資料庫軟體

 

升級至10205

接下來的事情就一帆風順了

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

相關文章