1. 程式人生 > >Redhat 6.1 配置Linux multipath安裝oracle 11g rac

Redhat 6.1 配置Linux multipath安裝oracle 11g rac

一、安裝配置儲存節點(略)

二、資料庫節點連線儲存節點

2.1、資料庫節點安裝ISCSI啟動器

yum install iscsi*

2.2、配置啟動器

vim /etc/iscsi/initiatorname.iscsi

2.3、發起連線

# iscsiadm -m discovery -t st -p IP

# iscsiadm -m node -l

斷開連線:

# iscsiadm -m node -u

登出掉某一個特定的Target的連線

iscsiadm -m node -T (目標器) -p (IP+埠) -u

從作業系統中刪除target資訊:

# iscsiadm -m node -o delete -T (目標器) -p (IP+埠)

檢視當前連線:

# iscsiadm -m node session

2.4、資料庫節點安裝多路徑軟體並設定開啟啟動

# yum install iscsi-initiator-utils

# yum install device-mapper-multipath

# chkconfig --list

# chkconfig multipathd on

# chkconfig iscsi on

# chkconfig iscsid on

2.5、配置多路徑軟體配置檔案

# multipath -ll     -----這句執行時可能會遇到DM模組未載入

# cp /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf /etc

[[email protected] ~]# cat /etc/multipath.conf  # This is a basic configuration file with some examples, for device mapper # multipath. # For a complete list of the default configuration values, see # /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf.defaults # For a list of configuration options with descriptions, see # /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf.annotated # # REMEMBER: After updating multipath.conf, you must run # # service multipathd reload # # for the changes to take effect in multipathd

## By default, devices with vendor = "IBM" and product = "S/390.*" are ## blacklisted. To enable mulitpathing on these devies, uncomment the ## following lines. #blacklist_exceptions { #    device { #        vendor    "IBM" #        product    "S/390.*" #    } #}

## Use user friendly names, instead of using WWIDs as names. defaults {     user_friendly_names yes                    ------multipath在Linux上的預設配置     path_grouping_policy multibus     failback immediate     no_path_retry fail } ## ## Here is an example of how to configure some standard options. ## # #defaults { #    udev_dir        /dev #    polling_interval     10 #    path_selector        "round-robin 0" #    path_grouping_policy    multibus #    getuid_callout        "/lib/udev/scsi_id --whitelisted --device=/dev/%n" #    prio            alua #    path_checker        readsector0 #    rr_min_io        100 #    max_fds            8192 #    rr_weight        priorities #    failback        immediate #    no_path_retry        fail #    user_friendly_names    yes #} ## ## The wwid line in the following blacklist section is shown as an example ## of how to blacklist devices by wwid.  The 2 devnode lines are the ## compiled in default blacklist. If you want to blacklist entire types ## of devices, such as all scsi devices, you should use a devnode line. ## However, if you want to blacklist specific devices, you should use ## a wwid line.  Since there is no guarantee that a specific device will ## not change names on reboot (from /dev/sda to /dev/sdb for example) ## devnode lines are not recommended for blacklisting specific devices. ## blacklist { #       wwid 26353900f02796769     devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"    ----定義過濾黑名單的正則     devnode "^hd[a-z]"     devnode "^sda" } #multipaths { #    multipath { #        wwid            3600508b4000156d700012000000b0000 #        alias            yellow #        path_grouping_policy    multibus #        path_checker        readsector0 #        path_selector        "round-robin 0" #        failback        manual #        rr_weight        priorities #        no_path_retry        5 #    } #    multipath { #        wwid            1DEC_____321816758474 #        alias            red #    } #}

} #devices { #    device { #        vendor            "COMPAQ  " #        product            "HSV110 (C)COMPAQ" #        path_grouping_policy    multibus #        getuid_callout          "/lib/udev/scsi_id --whitelisted --device=/dev/%n" #        path_checker        readsector0 #        path_selector        "round-robin 0" #        hardware_handler    "0" #        failback        15 #        rr_weight        priorities #        no_path_retry        queue #    } #    device { #        vendor            "COMPAQ  " #        product            "MSA1000         " #        path_grouping_policy    multibus #    } #} [[email protected] ~]#

