Oracle数据库数据恢复、性能优化

找回密码
注册
搜索
热搜: 活动 交友 discuz
发新帖

0

积分

1

好友

21

主题
1#
发表于 2012-12-30 21:58:38 | 查看: 4028| 回复: 1
本帖最后由 lsz_qh 于 2012-12-30 22:04 编辑

配置ipsan
存储节点:
1、安装scsi-target-utils,并确保/etc/hosts没有问题
2、修改配置文件:
  1. cat /etc/tgt/targets.conf
  2. default-driver iscsi
  3. <target iqn.2012-12.shardisk:shardisk>-->iqn.当前时间.hostname倒着写:name
  4.         backing-store /dev/sda4-->需要共享的分区或者盘
  5.         vendor_id  sharedisk-->厂商标识
  6.         product_id  sharedisk1-->产品编号
  7.         initiator-address  192.168.244.4-->能访问存储的节点的ip
  8.         initiator-address  192.168.244.5-->能访问存储的节点的ip
  9. </target>
复制代码
3、查看配置信息:
  1. [root@sharedisk rules.d]# tgt-admin --show
  2. Target 1: iqn.2012-12.shardisk:shardisk
  3.     System information:
  4.         Driver: iscsi
  5.         State: ready
  6.     I_T nexus information:
  7.         I_T nexus: 1
  8.             Initiator: iqn.1994-05.com.redhat:c342f81751d7
  9.             Connection: 0
  10.                 IP Address: 192.168.244.4
  11.     LUN information:
  12.         LUN: 0
  13.             Type: controller
  14.             SCSI ID: deadbeaf1:0
  15.             SCSI SN: beaf10
  16.             Size: 0 MB
  17.             Online: Yes
  18.             Removable media: No
  19.             Backing store: No backing store
  20.         LUN: 1
  21.             Type: disk
  22.             SCSI ID: deadbeaf1:1
  23.             SCSI SN: beaf11
  24.             Size: 40970 MB
  25.             Online: Yes
  26.             Removable media: No
  27.             Backing store: /dev/sda4
  28.     Account information:
  29.     ACL information:
  30.         192.168.244.4
  31.         192.168.244.5
复制代码
4、启动服务/etc/init.d/tgtd start,并设置为开机启动chkconfig  tgtd  on
5、查看tgt服务监听的端口:netstat -tnlpa | grep tgtd-->tgtd监听的端口为3260


使用存储端:(2台使用存储的机器都需要配置)
1、安装iscsi-initiator-utils
2、启动服务service iscsid start
3、发现并使用
iscsiadm -m discovery -t sendtargets -p 192.168.244.3:3260-->存储端ip和端口
iscsiadm -m node -T iqn.2012-12.shardisk:shardisk -l
4、将服务设置为开机启动:
chkconfig iscsid on
chkconfig iscsi on
5、查看磁盘信息:
  1. [root@ora10gracdb1 rules.d]# fdisk -l

  2. Disk /dev/sda: 107.3 GB, 107374182400 bytes
  3. 255 heads, 63 sectors/track, 13054 cylinders
  4. Units = cylinders of 16065 * 512 = 8225280 bytes

  5.    Device Boot      Start         End      Blocks   Id  System
  6. /dev/sda1   *           1          25      200781   83  Linux
  7. /dev/sda2              26        5124    40957717+  83  Linux
  8. /dev/sda3            5125        7680    20531070   82  Linux swap / Solaris

  9. Disk /dev/sdb: 40.9 GB, 40970119680 bytes
  10. 64 heads, 32 sectors/track, 39072 cylinders
  11. Units = cylinders of 2048 * 512 = 1048576 bytes

  12. Disk /dev/sdb doesn't contain a valid partition table
复制代码
其中dev/sdb是共享磁盘

为了保证盘符发生变化时共享磁盘还能继续使用,在使用存储端配置udev

