ITPub博客

首页 > Linux操作系统 > Linux操作系统 > veritas 磁盘组和卷划分(mirror) HA

veritas 磁盘组和卷划分(mirror) HA

原创 Linux操作系统 作者:yhj20041128001 时间:2012-03-18 19:37:56 0 删除 编辑
vxdisk list
systool -c fc_host -v
multipath -ll
/etc/init.d/multipathd status
/etc/init.d/multipathd start
vi /etc/multipath.conf
 
#blacklist {
#        devnode "*"
#}
增加device
 
 device {
              vendor                    "HP"
               product                   "HSV2[01]0|HSV300|HSV4[05]0"
               getuid_callout            "/sbin/scsi_id -g -u -s /block/%n"
               prio_callout              "/sbin/mpath_prio_alua /dev/%n"
               hardware_handler          "0"
               path_selector             "round-robin 0"
               path_grouping_policy      group_by_prio
               failback                  immediate
               rr_weight                 uniform
               rr_min_io                 100
               no_path_retry             18
               path_checker              tur
     }

multipath -ll
chkconfig multipathd on
echo "- - -">/sys/class/scsi_host/host1/scan
echo "- - -">/sys/class/scsi_host/host0/scan
echo "- - -">/sys/class/scsi_host/host2/scan
echo "- - -">/sys/class/scsi_host/host3/scan
echo "- - -">/sys/class/scsi_host/host4/scan
multipath -ll
/etc/init.d/multipathd status
echo "- - -">/sys/class/scsi_host/host5/scan
multipath -ll
echo "- - -">/sys/class/scsi_host/host6/scan
multipath -ll
echo "- - -">/sys/class/scsi_host/host7/scan
multipath -ll
cd /sys/class/scsi_host/
 
vxdctl enable
vxdisk list
vxdisk list eva64000_0
vxdisk list eva64001_0
vxdisk list
vxdisk list
vxdisk list eva64001_1
vxdisk list eva64000_1
vxdisk list eva64001_2
vxdisk list eva64001_0
vxdisk list eva64001_0
vxdisk list eva64001_1
vxdisk list eva64001_2
vxdisk list
vxdisk list eva64000_0
vxdisk list eva64000_1
vxdisk list eva64000_2
vxdisk list eva64000_0
vxdisk list eva64001_0
vxdisk list eva64000_1
vxdisk list eva64000_2
vxdisk list eva64000_1
vxdisk list
vxdisksetup -i eva64000_0
vxdisksetup -i eva64000_1
vxdisksetup -i eva64000_2
vxdisksetup -i eva64001_0
vxdisksetup -i eva64001_1
vxdisksetup -i eva64001_2
vxdisksetup -i eva64001_2
vxdisk list
vxdisk list eva64000_0
vxdisk list eva64000_1
vxdg init archdg01 lbcmlb2_arch=eva64000_1 rbcmlb2_arch=eva64001_0
vxdg init oradg01 lbcmlb2_data1=eva64000_0 rbcmlb2_data1=eva64000_1
vxdg init oradg01 lbcmlb2_data1=eva64000_0 rbcmlb2_data1=eva64001_1
vxdg init oradg02 lbcmlb2_data1=eva64000_2 rbcmlb2_data1=eva64001_2
vxdisk list
vxdg -g oradg02 rename lbcmlb2_data1 lbcmlb2_data2
vxdg -g oradg02 rename lbcmlb2_data1 lbcmlb2_data2
vxedit -g oradg02 rename lbcmlb2_data1 lbcmlb2_data2
vxdisk list
vxedit -g oradg02 rename rbcmlb2_data1 rbcmlb2_data2
vxdisk list
vxassist -g archdg01 -p maxsize layout=nostripe alloc=lbcmlb2_arch rbcmlb2_arch mirror=enclr
vxassist -g archdg01 make archvol01 1258110976s layout=nostripe,nolog nmirror=2 alloc=lbcmlb2_arch rbcmlb2_arch mirror=enclr
vxassist -g oradg01 -p maxsize layout=nostripe alloc=lbcmlb2_data1 rbcmlb2_data1 mirror=enclr
vxassist -g oradg01 make datavol01 3145660416s layout=nostripe,nolog nmirror=2 alloc=lbcmlb2_data1 rbcmlb2_data1 mirror=enclr
vxassist -g oradg02  p maxsize layout=nostripe alloc=lbcmlb2_data2  rbcmlb2_data2 mirror=enclr
vxassist -g oradg02 make datavol02 2096945152s layout=nostripe,nolog nmirror=2 alloc=lbcmlb2_data2 rbcmlb2_data2 mirror=enclr
 
   2s=1 kbyte