2.6、檢視儲存端對映磁碟

重啟系統或者重啟multipath軟體後檢視

[[email protected] ~]# multipath -ll mpathe (36001405a44bed8fa92243ebbffdf2a4a) dm-1 LIO-ORG,DATA2 size=7.0G features='0' hwhandler='0' wp=rw `-+- policy='round-robin 0' prio=1 status=active   `- 33:0:0:4 sdf 8:80  active ready running mpathd (36001405f2777afe35334413a428597dd) dm-0 LIO-ORG,FRA2 size=4.0G features='0' hwhandler='0' wp=rw `-+- policy='round-robin 0' prio=1 status=active   `- 33:0:0:7 sdi 8:128 active ready running mpathi (360014051ec24687cd2f47e9a5462075b) dm-8 LIO-ORG,FRA3 size=4.0G features='0' hwhandler='0' wp=rw `-+- policy='round-robin 0' prio=1 status=active   `- 33:0:0:8 sdj 8:144 active ready running mpathh (36001405c65d4d5bb52a4dbf9ca03b44b) dm-7 LIO-ORG,DATA3 size=7.0G features='0' hwhandler='0' wp=rw `-+- policy='round-robin 0' prio=1 status=active   `- 33:0:0:5 sdg 8:96  active ready running OCRVoting3 (36001405a2d3d62e53274d7ba2ae0c7b4) dm-3 LIO-ORG,OCRVoting3 size=1.0G features='0' hwhandler='0' wp=rw `-+- policy='round-robin 0' prio=1 status=active   `- 33:0:0:2 sdd 8:48  active ready running mpathg (3600140524c968d2a27441fea594158c9) dm-6 LIO-ORG,DATA1 size=7.0G features='0' hwhandler='0' wp=rw `-+- policy='round-robin 0' prio=1 status=active   `- 33:0:0:3 sde 8:64  active ready running OCRVoting2 (360014050499205fee3d4229be9a41359) dm-4 LIO-ORG,OCRVoting2 size=1.0G features='0' hwhandler='0' wp=rw `-+- policy='round-robin 0' prio=1 status=active   `- 33:0:0:1 sdc 8:32  active ready running OCRVoting1 (3600140591641cefc96b430e9658a2cb8) dm-5 LIO-ORG,OCRVoting1 size=1.0G features='0' hwhandler='0' wp=rw `-+- policy='round-robin 0' prio=1 status=active   `- 33:0:0:0 sdb 8:16  active ready running mpathf (360014054166a939d4154d5799ad38df6) dm-2 LIO-ORG,FRA1 size=4.0G features='0' hwhandler='0' wp=rw `-+- policy='round-robin 0' prio=1 status=active   `- 33:0:0:6 sdh 8:112 active ready running [[email protected] ~]# 

2.7、修改多路徑軟體配置檔案:

[[email protected] ~]# cat /etc/multipath.conf  # This is a basic configuration file with some examples, for device mapper # multipath. # For a complete list of the default configuration values, see # /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf.defaults # For a list of configuration options with descriptions, see # /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf.annotated # # REMEMBER: After updating multipath.conf, you must run # # service multipathd reload # # for the changes to take effect in multipathd

## By default, devices with vendor = "IBM" and product = "S/390.*" are ## blacklisted. To enable mulitpathing on these devies, uncomment the ## following lines. #blacklist_exceptions { #    device { #        vendor    "IBM" #        product    "S/390.*" #    } #}