1、查看信息:
  1. [root@ora10gracdb1 rules.d]# udevinfo -a -p /sys/block/sdb/

  2. Udevinfo starts with the device specified by the devpath and then
  3. walks up the chain of parent devices. It prints for every device
  4. found, all possible attributes in the udev rules key format.
  5. A rule to match, can be composed by the attributes of the device
  6. and the attributes from one single parent device.

  7.   looking at device '/block/sdb':
  8.     KERNEL=="sdb"
  9.     SUBSYSTEM=="block"
  10.     SYSFS{stat}=="     118     1588     1706      105        0        0        0        0        0       88      105"
  11.     SYSFS{size}=="80019765"
  12.     SYSFS{removable}=="0"
  13.     SYSFS{range}=="16"
  14.     SYSFS{dev}=="8:16"

  15.   looking at parent device '/devices/platform/host2/session2/target2:0:0/2:0:0:1':
  16.     ID=="2:0:0:1"
  17.     BUS=="scsi"
  18.     DRIVER=="sd"
  19.     SYSFS{ioerr_cnt}=="0x1"
  20.     SYSFS{iodone_cnt}=="0x92"
  21.     SYSFS{iorequest_cnt}=="0x92"
  22.     SYSFS{iocounterbits}=="32"
  23.     SYSFS{timeout}=="60"
  24.     SYSFS{state}=="running"
  25.     SYSFS{rev}=="0001"
  26.     SYSFS{model}=="VIRTUAL-DISK"-->配置udev的时候需要
  27.     SYSFS{vendor}=="IET     "-->配置udev的时候需要
  28.     SYSFS{scsi_level}=="6"
  29.     SYSFS{type}=="0"
  30.     SYSFS{queue_type}=="none"
  31.     SYSFS{queue_depth}=="32"
  32.     SYSFS{device_blocked}=="0"

  33.   looking at parent device '/devices/platform/host2/session2/target2:0:0':
  34.     ID=="target2:0:0"
  35.     BUS==""
  36.     DRIVER==""

  37.   looking at parent device '/devices/platform/host2/session2':
  38.     ID=="session2"
  39.     BUS==""
  40.     DRIVER==""

  41.   looking at parent device '/devices/platform/host2':
  42.     ID=="host2"
  43.     BUS==""
  44.     DRIVER==""

  45.   looking at parent device '/devices/platform':
  46.     ID=="platform"
  47.     BUS==""
  48.     DRIVER==""
  49. [root@ora10gracdb1 rules.d]#
复制代码
2、修改配置文件,配置udev:
  1. cd /etc/udev/rules.d
  2. [root@ora10gracdb1 rules.d]# cat /etc/udev/rules.d/80-scsi-udev.rules(没有的话可以自行创建)
  3. #
  4. # VMware SCSI devices Timeout adjustment
  5. #
  6. # Modify the timeout value for VMware SCSI devices so that
  7. # in the event of a failover, we don't time out.
  8. # See Bug 271286 for more information.
  9. SUBSYSTEM=="block",SYSFS{size}=="40960",SYSFS{vendor}=="IET     ",SYSFS{model}=="VIRTUAL-DISK",SYMLINK="iscsi/sharedisk"
复制代码
3、启动udev
start_udev
4、查看信息
  1. [root@ora10gracdb2 ~]# ls -ltr /dev/iscsi
  2. 总计 0
  3. lrwxrwxrwx 1 root root 6 12-20 17:36 sharedisk -> ../sdb
复制代码
完成以上配置有,/dev/sdb已经共享到2个RAC节点中,使用时可以根据需求划分不同的lv,划分lv时只需在一个RAC节点创建,另一个节点只需要激活即可,即vgchange -ay vgname
2#
发表于 2012-12-30 22:17:26
支持 下 ~~

回复 只看该作者 道具 举报

您需要登录后才可以回帖 登录 | 注册

QQ|手机版|Archiver|Oracle数据库数据恢复、性能优化

GMT+8, 2024-5-17 19:58 , Processed in 0.047130 second(s), 20 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部
TEL/電話+86 13764045638
Email service@parnassusdata.com
QQ 47079569