Recently, Sun summarized the documents for installing RAC in the VMware environment and did not involve the concept of shared storage, which was a little inadequate. So I pushed forward to the layer and used ISCSI to simulate shared storage disk arrays, after a thorough study, I sorted out the notes as follows. The script was from Tang SIR. I continued my work, haha... Environment: SERVER: RHEL5.464-bit, IP Address: 192.168.50.7 client 1: REHL6.064-bit, IP Address: 192.1
Recently, Sun summarized the documents for installing RAC in the VMware environment and did not involve the concept of shared storage, which was a little inadequate. So I pushed forward to the layer and used ISCSI to simulate shared storage disk arrays, after a thorough study, I sorted out the notes as follows. The script was from Tang SIR. I continued my work, haha...
Environment Introduction:
Server: RHEL5.4 64-bit, IP Address: 192.168.50.7
Client 1: REHL6.0 64-bit, IP Address: 192.168.50.4
Client 2: REHL5.4 64-bit, IP Address: 192.168.50.195
I. server side:
First, install the scsi-target-utils toolkit, set the tgtd service to automatically start upon startup, and then specify a gb lvm as a shared disk array. The name of LVM is data.
[Root @ rhel5 ~] # Yum-y install scsi-target-utils.x86_64
[Root @ rhel5 ~] # Service tgtd start
Starting SCSI target daemon: Starting target framework daemon
[Root @ rhel5 ~] # Chkconfig tgtd on
[Root @ rhel5 ~] # Lvs
Lv vg Attr LSize Origin Snap % Move Log Copy % Convert
Data VolGroup00-wi-ao 100.00G
Lv_data VolGroup00-wi-ao 50.00G
Lv_root VolGroup00-wi-ao 29.28G
Oracle10g_1 VolGroup00-wi-ao 100.00G
Every time you restart the tgtd service, the target and logicalunit bound with tgtdadmin will be invalid. Therefore, a script is written to simplify the operation.
IQN naming convention: iqn. date. reverse. domain. name: optional name, for example: iqn.2011-06-01.com. 766.rac: shareddisk
All IP addresses are allowed to be mounted. To unbind a target, you need to cancel logicalunit and then cancel target.
- [Root @ rhel5 ~] # Cat/etc/init. d/tgtdrules
- #! /Bin/sh
- #/Etc/rc. d/init. d/oracle
- # Chkconfig:-59 85
- # Description: oracle10g is meant to run under Linux Oracle Server
- # Source function library.
-
- ./Etc/rc. d/init. d/functions
-
- Start (){
- Echo-e "Starting Tgtdrules Server: \ n"
-
- # Target
- Tgtadm -- lld iscsi -- op new -- mode target -- tid 1-T iqn.2011-06-01.com. 766.rac: shareddisk
-
- # Lun
- Tgtadm -- lld iscsi -- op new -- mode logicalunit -- tid 1 -- lun 1-B/dev/VolGroup00/data
-
- # Init
- # Tgtadm -- lld iscsi -- op bind -- mode target -- tid 1-I 192.168.50.191
- # Tgtadm -- lld iscsi -- op bind -- mode target -- tid 1-I 192.168.50.192
- Tgtadm -- lld iscsi -- op bind -- mode target -- tid 1-I ALL
- }
-
- Stop (){
- Echo-e "Stopping Tgtdrules Server: \ n"
-
- # Lun
- Tgtadm -- lld iscsi -- op delete -- mode logicalunit -- tid 1 -- lun 1
-
- # Target
- Tgtadm -- lld iscsi -- op delete -- mode target -- tid 1
-
- # Init
- # Tgtadm -- lld iscsi -- op unbind -- mode target -- tid 1-I 192.168.50.191
- # Tgtadm -- lld iscsi -- op unbind -- mode target -- tid 1-I 192.168.50.192
- Tgtadm -- lld iscsi -- op unbind -- mode target -- tid 1-I ALL
- }
-
-
- Status (){
- Tgtadm -- lld iscsi-o show-m target}
-
-
- Case "$1" in
-
- Start)
- Start
- ;;
-
- Stop)
- Stop
- ;;
-
- Status)
- Status
- ;;
-
- *)
- Echo $ "Usage: tgtdrules {start | stop | status }"
- ;;
-
- Esac
-
- Exit 0
-
- Server test:
- [Root @ rhel5 ~] # Service tgtd status
- Tgtd (pid 2943 2942) is running...
-
- [Root @ rhel5 ~] # Netstat-ntpl | grep: 3260
- Tcp 0 0 0.0.0.0: 3260 0.0.0.0: * LISTEN 2942/tgtd
- Tcp 0 0: 3260: * LISTEN 2942/tgtd
-
- [Root @ rhel5 ~] # Service tgtdrules start
- Starting Tgtdrules Server:
-
- [Root @ rhel5 ~] # Service tgtdrules status
- Target 1: iqn.2011-06-01.com. 766.rac: shareddisk
- System information:
- Driver: iscsi
- State: ready
- I _T nexus information:
- I _T nexus: 1
- Initiator: iqn.1994-05.com. RedHat: b1beb63e2617
- Connection: 0
- IP Address: 192.168.50.4
- LUN information:
- LUN: 0
- Type: controller
- Scsi id: IET 00010000
- Scsi sn: beaf10
- Size: 0 MB
- Online: Yes
- Removable media: No
- Backing store type: null
- Backing store path: None
- Backing store flags:
- LUN: 1
- Type: disk
- Scsi id: IET 00010001
- Scsi sn: beaf11
- Size: 107374 MB
- Online: Yes
- Removable media: No
- Backing store type: rdwr
- Backing store path:/dev/VolGroup00/data
- Backing store flags:
- Account information:
- ACL information:
- ALL