## Use user friendly names, instead of using WWIDs as names. defaults {     user_friendly_names yes                ---這裡定義的Linux的Multipath預設規則     path_grouping_policy multibus     failback immediate     no_path_retry fail } ## ## Here is an example of how to configure some standard options. ## # #defaults { #    udev_dir        /dev #    polling_interval     10 #    path_selector        "round-robin 0" #    path_grouping_policy    multibus #    getuid_callout        "/lib/udev/scsi_id --whitelisted --device=/dev/%n" #    prio            alua #    path_checker        readsector0 #    rr_min_io        100 #    max_fds            8192 #    rr_weight        priorities #    failback        immediate #    no_path_retry        fail #    user_friendly_names    yes #} ## ## The wwid line in the following blacklist section is shown as an example ## of how to blacklist devices by wwid.  The 2 devnode lines are the ## compiled in default blacklist. If you want to blacklist entire types ## of devices, such as all scsi devices, you should use a devnode line. ## However, if you want to blacklist specific devices, you should use ## a wwid line.  Since there is no guarantee that a specific device will ## not change names on reboot (from /dev/sda to /dev/sdb for example) ## devnode lines are not recommended for blacklisting specific devices. ## blacklist { #       wwid 26353900f02796769     devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"     ----這裡是定義黑名單規則,這些正則定義了過濾條件     devnode "^hd[a-z]"     devnode "^sda" } #multipaths { #    multipath { #        wwid            3600508b4000156d700012000000b0000 #        alias            yellow #        path_grouping_policy    multibus #        path_checker        readsector0 #        path_selector        "round-robin 0" #        failback        manual #        rr_weight        priorities #        no_path_retry        5 #    } #    multipath { #        wwid            1DEC_____321816758474 #        alias            red #    } #} multipaths {     multipath {     wwid 3600140591641cefc96b430e9658a2cb8        ----這裡定義的是儲存端對映過來的LUN的UUID和別名     alias OCRVoting1 }     multipath {         wwid 360014050499205fee3d4229be9a41359         alias OCRVoting2 }     multipath {         wwid 36001405a2d3d62e53274d7ba2ae0c7b4         alias OCRVoting3 }     multipath {         wwid 3600140524c968d2a27441fea594158c9         alias DATA1 }     multipath {         wwid 36001405a44bed8fa92243ebbffdf2a4a         alias DATA2 }     multipath {         wwid 36001405c65d4d5bb52a4dbf9ca03b44b         alias DATA3 }     multipath {         wwid 360014054166a939d4154d5799ad38df6         alias FRA1 }     multipath {         wwid 36001405f2777afe35334413a428597dd         alias FRA2 }     multipath {         wwid 360014051ec24687cd2f47e9a5462075b         alias FRA3 }

} #devices { #    device { #        vendor            "COMPAQ  " #        product            "HSV110 (C)COMPAQ" #        path_grouping_policy    multibus #        getuid_callout          "/lib/udev/scsi_id --whitelisted --device=/dev/%n" #        path_checker        readsector0 #        path_selector        "round-robin 0" #        hardware_handler    "0" #        failback        15 #        rr_weight        priorities #        no_path_retry        queue #    } #    device { #        vendor            "COMPAQ  " #        product            "MSA1000         " #        path_grouping_policy    multibus #    } #} [[email protected] ~]#

2.8檢視multipath對映路徑:

