- 论坛徽章:
- 0
|
学习笔记6
9.28(friday)
当系统中一个盘如果有的分区用vxvm封装,有的分区用SDS封装。如果要解封装了再重新用vxvm封装的话,SDS封装的区域将会被丢掉,而数据会转到根盘下面。
9.29(staurday)
# vxplex -g oracledg -o rm dis oracle_data-01
vxvm:vxplex: ERROR: Volume oracle_data: must stop a Raid volume before
removing Raid5 plex oracle_data-01
删除卷
# vxvol -g oracledg stop oracle_data
# vxprint -htg oracledg
DG NAME NCONFIG NLOG MINORS GROUP-ID
DM NAME DEVICE TYPE PRIVLEN PUBLEN STATE
RV NAME RLINK_CNT KSTATE STATE PRIMARY DATAVOLS SRL
RL NAME RVG KSTATE STATE REM_HOST REM_DG REM_RLNK
V NAME RVG KSTATE STATE LENGTH READPOL PREFPLEX UTYPE
PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID MODE
SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE
SV NAME PLEX VOLNAME NVOLLAYR LENGTH [COL/]OFF AM/NM MODE
DC NAME PARENTVOL LOGVOL
SP NAME SNAPVOL DCO
dg oracledg default default 40000 1183850030.1427.b150-1
dm oracled01 c1t9d0s2 sliced 20351 143318784 -
dm oracled02 c1t10d0s2 sliced 20351 143318784 -
dm oracled03 c1t11d0s2 sliced 20351 143318784 -
dm oracled04 c1t12d0s2 sliced 20351 143318784 -
v oracle_data - DISABLED CLEAN 6291456 RAID - raid5
pl oracle_data-01 oracle_data DISABLED CLEAN 6309120 RAID 3/32 RW
sd oracled01-01 oracle_data-01 oracled01 0 3154560 0/0 c1t9d0 ENA
sd oracled02-01 oracle_data-01 oracled02 0 3154560 1/0 c1t10d0 ENA
sd oracled03-01 oracle_data-01 oracled03 0 3154560 2/0 c1t11d0 ENA
pl oracle_data-02 oracle_data DISABLED LOG 10176 CONCAT - RW
sd oracled04-01 oracle_data-02 oracled04 0 10176 0 c1t12d0 ENA
# vxplex -g oracledg -o rm dis oracle_data-01
# vxplex -g oracledg -o rm dis oracle_data-02
# vxpring -htg oracledg
vxpring: not found
# vxprint -htg oracledg
DG NAME NCONFIG NLOG MINORS GROUP-ID
DM NAME DEVICE TYPE PRIVLEN PUBLEN STATE
RV NAME RLINK_CNT KSTATE STATE PRIMARY DATAVOLS SRL
RL NAME RVG KSTATE STATE REM_HOST REM_DG REM_RLNK
V NAME RVG KSTATE STATE LENGTH READPOL PREFPLEX UTYPE
PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID MODE
SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE
SV NAME PLEX VOLNAME NVOLLAYR LENGTH [COL/]OFF AM/NM MODE
DC NAME PARENTVOL LOGVOL
SP NAME SNAPVOL DCO
dg oracledg default default 40000 1183850030.1427.b150-1
dm oracled01 c1t9d0s2 sliced 20351 143318784 -
dm oracled02 c1t10d0s2 sliced 20351 143318784 -
dm oracled03 c1t11d0s2 sliced 20351 143318784 -
dm oracled04 c1t12d0s2 sliced 20351 143318784 -
v oracle_data - DISABLED EMPTY 6291456 RAID -
将无用的卷删除
# vxassist -g oracledg remove oracle_data
如果要删除镜像卷则
# vxassist -g oracledg mirror oracle_data
删除资源组
scrgadm -r -g oracle_rg
删除设备组
scconf -r -D name=oracledg,nodelist=b150-1
将设备组注册
scconf -a -D type=vxvm,name=oracledg,nodelist=b150-1:b150-2,preferenced=true
从cluster中删除设备组需首先将设备组offline(脱机)然后才能运行删除命令
scswitch -F -D oracledg (使oracledg脱机)
scconf -r -D name=oracledg,nodelist=b150-1:b150-2 (删除oracledg)
查看剩余空间
# vxdg -g oracledg free
创建raid5的方法包括一下两种,前一种最少需要四块盘(因为有一块盘要用来写日志),后一种需要三块盘
#vxassist -U fsgen -g oracledg make oracle_data 5g layout=raid5 c1t9d0 c1t10d0 c1t11d0
#vxassist -U fsgen -g oracledg make oracle_data 5g layout=raid5,nolog oracled01 oracled02 oracled03
添加用户
useradd -u 101 -g 101 -d /opt/oracle -s /usr/bin/bash -m -k /etc/skel oracle
在使用远程桌面显示的时候,要先用xmanager打开主机,然后登陆到主机上用who命令看看本机的显示的客户端名称,如下:显示的就不是ip:0.0
bash-2.03$ who
root console Jul 9 06:37 (:0)
root pts/2 Jul 9 06:25 (10.110.156.23)
root pts/3 Jul 9 05:13 (10.110.156.23)
root pts/5 Jul 9 06:26 (10.110.156.3
root dtremote Jul 9 06:36 (10.110.156.23:1)
root pts/7 Jul 9 06:38 (10.110.156.23:1.0)
删除坏的磁盘
# vxdisk offline c1t12d0
# vxdisk list
DEVICE TYPE DISK GROUP STATUS
c0t0d0s2 sliced rootdisk_1 rootdg online
c0t2d0s2 sliced mirrdisk_1 rootdg online
c1t9d0s2 sliced oracled01 oracledg online
c1t10d0s2 sliced oracled02 oracledg online
c1t11d0s2 sliced oracled03 oracledg online
c1t12d0s2 sliced - - offline
# vxdisk rm c1t12d0
更换硬盘的详细过程
1.定位坏盘位置
2.将坏盘拔出
3.运行vxdiskadm 》Remove a disk for replacement将坏盘从系统中删除
4.将好盘插入
5.看看format命令的显示的结果如果没有发现新盘,则运行vxcfonfigd命令,反之则只需要运行vxdctl enable
6.运行vxdiskadm 》Replace a failed or removed disk将好盘加入到卷组
7.运行vxtask list查看同步进度
10.10
保存硬盘分区
# prtvtoc /dev/dsk/c1t3d0s0 > /var/tmp/c1t3d0.vtoc
fsck的使用
本课讲的三个参数:
-o f 对系统进行强制检查,不论系统是否在clean等状态
-o p 非交互式检查并修复文件系统,对有的问题则立即退出
-o b=xx 用来修复超级块的错误,就是将备份的超级块内容拷入超级块中。solaris对
超级块很重视,它的备份有很多,一般的b=32就可以了,如果不行可以使用命令
newfs -N /dev/rdsk/cxtxdxsx来查看超级块的位置,其中任何一个备份块都可使用
重启备机之前一定要先看看quorum盘是否offline,如果是会引起主机宕机
3310如果没有阵列控制卡,在连接到双机的时候一定要重新设置scsi-id,否则会冲突,如果有控制卡则不需要。
multipack的SCSI-id跳线一定要跳到9-14
系统备份磁带后面一定要写成类似于:/dev/rmt/0n,其中“0n”表示不倒带,以免备份第一个分区之后,备份第二个分区的时候覆盖了磁带中的内容。
10.29
对根盘进行解封装
1.删除镜像盘上的plex
#vxplex -o rm dis lv_oracle-02 rootdisk_15vol-02 rootvol-02 swapvol-02
2.运行/etc/vx/bin/vxunroot解除根盘封装
bash-2.03# ./vxunroot
This operation will convert the following file systems from
volumes to regular partitions:
lv_oracle rootdisk_15vol rootvol swapvol
Replace volumes in root disk to partitions.
This operation will require a system reboot. If you choose to
continue with this operation, system configuration will be updated
to discontinue use of the volume manager for your root and swap
devices.
Do you wish to do this now [y,n,q,?] (default: y)
Restoring kernel configuration...
A shutdown is now required to install the new kernel.
You can choose to shutdown now, or you can shutdown later, at your
convenience.
Do you wish to shutdown now [y,n,q,?] (default: n) y
shutdown -g0 -y -i6
Shutdown started. Sat Jul 7 07:50:09 GMT 2007
10.30
提取veritas vxvm的license
root@v880-1 # ./vxlicrep
VERITAS License Manager vxlicrep utility version 3.02.005
Copyright (C) 1996-2004 VERITAS Software Corp. All Rights reserved.
Creating a report on all VERITAS products installed on this system
-----------------***********************-----------------
License Key = 8EZU-383C-JWXC-TXOZ-ERPP-P3P8-3RPP-NP
Product Name = VERITAS Volume Manager
Serial Number = 11735
License Type = PERMANENT
OEM ID = 2002
Features :=
VxVM = Enabled
CPU Count = Not Restricted
Platform = Solaris
Version = 4.1
vxvm安装
vxvm安装的时候会重启两次,第一次重启是载封装了根盘后重启的,第二次重启是update vfstab后重启的
vxunroot解除镜像后需要重启机器
volboot和修改hostid 重新创建hostid
/etc/vx/volboot contains:
The host ID that is used by VxVM to establish ownership of physical disks.
The values of defaultdg and bootdg if these values were set by the user.
Caution: Do not edit volboot, or its checksum is invalidated.
To display the contents of volboot:
# vxdctl list
To change the host ID in volboot:
# vxdctl hostid newhostid
# vxdctl enable
To re-create volboot:
# vxdctl init hostid
ufsrestore rf /a/ /dev/dsk/c0t0d0s0
用dd命令复制之后如果要将系统在第一块盘上引导一定要修改vfstab文件。
# stty erase ^H
查看系统中的网卡
prtpicl -c network -v | egrep 'name|instance'
系统在安装vxvm的时候如果想保留以前的数据,那么在选择初始化各个硬盘的时候将有数据的这些盘释放出来。
修改vxvm封装的卷名
vxedit [-dpPsvV ] [-g diskgroup] rename oldname newname
如果第二个系统是第一个系统克隆的,那么在装完双机的时候是没有问题的,但是在用vxvm封装了根盘之后,那么两个节点之间的rootdg里面的卷(如rootvol)的次级编号将会冲突。
镜像根盘
首先将第二块盘加到rootdg中
vxdg -g rootdg adddisk mirrdisk=c0t1d0
开始做镜像
vxmirror rootdisk(源盘) mirrdisk(目标盘) &
在vxvm 4.1里面创建非CDS卷组(dg)
vxdg init testdg cds=off disk0=c3t3d0
将卷组中状态为disabled的卷改改为enabled状态。
如果阵列从一个系统中移出来的时候没有将磁盘阵列上的锁移除,那么系统在导入到另外一个系统的时候会报错,因为磁盘阵列上的锁与/etc/vx/volboot文件中存储的值不相同.解决方法如下:
vxdisk clearimport devicename(清除磁盘上的锁)
vxdg -C import diskgroup (在导入的时候清除锁,但是这个时候最好先将之前的系统关机,因为如果将阵列上的锁清除了,那么两个系统都可以同时访问阵列会引起数据不同步)
explorer -w default,alomextended,scextended
其中/opt/SUNWexplo/tools中的,所有以extended结尾的都可以加入到explorer
solaris10判断故障可能
fmdump -v -u dda8860........(id number)
fmadm命令来定位ID number
SUN常用网站
http://onesearch.sun.com
http://searchportal.nimblesearch.com
www.unixguide.net 三种UNIX命令.
unixguide.pdf
安装补丁
patchadd -M ./ patch_order
在做ufsrestore恢复的时候千万要注意修改local-scsi-id,以免引起主机之间的冲突导致系统SCSI混乱.
Searching for any unexpected network traffic on "qfe0" ... failed
scrconf: expected DL_OK_ACK got DL_ERROR_ACK
scrconf: expected DL_BIND_ACK got DL_ERROR_ACK
scrconf: dlbindack: short response ctl.len: 16
以上错误表示根本没有这个网卡
如果主机连接的是A10001(带控制器的阵列),那么要管理这些的话,需要安装raid manager软件.但是这个时候还是只能认到第一个,如果需要查找剩余的LUM,则需要修改/kernel/drv/sd.conf文件.修改规则如下:
比如说阵列上的第一个target是5,比如C1T5D0,C2T5D0.如果需要找到LUM1 LUM2等等,则需要添加如下行:
name="sd" class="scsi"
target=5 lun=0;
name="sd" class="scsi"
target=5 lun=1;
name="sd" class="scsi"
target=5 lun=2;
删除metadb
当做metaclear d10的时候可能会报stale database的错误,这个时候需要将metadb删除重做
运行metadb查看有哪些metadb的database然后运行如下命令删除
metadb -d -f /dev/rdsk/c0t10d0s6(这里假设s6为meatdb所在的分区)
有些机器硬盘路径中有大写,如下
/sbus@3,0/SUNW,fas@3,8800000/sd@a,0
/sbus@3,0/SUNW,fas@3,8800000/sd@b,0
查看系统是64位还是32位
isainfo -b
solaris10允许系统设置密码超过8位
修改/etc/security/police.conf文件为
CRYPT_DEFAULT=md5
给OBP加密码
root@b150-2 # eeprom security-mode=full
Changing PROM password:
New password:
Please use at least one non-numeric character.
Changing PROM password:
New password:
Please use at least one non-numeric character.
Changing PROM password:
New password:
Retype new password:
A1000初始化
初始化a1000
如果a1000因磁盘或control错导致lun丢失,将产生probe-scsi-all能看到磁盘target,但看不到disk,在系统中format看不到a1000,iostat -E能看到a1000,同时/usr/lib/osa/bin/lad,rm6报找不到raid device错
这时,应做如下操作对a1000进行初始化,并产生基本lun
1,关闭a1000,拔掉电源,取出电池1分钟以上,并拔出所有磁盘
2,打开a1000电源,插入电池,以10秒以上的速度从左至右依次插入磁盘,并观察磁盘灯情况。
3,待a1000 led正常后,在主机上做reboot -- -r
4, ok>probe-scsi-all应看到磁盘disk
5,删除/etc/osa/下locks与locks.lock文件,运行lad
在suncluster环境下,如果要使用阵列上的卷组,则需要先在cluster中注册,否则会报如下错误
# newfs /dev/vx/rdsk/oracledg/cluster_service
/dev/vx/rdsk/oracledg/cluster_service: No such device or address
scconf -c -D name=oracledg
删除包含资源的资源组
scswitch -F -g oracle-rg \\关闭资源组
scswitch -n -j oracle-rs1 \\disable资源
scrgadm -r -j oracle-rs \\删除资源
scrgadm -r -g oracle-rg \\删除资源组
IPMP配置
NODE1
# cat /etc/hosts
#
# Internet host table
#
127.0.0.1 localhost
10.110.157.161 sun1405-1 loghost test1
10.110.157.162 sun1405-2
10.110.157.199 sunsvr
10.110.157.164 ha_ora_ip
10.110.157.155 sun1405-1-hme0-test
10.110.157.156 sun1405-1-qfe6-test
# cat /etc/hostname.hme0
sun1405-1 netmask + broadcast + group sc_ipmp0 up \
addif sun1405-1-eri0-test netmask + broadcast + deprecated -failover up
# cat /etc/hostname.qfe6
sun1405-1-qfe6-test netmask + broadcast + group sc_ipmp0 deprecated -failover up
# ifconfig -a
lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
hme0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 10.110.157.161 netmask fffffe00 broadcast 10.110.157.255
groupname sc_ipmp0
ether 8:0:20:cf:11:96
qfe6: flags=9040843<UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4,NOFAILOVER> mtu 1500 index 3
inet 10.110.157.156 netmask fffffe00 broadcast 10.110.157.255
groupname sc_ipmp0
ether 0:3:ba:36:62:a
qfe5: flags=1008843<UP,BROADCAST,RUNNING,MULTICAST,PRIVATE,IPv4> mtu 1500 index 4
inet 172.16.1.2 netmask ffffff80 broadcast 172.16.1.127
ether 0:3:ba:36:62:9
qfe4: flags=1008843<UP,BROADCAST,RUNNING,MULTICAST,PRIVATE,IPv4> mtu 1500 index 5
inet 172.16.0.130 netmask ffffff80 broadcast 172.16.0.255
ether 0:3:ba:36:62:8
clprivnet0: flags=1009843<UP,BROADCAST,RUNNING,MULTICAST,MULTI_BCAST,PRIVATE,IPv4> mtu 1486 index 6
inet 172.16.193.2 netmask ffffff00 broadcast 172.16.193.255
ether 0:0:0:0:0:2
NODE2
root@ # cat /etc/hosts
#
# Internet host table
#
127.0.0.1 localhost
10.110.157.162 sun1405-2 loghost
10.110.157.161 sun1405-1
10.110.157.199 sunsvr
10.110.157.164 ha_ora_ip
10.110.157.148 sun1405-2-hme0-test
10.110.157.149 sun1405-2-qfe6-test
root@ # cat /etc/hostname.hme0
sun1405-2 netmask + broadcast + group sc_ipmp0 up \
addif sun1405-2-hme0-test netmask + broadcast + deprecated -failover up
root@ # cat /etc/hostname.qfe6
sun1405-2-qfe6-test netmask + broadcast + group sc_ipmp0 deprecated -failover up
root@ # ifconfig -a
lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
hme0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 10.110.157.162 netmask fffffe00 broadcast 10.110.157.255
groupname sc_ipmp0
ether 0:3:ba:12:82:ca
hme0:1: flags=9040843<UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4,NOFAILOVER> mtu 1500 index 2
inet 10.110.157.148 netmask fffffe00 broadcast 10.110.157.255
qfe6: flags=9040843<UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4,NOFAILOVER> mtu 1500 index 3
inet 10.110.157.149 netmask fffffe00 broadcast 10.110.157.255
groupname sc_ipmp0
ether 0:3:ba:34:ee:9b
qfe5: flags=1008843<UP,BROADCAST,RUNNING,MULTICAST,PRIVATE,IPv4> mtu 1500 index 4
inet 172.16.1.1 netmask ffffff80 broadcast 172.16.1.127
ether 0:3:ba:34:ee:9a
qfe4: flags=1008843<UP,BROADCAST,RUNNING,MULTICAST,PRIVATE,IPv4> mtu 1500 index 5
inet 172.16.0.129 netmask ffffff80 broadcast 172.16.0.255
ether 0:3:ba:34:ee:99
clprivnet0: flags=1009843<UP,BROADCAST,RUNNING,MULTICAST,MULTI_BCAST,PRIVATE,IPv4> mtu 1486 index 6
inet 172.16.193.1 netmask ffffff00 broadcast 172.16.193.255
ether 0:0:0:0:0:1 |
|