vxdisk list
vxdg list
mkfs -t vxfs /dev/vx/dsk/archdg01/archvol01
mkfs -t vxfs /dev/vx/dsk/oradg01/datavol01
mkfs -t vxfs /dev/vx/dsk/oradg02/datavol02
ls
mkdir /oradata01
mkdir /oradata02
mkdir /archlog
mkdir /oracle/10205
groupadd -g 601 dba
useradd -g 601 -u 601 -d /oracle/10205 oracle
cp .bash* /oracle/10205/
chown oracle.dba /oradata01 -R
chown oracle.dba /oradata02 -R
chown oracle.dba /archlog/ -R

mount –t vxfs /dev/vx/dsk/aradg01/datavol01  /oradata01/
mount –t vxfs /dev/vx/dsk/archdg01/archvol01  /archlog/
 
 
刪除邏輯卷和邏輯卷組
linux-3:~ # umount /mnt
linux-3:~ # vxedit -g neodg -rf  rm  test   <<<<< 刪除邏輯卷
linux-3:~ # vxprint -ht
檢測創建的卷
linux-3:~ # vxprint -qhtg datagd vol101
vxassist -g oradg remove volume oralv05  <<<<< 刪除邏輯卷
Disk group: neodg
to  remove  dg:
vxdg  destroy  neodg   <<<<
 
 
vxdisk list sdb
vxdisk list sdc
vxdisk list sdd
vxdisksetup -i sdb
vxdisksetup -i sdc
vxdisksetup -i sdd
vxdg init aradg01 test1_data=sdb test2_data=sdc
vxdg init archdg01 test3_arch=sdd
vxassist -g aradg01 -p maxsize layout=nostripe alloc=test1_data test2_data mirror=enclr
vxassist -g aradg01 make datavol01 5300M layout=nostripe,nolog nmirror=2 alloc=test1_data test2_data mirror=enclr
vxassist -g archdg01 -p maxsize layout=nostripe alloc=test3_arch
vxassist -g archdg01 make archvol01 5300M layout=nostripe,nolog  alloc=test3_arch
mkfs -t  vxfs /dev/vx/dsk/aradg01/datavol01
mkfs -t  vxfs /dev/vx/dsk/archdg01/archvol01
mkdir /oradata01
mkdir /archlogcp
chown oracle.dba  /oradata01/ -R
chown oracle.dba  /archlog/ -R

mount -t vxfs /dev/vx/dsk/aradg01/datavol01  /oradata01/
mount -t vxfs /dev/vx/dsk/archdg01/archvol01  /archlog/
 

设置虚拟IP
  ttvir-stcdb01:  ifconfig bond0:0 10.192.227.61 netmask 255.255.254.0
  ifconfig   bond0:0  up
ifconfig   bond0:0  up
 

添加資源組,配置各服務的依賴關係

1.添加資源組

groupvcstest12

 

2. 導入參數:/etc/VRTSagents/ha/conf/Oracle/OracleTypes.cf

 