[[email protected] ~]# ls -lrt /dev/mapper/* crw-rw----. 1 root root 10, 58 Sep 28 11:17 /dev/mapper/control lrwxrwxrwx. 1 root root      7 Sep 28 11:17 /dev/mapper/OCRVoting3 -> ../dm-0 lrwxrwxrwx. 1 root root      7 Sep 28 11:17 /dev/mapper/DATA1 -> ../dm-1 lrwxrwxrwx. 1 root root      7 Sep 28 11:17 /dev/mapper/FRA3 -> ../dm-2 lrwxrwxrwx. 1 root root      7 Sep 28 11:17 /dev/mapper/DATA3 -> ../dm-3 lrwxrwxrwx. 1 root root      7 Sep 28 11:17 /dev/mapper/DATA2 -> ../dm-4 lrwxrwxrwx. 1 root root      7 Sep 28 11:17 /dev/mapper/FRA1 -> ../dm-5 lrwxrwxrwx. 1 root root      7 Sep 28 11:17 /dev/mapper/OCRVoting1 -> ../dm-6 lrwxrwxrwx. 1 root root      7 Sep 28 11:17 /dev/mapper/OCRVoting2 -> ../dm-7 lrwxrwxrwx. 1 root root      7 Sep 28 11:17 /dev/mapper/FRA2 -> ../dm-8 [[email protected] ~]#

三、安裝oracleasm驅動包,配置ASM磁碟

[[email protected] mapper]# /etc/init.d/oracleasm createdisk VOL1 /dev/mapper/OCRVoting1 Marking disk "VOL1" as an ASM disk:                        [  OK  ] [[email protected] mapper]#  [[email protected] mapper]# /etc/init.d/oracleasm createdisk VOL2 /dev/mapper/OCRVoting2 Marking disk "VOL2" as an ASM disk:                        [  OK  ] [[email protected] mapper]#  [[email protected] mapper]# /etc/init.d/oracleasm createdisk VOL3 /dev/mapper/OCRVoting3 Marking disk "VOL3" as an ASM disk:                        [  OK  ] [[email protected] mapper]#  [[email protected] mapper]#  [[email protected] mapper]# /etc/init.d/oracleasm createdisk VOL4 /dev/mapper/DATA1 Marking disk "VOL4" as an ASM disk:                        [  OK  ] You have new mail in /var/spool/mail/root [[email protected] mapper]#  [[email protected] mapper]# /etc/init.d/oracleasm createdisk VOL5 /dev/mapper/DATA2 Marking disk "VOL5" as an ASM disk:                        [  OK  ] [[email protected] mapper]#  [[email protected] mapper]# /etc/init.d/oracleasm createdisk VOL6 /dev/mapper/DATA3 Marking disk "VOL6" as an ASM disk:                        [  OK  ] [[email protected] mapper]#  [[email protected] mapper]# /etc/init.d/oracleasm createdisk VOL7 /dev/mapper/FRA1 Marking disk "VOL7" as an ASM disk:                        [  OK  ] [[email protected] mapper]#  [[email protected] mapper]# /etc/init.d/oracleasm createdisk VOL8 /dev/mapper/FRA2 Marking disk "VOL8" as an ASM disk:                        [  OK  ] [[email protected] mapper]#  [[email protected] mapper]# /etc/init.d/oracleasm createdisk VOL9 /dev/mapper/FRA3 Marking disk "VOL9" as an ASM disk:                        [  OK  ] [[email protected] mapper]# 

檢視ASM對應磁碟資訊:

[[email protected] ~]# /etc/init.d/oracleasm querydisk /dev/mapper/* Unable to access device "/dev/mapper/control" Device "/dev/mapper/DATA1" is marked an ASM disk with the label "VOL4" Device "/dev/mapper/DATA2" is marked an ASM disk with the label "VOL5" Device "/dev/mapper/DATA3" is marked an ASM disk with the label "VOL6" Device "/dev/mapper/FRA1" is marked an ASM disk with the label "VOL7" Device "/dev/mapper/FRA2" is marked an ASM disk with the label "VOL8" Device "/dev/mapper/FRA3" is marked an ASM disk with the label "VOL9" Device "/dev/mapper/OCRVoting1" is marked an ASM disk with the label "VOL1" Device "/dev/mapper/OCRVoting2" is marked an ASM disk with the label "VOL2" Device "/dev/mapper/OCRVoting3" is marked an ASM disk with the label "VOL3" [[email protected] ~]# 

四、安裝cluster與database軟體(略)