千家信息网

【Oracle Database】Oracle RAC(一):共享存储

发表于:2024-12-03 作者:千家信息网编辑
千家信息网最后更新 2024年12月03日,[root@wallet03 ~]# yum install -y scsi-target-utils[root@wallet03 ~]# vi /etc/tgt/targets.conf
千家信息网最后更新 2024年12月03日【Oracle Database】Oracle RAC(一):共享存储
[root@wallet03 ~]# yum install -y scsi-target-utils[root@wallet03 ~]# vi /etc/tgt/targets.conf        bacwallet-store /dev/sdb        initiator-address 192.168.40.0/24        incominguser gscf gscf@1234        write-cache off        bacwallet-store /dev/sdc        initiator-address 192.168.40.0/24        incominguser gscf gscf@1234        write-cache off        bacwallet-store /dev/sdd        initiator-address 192.168.40.0/24        incominguser gscf gscf@1234        write-cache off        bacwallet-store /dev/sde        initiator-address 192.168.40.0/24        incominguser gscf gscf@1234        write-cache off        bacwallet-store /dev/sdf        initiator-address 192.168.40.0/24        incominguser gscf gscf@1234        write-cache off        bacwallet-store /dev/sdg        initiator-address 192.168.40.0/24        incominguser gscf gscf@1234        write-cache off        bacwallet-store /dev/sdh        initiator-address 192.168.40.0/24        incominguser gscf gscf@1234        write-cache off        bacwallet-store /dev/sdi        initiator-address 192.168.40.0/24        incominguser gscf gscf@1234        write-cache off        bacwallet-store /dev/sdj        initiator-address 192.168.40.0/24        incominguser gscf gscf@1234        write-cache off        bacwallet-store /dev/sdk        initiator-address 192.168.40.0/24        incominguser gscf gscf@1234        write-cache off[root@wallet03 ~]# service tgtd startStarting SCSI target daemon:                               [  OK  ][root@wallet03 ~]# service tgtd statustgtd (pid 1599 1598) is running...[root@wallet03 ~]# netstat -tunlp | grep tgtdtcp        0      0 0.0.0.0:3260        0.0.0.0:*        LISTEN      1879/tgtd           tcp        0      0 :::3260             :::*             LISTEN      1879/tgtd [root@wallet01 ~]# yum install -y iscsi-initiator-utils[root@wallet01 ~]# vim /etc/iscsi/iscsid.confnode.session.auth.authmethod = CHAPnode.session.auth.username = gscfnode.session.auth.password = gscf@1234[root@wallet01 ~]# iscsiadm -m discovery -t sendtargets -p 192.168.40.36Starting iscsid:                                           [  OK  ]192.168.40.36:3260,1 iqn.2019-02.com.gscaifu:disk01192.168.40.36:3260,1 iqn.2019-02.com.gscaifu:disk02192.168.40.36:3260,1 iqn.2019-02.com.gscaifu:disk03192.168.40.36:3260,1 iqn.2019-02.com.gscaifu:disk04192.168.40.36:3260,1 iqn.2019-02.com.gscaifu:disk05192.168.40.36:3260,1 iqn.2019-02.com.gscaifu:disk06192.168.40.36:3260,1 iqn.2019-02.com.gscaifu:disk07192.168.40.36:3260,1 iqn.2019-02.com.gscaifu:disk08192.168.40.36:3260,1 iqn.2019-02.com.gscaifu:disk09192.168.40.36:3260,1 iqn.2019-02.com.gscaifu:disk10[root@wallet01 ~]# iscsiadm -m node -T iqn.2019-02.com.gscaifu:disk01 --loginLogging in to [iface: default, target: iqn.2019-02.com.gscaifu:disk01, portal: 192.168.40.36,3260] (multiple)Login to [iface: default, target: iqn.2019-02.com.gscaifu:disk01, portal: 192.168.40.36,3260] successful.[root@wallet01 ~]# iscsiadm -m node -T iqn.2019-02.com.gscaifu:disk02 --loginLogging in to [iface: default, target: iqn.2019-02.com.gscaifu:disk02, portal: 192.168.40.36,3260] (multiple)Login to [iface: default, target: iqn.2019-02.com.gscaifu:disk02, portal: 192.168.40.36,3260] successful.[root@wallet01 ~]# iscsiadm -m node -T iqn.2019-02.com.gscaifu:disk03 --loginLogging in to [iface: default, target: iqn.2019-02.com.gscaifu:disk03, portal: 192.168.40.36,3260] (multiple)Login to [iface: default, target: iqn.2019-02.com.gscaifu:disk03, portal: 192.168.40.36,3260] successful.[root@wallet01 ~]# iscsiadm -m node -T iqn.2019-02.com.gscaifu:disk04 --loginLogging in to [iface: default, target: iqn.2019-02.com.gscaifu:disk04, portal: 192.168.40.36,3260] (multiple)Login to [iface: default, target: iqn.2019-02.com.gscaifu:disk04, portal: 192.168.40.36,3260] successful.[root@wallet01 ~]# iscsiadm -m node -T iqn.2019-02.com.gscaifu:disk05 --loginLogging in to [iface: default, target: iqn.2019-02.com.gscaifu:disk05, portal: 192.168.40.36,3260] (multiple)Login to [iface: default, target: iqn.2019-02.com.gscaifu:disk05, portal: 192.168.40.36,3260] successful.[root@wallet01 ~]# iscsiadm -m node -T iqn.2019-02.com.gscaifu:disk06 --loginLogging in to [iface: default, target: iqn.2019-02.com.gscaifu:disk06, portal: 192.168.40.36,3260] (multiple)Login to [iface: default, target: iqn.2019-02.com.gscaifu:disk06, portal: 192.168.40.36,3260] successful.[root@wallet01 ~]# iscsiadm -m node -T iqn.2019-02.com.gscaifu:disk07 --loginLogging in to [iface: default, target: iqn.2019-02.com.gscaifu:disk07, portal: 192.168.40.36,3260] (multiple)Login to [iface: default, target: iqn.2019-02.com.gscaifu:disk07, portal: 192.168.40.36,3260] successful.[root@wallet01 ~]# iscsiadm -m node -T iqn.2019-02.com.gscaifu:disk08 --loginLogging in to [iface: default, target: iqn.2019-02.com.gscaifu:disk08, portal: 192.168.40.36,3260] (multiple)Login to [iface: default, target: iqn.2019-02.com.gscaifu:disk08, portal: 192.168.40.36,3260] successful.[root@wallet01 ~]# iscsiadm -m node -T iqn.2019-02.com.gscaifu:disk09 --loginLogging in to [iface: default, target: iqn.2019-02.com.gscaifu:disk09, portal: 192.168.40.36,3260] (multiple)Login to [iface: default, target: iqn.2019-02.com.gscaifu:disk09, portal: 192.168.40.36,3260] successful.[root@wallet01 ~]# iscsiadm -m node -T iqn.2019-02.com.gscaifu:disk10 --login Logging in to [iface: default, target: iqn.2019-02.com.gscaifu:disk10, portal: 192.168.40.36,3260] (multiple)Login to [iface: default, target: iqn.2019-02.com.gscaifu:disk10, portal: 192.168.40.36,3260] successful.[root@wallet02 ~]# yum install -y iscsi-initiator-utils[root@wallet02 ~]# vim /etc/iscsi/iscsid.confnode.session.auth.authmethod = CHAPnode.session.auth.username = gscfnode.session.auth.password = gscf@1234[root@wallet02 ~]# iscsiadm -m discovery -t sendtargets -p 192.168.40.36Starting iscsid:                                           [  OK  ]192.168.40.36:3260,1 iqn.2019-02.com.gscaifu:disk01192.168.40.36:3260,1 iqn.2019-02.com.gscaifu:disk02192.168.40.36:3260,1 iqn.2019-02.com.gscaifu:disk03192.168.40.36:3260,1 iqn.2019-02.com.gscaifu:disk04192.168.40.36:3260,1 iqn.2019-02.com.gscaifu:disk05192.168.40.36:3260,1 iqn.2019-02.com.gscaifu:disk06192.168.40.36:3260,1 iqn.2019-02.com.gscaifu:disk07192.168.40.36:3260,1 iqn.2019-02.com.gscaifu:disk08192.168.40.36:3260,1 iqn.2019-02.com.gscaifu:disk09192.168.40.36:3260,1 iqn.2019-02.com.gscaifu:disk10[root@wallet02 ~]# iscsiadm -m node -T iqn.2019-02.com.gscaifu:disk01 --loginLogging in to [iface: default, target: iqn.2019-02.com.gscaifu:disk01, portal: 192.168.40.36,3260] (multiple)Login to [iface: default, target: iqn.2019-02.com.gscaifu:disk01, portal: 192.168.40.36,3260] successful.[root@wallet02 ~]# iscsiadm -m node -T iqn.2019-02.com.gscaifu:disk02 --loginLogging in to [iface: default, target: iqn.2019-02.com.gscaifu:disk02, portal: 192.168.40.36,3260] (multiple)Login to [iface: default, target: iqn.2019-02.com.gscaifu:disk02, portal: 192.168.40.36,3260] successful.[root@wallet02 ~]# iscsiadm -m node -T iqn.2019-02.com.gscaifu:disk03 --loginLogging in to [iface: default, target: iqn.2019-02.com.gscaifu:disk03, portal: 192.168.40.36,3260] (multiple)Login to [iface: default, target: iqn.2019-02.com.gscaifu:disk03, portal: 192.168.40.36,3260] successful.[root@wallet02 ~]# iscsiadm -m node -T iqn.2019-02.com.gscaifu:disk04 --loginLogging in to [iface: default, target: iqn.2019-02.com.gscaifu:disk04, portal: 192.168.40.36,3260] (multiple)Login to [iface: default, target: iqn.2019-02.com.gscaifu:disk04, portal: 192.168.40.36,3260] successful.[root@wallet02 ~]# iscsiadm -m node -T iqn.2019-02.com.gscaifu:disk05 --loginLogging in to [iface: default, target: iqn.2019-02.com.gscaifu:disk05, portal: 192.168.40.36,3260] (multiple)Login to [iface: default, target: iqn.2019-02.com.gscaifu:disk05, portal: 192.168.40.36,3260] successful.[root@wallet02 ~]# iscsiadm -m node -T iqn.2019-02.com.gscaifu:disk06 --loginLogging in to [iface: default, target: iqn.2019-02.com.gscaifu:disk06, portal: 192.168.40.36,3260] (multiple)Login to [iface: default, target: iqn.2019-02.com.gscaifu:disk06, portal: 192.168.40.36,3260] successful.[root@wallet02 ~]# iscsiadm -m node -T iqn.2019-02.com.gscaifu:disk07 --loginLogging in to [iface: default, target: iqn.2019-02.com.gscaifu:disk07, portal: 192.168.40.36,3260] (multiple)Login to [iface: default, target: iqn.2019-02.com.gscaifu:disk07, portal: 192.168.40.36,3260] successful.[root@wallet02 ~]# iscsiadm -m node -T iqn.2019-02.com.gscaifu:disk08 --loginLogging in to [iface: default, target: iqn.2019-02.com.gscaifu:disk08, portal: 192.168.40.36,3260] (multiple)Login to [iface: default, target: iqn.2019-02.com.gscaifu:disk08, portal: 192.168.40.36,3260] successful.[root@wallet02 ~]# iscsiadm -m node -T iqn.2019-02.com.gscaifu:disk09 --loginLogging in to [iface: default, target: iqn.2019-02.com.gscaifu:disk09, portal: 192.168.40.36,3260] (multiple)Login to [iface: default, target: iqn.2019-02.com.gscaifu:disk09, portal: 192.168.40.36,3260] successful.[root@wallet02 ~]# iscsiadm -m node -T iqn.2019-02.com.gscaifu:disk10 --loginLogging in to [iface: default, target: iqn.2019-02.com.gscaifu:disk10, portal: 192.168.40.36,3260] (multiple)Login to [iface: default, target: iqn.2019-02.com.gscaifu:disk10, portal: 192.168.40.36,3260] successful.