3..添加資源組成員(如:邏輯卷組 DiskGroup,文件系統 mount,網卡 NIC,IP,Oracle, Netlsnr
 
4.配置服務資源組依賴關係
 
 
hastatus -sum
hastatus
hagrp -unfreeze testvcsgroup01
hastatus
hastatus -sum
hagrp -switch  testvcsgroup01     -to vcstest01
hastatus
hastatus -sum
 hagrp -freeze   testvcsgroup01
  hastatu -sum

關閉Database 及OS步驟:
1.hagrp -freeze  testvcsgroup01
2.lsnrctl stop (監聽器)
3.kill session(ps -ef |grep oracle$ORACLE_SID|grep LOCAL=NO |grep -v grep | awk '{print $2}' |xargs kill -9)
4.shutdown database
5 hastop -local (OS User:root)
6:init 0 (OS User:root)
只關閉單節點的OS
1.(vcs01 )  (active)
2.hagrp -switch testvcsgroup01    -to vcstest02
3.hastop -local
4.init 0
 
 
 
 
在兩個節點停止HA服務
      vcstest-db01:  hastop -local  無法停止時,可用  hastop -local -force
       vcstest-db02:  hastop -local  無法停止時,可用  hastop -local -force
4. 查看VCS資源是否完全停止
    /dev/vx/dsk/目錄下無文件表示已完全停止
5. 在 vcstest-db01上導入Diskgroup
   vxdg import archdg
   vxdg  import  oradg01
   vxdg  import oradg02
   vxdg  import oradg03
   vxdg  import oradg03
6在 vcstest-db01上啟動邏輯卷
  vxvol -g archdg startall
  vxvol -g  oradg01 startall
  vxvol -g oradg02  startall
  vxvol -g oradg03  startall
 
7. mount -t vxfs /dev/vx/dsk/archdg   /archlog/
   mount -t vxfs /dev/vx/dsk/oradg01  /oradata01/
   mount -t vxfs /dev/vx/dsk/oradg02  /oradata02/
   mount -t vxfs /dev/vx/dsk/oradg03  /oradata03/
 

8.由于是跨存储镜像,这样不同的存储对应不同的enclosure,下面例子中是emcams

# vxdmpadm listenclosure all

ENCLR_NAME        ENCLR_TYPE     ENCLR_SNO      STATUS       ARRAY_TYPE     LUN_COUNT

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

disk              Disk           DISKS                CONNECTED    Disk        2

emc_clariion0     EMC_CLARiiON   CK200053300424       CONNECTED    CLR-A/PF    4

ams_wms0          AMS_WMS        75050205             CONNECTED    A/A-A       6

 

 

haconf -makerw (打开對main.cf的寫關/etc/VRTSvcs/conf/config/main.cf)

 
#hastart ---打開本節點的vcs服務
#lltstat -vvn (查看 VCS 系统心跳状态,若有心跳线不通,系统会显示某网卡“DOWN”)
/etc/vx/bin/vxreattach  -重新刷新磁盤組
vxrecover -sb  -重新同步mirror
:故障切換
1.haconf -makerw
.2 hagrp -clear vcstestropu11 -sys vcstest1 ---清除失敗節點的錯誤日誌
3.haconf –dump –makero
4. hagrp -switch vcstestropu11 -to vcstest1  -切換回原來的主機
无法切换
hagrp -clear vcstestropu11 清理错误日志
hastop -local
hastart
hastatus
 
单节点启动
hastop -all -force  停所有节点
hastop -local
hastart vcstest1/vcstest2 启动单节点 vcs服务
hastatus
 
命令行清除错误日志操作:
hares -clear [-sys ] 资源
或者
hagrp -clear [-sys ] 组
 
例如:
# hares -clear vcstest12-db -sys vcstest01
# hagrp -clear Groupvcstest12 -sys vcstest01
#hares -clear vcstest12-db -sys vcstest01
 
#haconf -makerw (打开對main.cf的寫開關/etc/VRTSvcs/conf/config/main.cf)
#haconf –dump –makero (保存、关闭對main.cf的寫開關)

依賴關係.jpg

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/23757700/viewspace-718892/,如需转载,请注明出处,否则将追究法律责任。

上一篇: linux參數修改
请登录后发表评论 登录
全部评论

注册时间:2010-09-17

  • 博文量
    162
  • 访问量
    355494