[root@wallet01 ~]# groupadd -g 1200 dba[root@wallet01 ~]# groupadd -g 1201 oinstall [root@wallet01 ~]# groupadd -g 1202 asmadmin[root@wallet01 ~]# groupadd -g 1203 asmdba [root@wallet01 ~]# useradd -u 1100 -g oinstall -G asmadmin,asmdba,dba grid[root@wallet01 ~]# echo grid | passwd --stdin gridChanging password for user grid.passwd: all authentication tokens updated successfully.[root@wallet01 ~]# id griduid=1100(grid) gid=1201(oinstall) groups=1201(oinstall),1200(dba),1202(asmadmin),1203(asmdba)[root@wallet01 ~]# yum install -y kmod-oracleasm*[root@wallet01 ~]# rpm -ivh oracleasmlib-2.0.4-1.el6.x86_64.rpm[root@wallet01 ~]# rpm -ivh oracleasm-support-2.1.8-1.el6.x86_64.rpm[root@wallet01 ~]#  /usr/sbin/oracleasm configure -iConfiguring the Oracle ASM library driver.This will configure the on-boot properties of the Oracle ASM librarydriver.  The following questions will determine whether the driver isloaded on boot and what permissions it will have.  The current valueswill be shown in brackets ('[]').  Hitting  without typing ananswer will keep that current value.  Ctrl-C will abort.Default user to own the driver interface []: gridDefault group to own the driver interface []: asmadmin Start Oracle ASM library driver on boot (y/n) [n]: yScan for Oracle ASM disks on boot (y/n) [y]: yWriting Oracle ASM library driver configuration: done[root@wallet01 ~]# /usr/sbin/oracleasm initCreating /dev/oracleasm mount point: /dev/oracleasmLoading module "oracleasm": oracleasmConfiguring "oracleasm" to use device physical block size Mounting ASMlib driver filesystem: /dev/oracleasm[root@wallet01 ~]# /usr/sbin/oracleasm createdisk disk1 /dev/sdb1Writing disk header: doneInstantiating disk: done[root@wallet01 ~]# /usr/sbin/oracleasm createdisk disk2 /dev/sdc1Writing disk header: doneInstantiating disk: done[root@wallet01 ~]# /usr/sbin/oracleasm createdisk disk3 /dev/sdd1Writing disk header: doneInstantiating disk: done[root@wallet01 ~]# /usr/sbin/oracleasm createdisk disk4 /dev/sde1Writing disk header: doneInstantiating disk: done[root@wallet01 ~]# /usr/sbin/oracleasm createdisk disk5 /dev/sdf1Writing disk header: doneInstantiating disk: done[root@wallet01 ~]# /usr/sbin/oracleasm createdisk disk6 /dev/sdg1Writing disk header: doneInstantiating disk: done[root@wallet01 ~]# /usr/sbin/oracleasm createdisk disk7 /dev/sdh2Writing disk header: doneInstantiating disk: done[root@wallet01 ~]# /usr/sbin/oracleasm createdisk disk8 /dev/sdi1Writing disk header: doneInstantiating disk: done[root@wallet01 ~]# /usr/sbin/oracleasm createdisk disk9 /dev/sdj1Writing disk header: doneInstantiating disk: done[root@wallet01 ~]# /usr/sbin/oracleasm createdisk disk10 /dev/sdk1Writing disk header: doneInstantiating disk: done[root@wallet01 ~]# /usr/sbin/oracleasm scandisksReloading disk partitions: doneCleaning any stale ASM disks...Scanning system for ASM disks...[root@wallet01 ~]# /usr/sbin/oracleasm listdisksDISK1DISK10DISK2DISK3DISK4DISK5DISK6DISK7DISK8DISK9[root@wallet02 ~]# groupadd -g 1200 dba[root@wallet02 ~]# groupadd -g 1201 oinstall [root@wallet02 ~]# groupadd -g 1202 asmadmin[root@wallet02 ~]# groupadd -g 1203 asmdba [root@wallet02 ~]# useradd -u 1100 -g oinstall -G asmadmin,asmdba,dba grid[root@wallet02 ~]# echo grid | passwd --stdin gridChanging password for user grid.passwd: all authentication tokens updated successfully.[root@wallet02 ~]# id griduid=1100(grid) gid=1201(oinstall) groups=1201(oinstall),1200(dba),1202(asmadmin),1203(asmdba)[root@wallet02 ~]# yum install -y kmod-oracleasm*[root@wallet02 ~]# rpm -ivh oracleasmlib-2.0.4-1.el6.x86_64.rpm[root@wallet02 ~]# rpm -ivh oracleasm-support-2.1.8-1.el6.x86_64.rpm[root@wallet02 ~]#  /usr/sbin/oracleasm configure -iConfiguring the Oracle ASM library driver.This will configure the on-boot properties of the Oracle ASM librarydriver.  The following questions will determine whether the driver isloaded on boot and what permissions it will have.  The current valueswill be shown in brackets ('[]').  Hitting  without typing ananswer will keep that current value.  Ctrl-C will abort.Default user to own the driver interface []: gridDefault group to own the driver interface []: asmadmin Start Oracle ASM library driver on boot (y/n) [n]: yScan for Oracle ASM disks on boot (y/n) [y]: yWriting Oracle ASM library driver configuration: done[root@wallet02 ~]# /usr/sbin/oracleasm initCreating /dev/oracleasm mount point: /dev/oracleasmLoading module "oracleasm": oracleasmConfiguring "oracleasm" to use device physical block size Mounting ASMlib driver filesystem: /dev/oracleasm[root@wallet02 ~]#  /usr/sbin/oracleasm scandisksReloading disk partitions: doneCleaning any stale ASM disks...Scanning system for ASM disks...Instantiating disk "DISK1"Instantiating disk "DISK5"Instantiating disk "DISK4"Instantiating disk "DISK10"Instantiating disk "DISK6"Instantiating disk "DISK8"Instantiating disk "DISK3"Instantiating disk "DISK2"Instantiating disk "DISK7"Instantiating disk "DISK9"[root@wallet02 ~]#  /usr/sbin/oracleasm listdisksDISK1DISK10DISK2DISK3DISK4DISK5DISK6DISK7DISK8DISK9




0