LINUX 下进行MD3220 I 安装

教程发布:风哥 教程分类:ITPUX技术网 更新日期:2022-02-12 浏览学习:2982

1. 测试后总结,
a) 1. 设置服务器IP
b) 安装ISCSI INITIATOR
c) 启动ISCSI服务,让ISCSI服务自动启动
d) 安装device-mapper
e) 建立多链路文件,有多少块网卡就建立多少个文件,并修改文件和网卡匹配
f) ISCSI查找链路iscsiadm –m discovery –t st –p 192.168.130.101:3260
g) ISCSI logon 注册服务器iscsiadm –m node -l
h) 安装MSDM(先mount,然后cd /mnt/Server/iscsi******)
i) MAP 服务器
j) 查看SESSION
k) 修改多链路文件使生效
l) 查看路径
m) 修改多链路文件,给别名,使LUN名称固定
n) 格式化LUN
o)
2. 设置IP 略
a) Eth0:192.168.128.19
b) Eth1:192.168.130.23
c) Eth2:192.168.131.23
i. MD3200i 192.168.128.101---管理IP
ii. MD3200i 192.168.130.101---SPA
iii. MD3200i 192.168.131.101---SPB
“[root@chunjunhu ~]# cd /etc/sysconfig/network-scripts/
[root@chunjunhu network-scripts]# ls
ifcfg-eth0 ifdown-isdn ifup-ippp ifup-sl
ifcfg-eth0.bak ifdown-post ifup-ipsec ifup-tunnel
ifcfg-eth1 ifdown-ppp ifup-ipv6 ifup-wireless
ifcfg-eth2 ifdown-routes ifup-ipx init.ipv6-global
ifcfg-lo ifdown-sit ifup-isdn net.hotplug
ifdown ifdown-sl ifup-plip network-functions
ifdown-bnep ifdown-tunnel ifup-plusb network-functions-ipv6
ifdown-eth ifup ifup-post origIfcfg-eth0
ifdown-ippp ifup-aliases ifup-ppp origIfcfg-eth1
ifdown-ipsec ifup-bnep ifup-routes origIfcfg-eth2
ifdown-ipv6 ifup-eth ifup-sit
[root@chunjunhu network-scripts]# rm -rf ifcfg-eth0.bak
[root@chunjunhu network-scripts]# vi ifcfg-eth0
[root@chunjunhu network-scripts]# vi ifcfg-eth1
[root@chunjunhu network-scripts]# vi ifcfg-eth2
[root@chunjunhu network-scripts]# service network restart”
3. 安装ISCSI initiator
“Shutting down interface eth0: [ OK ]
Shutting down interface eth1: [ OK ]
Shutting down interface eth2: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: [ OK ]
Bringing up interface eth1: [ OK ]
Bringing up interface eth2: [ OK ]
[root@chunjunhu network-scripts]# mount /dev/cdrom /mnt
mount: block device /dev/cdrom is write-protected, mounting read-only
[root@chunjunhu network-scripts]# cd /mnt
[root@chunjunhu mnt]# cd server
bash: cd: server: No such file or directory
[root@chunjunhu mnt]# cd Server
[root@chunjunhu Server]# rpm -ivh iscsi-initiator-utils-6.2.0.868-0.18.el5.i386.rpm
warning: iscsi-initiator-utils-6.2.0.868-0.18.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:iscsi-initiator-utils ########################################### [100%]”
重启ISCSI 服务
“[root@chunjunhu Server]# service iscsi restart
Stopping iSCSI daemon: iscsiadm: can not connect to iSCSI daemon (111)!
iscsiadm: initiator reported error (18 - could not communicate to iscsid)
iscsiadm: Could not stop iscsid. Trying sending iscsid SIGTERM or SIGKILL signals manually

iscsid is stopped [ OK ]
Turning off network shutdown. Starting iSCSI daemon: [ OK ]
[ OK ]
Setting up iSCSI targets: iscsiadm: No records found!
[ OK ]
[root@chunjunhu Server]#”
确认服务自动启动:
[root@chunjunhu Server]# chkconfig iscsi --list
iscsi 0:off 1:off 2:off 3:on 4:on 5:on 6:off
[root@chunjunhu Server]# chkconfig iscsid --list
iscsid 0:off 1:off 2:off 3:on 4:on 5:on 6:off
[root@chunjunhu Server]#
查找路径
“[root@chunjunhu Server]# iscsiadm -m discovery -t st -p 192.168.130.101:3260
192.168.130.101:3260,1 iqn.1984-05.com.dell:powervault.md3200i.6842b2b0004920ea000000004c76a32d
192.168.130.102:3260,2 iqn.1984-05.com.dell:powervault.md3200i.6842b2b0004920ea000000004c76a32d
192.168.131.101:3260,1 iqn.1984-05.com.dell:powervault.md3200i.6842b2b0004920ea000000004c76a32d
192.168.131.102:3260,2 iqn.1984-05.com.dell:powervault.md3200i.6842b2b0004920ea000000004c76a32d
192.168.132.101:3260,1 iqn.1984-05.com.dell:powervault.md3200i.6842b2b0004920ea000000004c76a32d
192.168.132.102:3260,2 iqn.1984-05.com.dell:powervault.md3200i.6842b2b0004920ea000000004c76a32d
192.168.133.101:3260,1 iqn.1984-05.com.dell:powervault.md3200i.6842b2b0004920ea000000004c76a32d
192.168.133.102:3260,2 iqn.1984-05.com.dell:powervault.md3200i.6842b2b0004920ea000000004c76a32d
[root@chunjunhu Server]#”
注册主机名:
“[root@chunjunhu Server]# iscsiadm -m node -l
Logging in to [iface: default, target: iqn.1984-05.com.dell:powervault.md3200i.6842b2b0004920ea000000004c76a32d, portal: 192.168.132.101,3260]
Logging in to [iface: default, target: iqn.1984-05.com.dell:powervault.md3200i.6842b2b0004920ea000000004c76a32d, portal: 192.168.131.101,3260]
Logging in to [iface: default, target: iqn.1984-05.com.dell:powervault.md3200i.6842b2b0004920ea000000004c76a32d, portal: 192.168.130.101,3260]
Logging in to [iface: default, target: iqn.1984-05.com.dell:powervault.md3200i.6842b2b0004920ea000000004c76a32d, portal: 192.168.131.102,3260]
Logging in to [iface: default, target: iqn.1984-05.com.dell:powervault.md3200i.6842b2b0004920ea000000004c76a32d, portal: 192.168.133.101,3260]
Logging in to [iface: default, target: iqn.1984-05.com.dell:powervault.md3200i.6842b2b0004920ea000000004c76a32d, portal: 192.168.130.102,3260]
Logging in to [iface: default, target: iqn.1984-05.com.dell:powervault.md3200i.6842b2b0004920ea000000004c76a32d, portal: 192.168.133.102,3260]
Logging in to [iface: default, target: iqn.1984-05.com.dell:powervault.md3200i.6842b2b0004920ea000000004c76a32d, portal: 192.168.132.102,3260]
iscsiadm: Could not login to [iface: default, target: iqn.1984-05.com.dell:powervault.md3200i.6842b2b0004920ea000000004c76a32d, portal: 192.168.132.101,3260]:
iscsiadm: initiator reported error (4 - encountered connection failure)
Login to [iface: default, target: iqn.1984-05.com.dell:powervault.md3200i.6842b2b0004920ea000000004c76a32d, portal: 192.168.131.101,3260]: successful
Login to [iface: default, target: iqn.1984-05.com.dell:powervault.md3200i.6842b2b0004920ea000000004c76a32d, portal: 192.168.130.101,3260]: successful
Login to [iface: default, target: iqn.1984-05.com.dell:powervault.md3200i.6842b2b0004920ea000000004c76a32d, portal: 192.168.131.102,3260]: successful
iscsiadm: Could not login to [iface: default, target: iqn.1984-05.com.dell:powervault.md3200i.6842b2b0004920ea000000004c76a32d, portal: 192.168.133.101,3260]:
iscsiadm: initiator reported error (4 - encountered connection failure)
Login to [iface: default, target: iqn.1984-05.com.dell:powervault.md3200i.6842b2b0004920ea000000004c76a32d, portal: 192.168.130.102,3260]: successful
iscsiadm: Could not login to [iface: default, target: iqn.1984-05.com.dell:powervault.md3200i.6842b2b0004920ea000000004c76a32d, portal: 192.168.133.102,3260]:
iscsiadm: initiator reported error (4 - encountered connection failure)
iscsiadm: Could not login to [iface: default, target: iqn.1984-05.com.dell:powervault.md3200i.6842b2b0004920ea000000004c76a32d, portal: 192.168.132.102,3260]:
iscsiadm: initiator reported error (4 - encountered connection failure)
[root@chunjunhu Server]#“
建立多路径文件
[root@chunjunhu Server]# iscsiadm -m iface -I path1_eth1 -o new
New interface path1_eth1 added
[root@chunjunhu Server]# iscsiadm -m iface -I path1_eth2 -o new
New interface path1_eth2 added
[root@chunjunhu Server]#
配置多路径文件
“# vi /var/lib/iscsi/ifaces/path1_eth1”
# BEGIN RECORD 2.0-868
iface.iscsi_ifacename = path1_eth1
iface.net_ifacename = default
iface.hwaddress = default
iface.transport_name = tcp
# END RECORD

# BEGIN RECORD 2.0-868
iface.iscsi_ifacename = path1_eth1
iface.net_ifacename = eth1
iface.hwaddress = default
iface.transport_name = tcp
# END RECORD

[root@chunjunhu Server]# vi /var/lib/iscsi/ifaces/path1_eth2
# BEGIN RECORD 2.0-868
iface.iscsi_ifacename = path1_eth2
iface.net_ifacename = default
iface.hwaddress = default
iface.transport_name = tcp
# END RECORD

# BEGIN RECORD 2.0-868
iface.iscsi_ifacename = path1_eth2
iface.net_ifacename = eth2
iface.hwaddress = default
iface.transport_name = tcp
# END RECORD
查看multipath是否安装,没有就装上 ,并设置自动启动,重启多路径服务
[root@chunjunhu Server]# rpm -qa |grep 'device-m'
device-mapper-event-1.02.28-2.el5
device-mapper-multipath-0.4.7-23.el5
device-mapper-1.02.28-2.el5
[root@chunjunhu Server]# chkconfig multipathd --list
multipathd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[root@chunjunhu Server]# chkconfig multipathd on
[root@chunjunhu Server]# service multipathd restart
Stopping multipathd daemon: [FAILED]
Starting multipathd daemon: [ OK ]
[root@chunjunhu Server]#
安装MDSM
“[root@chunjunhu mnt]# mount /dev/cdrom /mnt
mount: block device /dev/cdrom is write-protected, mounting read-only
[root@chunjunhu mnt]# cd /mnt
[root@chunjunhu mnt]# ls
autorun linux md_launcher_sles_x86_64.bin
Autorun.inf md_launcher.exe Readme.txt
COPYRIGHT md_launcher_rhel_x86_64.bin windows
launcher_data md_launcher_rhel_x86.bin
License.txt md_launcher.sh
[root@chunjunhu mnt]# ./md_launcher.sh”
安装完成后重启服务器,然后运行如下命令查看路径(四条是正确的)
[root@chunjunhu ~]# iscsiadm -m session
tcp: [1] 192.168.131.101:3260,1 iqn.1984-05.com.dell:powervault.md3200i.6842b2b0004920ea000000004c76a32d
tcp: [2] 192.168.130.101:3260,1 iqn.1984-05.com.dell:powervault.md3200i.6842b2b0004920ea000000004c76a32d
tcp: [3] 192.168.131.102:3260,2 iqn.1984-05.com.dell:powervault.md3200i.6842b2b0004920ea000000004c76a32d
tcp: [4] 192.168.130.102:3260,2 iqn.1984-05.com.dell:powervault.md3200i.6842b2b0004920ea000000004c76a32d
[root@chunjunhu ~]#打开MDSM 配置LUN和主机的MAP(建议带外管理)
[root@chunjunhu ~]# cd /etc/init.d
[root@chunjunhu init.d]# ls
acpid dnsmasq kdump nscd SMagent
anacron dund killall ntpd smartd
apmd firstboot krb524 pand SMmonitor
atd functions kudzu pcscd squid
auditd gpm lvm2-monitor portmap sshd
autofs haldaemon mcstrans psacct syslog
avahi-daemon halt mdmonitor rdisc tux
avahi-dnsconfd hidd mdmpd readahead_early vmware-tools
bluetooth hplip messagebus readahead_later vncserver
capi httpd microcode_ctl restorecond wdaemon
conman ip6tables multipathd rhnsd winbind
cpuspeed ipmi netconsole rpcgssd wpa_supplicant
crond iptables netfs rpcidmapd xfs
cups irda netplugd rpcsvcgssd xinetd
cups-config-daemon irqbalance network saslauthd ypbind
dc_client iscsi NetworkManager sendmail yum-updatesd
dc_server iscsid nfs setroubleshoot
dkms_autoinstaller isdn nfslock single
[root@chunjunhu init.d]#
重启Smagent
[root@chunjunhu init.d]# ./SMagent
Usage: ./SMagent {start|stop|restart|status}
[root@chunjunhu init.d]# ./SMagent restart
Stopping Agent process 4256.
SMagent started.
[root@chunjunhu init.d]#
MDSM里面看不到主机就多重启几次就能看到了, 估计识别比较缓慢,就能识别到了
编辑multipath的配置文件,解除BLOCK,
[root@chunjunhu ~]# vi /etc/multipath.conf
“# This is a basic configuration file with some examples, for device mapper
# multipath.
# For a complete list of the default configuration values, see
# /usr/share/doc/device-mapper-multipath-0.4.7/multipath.conf.defaults
# For a list of configuration options with descriptions, see
# /usr/share/doc/device-mapper-multipath-0.4.7/multipath.conf.annotated

# Blacklist all devices by default. Remove this to enable multipathing
# on the default devices.
blacklist {
devnode "*"
}
# 上面三行的意思是多个路径只允许看到以个设备
## By default, devices with vendor = "IBM" and product = "S/390.*" are
## blacklisted. To enable mulitpathing on these devies, uncomment the
## following lines.
#blacklist_exceptions {
# device {
# vendor "IBM"
# product "S/390.*"
# }
#}
"/etc/multipath.conf" 97L, 2711C“
保存配置
[root@chunjunhu ~]# multipath -v2
error calling out /sbin/scsi_id -g -u -s /block/sda
create: mpath0 (36842b2b0004920ea0000dab64c76a397) DELL,Universal Xport
[size=20M][features=0][hwhandler=0][n/a]
\_ round-robin 0 [prio=1][undef]
\_ 2:0:0:31 sdb 8:16 [undef][ready]
\_ round-robin 0 [prio=1][undef]
\_ 4:0:0:31 sdc 8:32 [undef][ready]
\_ round-robin 0 [prio=1][undef]
\_ 3:0:0:31 sdd 8:48 [undef][ready]
\_ round-robin 0 [prio=1][undef]
\_ 1:0:0:31 sde 8:64 [undef][ready]
[root@chunjunhu ~]#
我重启N次之后才看到我划分给机器的LUN
然后我们看到这样的效果
[root@chunjunhu ~]# multipath -ll
sdb: checker msg is "readsector0 checker reports path is down"
sdd: checker msg is "readsector0 checker reports path is down"
mpath1 (36842b2b0004920ea0000eb2d4c7b31e2) dm-2 DELL,MD32xxi
[size=10G][features=0][hwhandler=0][rw]
\_ round-robin 0 [prio=1][active]
\_ 4:0:0:0 sdc 8:32 [active][ready]
\_ round-robin 0 [prio=1][enabled]
\_ 3:0:0:0 sde 8:64 [active][ready]
\_ round-robin 0 [prio=0][enabled]
\_ 2:0:0:0 sdb 8:16 [failed][faulty]
\_ round-robin 0 [prio=0][enabled]
\_ 1:0:0:0 sdd 8:48 [failed][faulty]
mpath0 (36842b2b0004920ea0000dab64c76a397) dm-3 DELL,Universal Xport
[size=20M][features=0][hwhandler=0][rw]
\_ round-robin 0 [prio=1][enabled]
\_ 3:0:0:31 sdg 8:96 [active][ready]
\_ round-robin 0 [prio=1][enabled]
\_ 4:0:0:31 sdf 8:80 [active][ready]
\_ round-robin 0 [prio=1][enabled]
\_ 2:0:0:31 sdh 8:112 [active][ready]
\_ round-robin 0 [prio=1][enabled]
\_ 1:0:0:31 sdi 8:128 [active][ready]
[root@chunjunhu ~]# 多路径已经工作
由于每次重启LUN的名字会变更,应用程序访问会出问题,所有我们需要修改multipath.conf文件
multipaths {
multipath {
wwid 36842b2b0004920ea0000eb2d4c7b31e2
alias vm5-disk1
path_grouping_policy multibus
path_checker readsector0
path_selector "round-robin 0"
failback manual
rr_weight priorities
no_path_retry 5
}
# multipath {
# wwid 1DEC_____321816758474
# alias red
# }
}
然后再运行如下命令再次使配置文件生效
[root@chunjunhu ~]# multipath -v2
error calling out /sbin/scsi_id -g -u -s /block/sda
sdb: checker msg is "readsector0 checker reports path is down"
sdd: checker msg is "readsector0 checker reports path is down"
sdb: checker msg is "readsector0 checker reports path is down"
sdd: checker msg is "readsector0 checker reports path is down"
36842b2b0004920ea0000eb2d4c7b31e2: rename mpath1 to vm5-disk1
: vm5-disk1 (36842b2b0004920ea0000eb2d4c7b31e2) DELL,MD32xxi
[size=10G][features=0][hwhandler=0][n/a]
\_ round-robin 0 [prio=2][undef]
\_ 2:0:0:0 sdb 8:16 [failed][faulty]
\_ 4:0:0:0 sdc 8:32 [active][ready]
\_ 1:0:0:0 sdd 8:48 [failed][faulty]
\_ 3:0:0:0 sde 8:64 [active][ready]
[root@chunjunhu ~]#
然后格式化文件完成
[root@chunjunhu ~]# mkfs -j /dev/mapper/vm5-disk1
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
1310720 inodes, 2621440 blocks
131072 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2684354560
80 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 33 mounts or
180 days, whichever comes fi
[root@chunjunhu ~]# mount /dev/mapper/vm5-disk1 /mnt
[root@chunjunhu ~]# ls
anaconda-ks.cfg install.log.syslog vmware-tools-distrib
Desktop md_launcher_lock
install.log VMwareTools-4.0.0-208167.tar.gz
[root@chunjunhu ~]# cd /mnt
[root@chunjunhu mnt]# ls
lost+found
[root@chunjunhu mnt]# mkdir nicehu
[root@chunjunhu mnt]# ls
lost+found nicehu
[root@chunjunhu mnt]# fdisk

Usage: fdisk [-l] [-b SSZ] [-u] device
E.g.: fdisk /dev/hda (for the first IDE disk)
or: fdisk /dev/sdc (for the third SCSI disk)
or: fdisk /dev/eda (for the first PS/2 ESDI drive)
or: fdisk /dev/rd/c0d0 or: fdisk /dev/ida/c0d0 (for RAID devices)
...
[root@chunjunhu mnt]# fdisk -l

Disk /dev/sda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 1044 8281507+ 8e Linux LVM

Disk /dev/sdc: 10.7 GB, 10737418240 bytes
64 heads, 32 sectors/track, 10240 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

Disk /dev/sdc doesn't contain a valid partition table

Disk /dev/sde: 10.7 GB, 10737418240 bytes
64 heads, 32 sectors/track, 10240 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

Disk /dev/sde doesn't contain a valid partition table

Disk /dev/sdf: 20 MB, 20971520 bytes
1 heads, 40 sectors/track, 1024 cylinders
Units = cylinders of 40 * 512 = 20480 bytes

Disk /dev/sdf doesn't contain a valid partition table

Disk /dev/sdg: 20 MB, 20971520 bytes
1 heads, 40 sectors/track, 1024 cylinders
Units = cylinders of 40 * 512 = 20480 bytes

Disk /dev/sdg doesn't contain a valid partition table

Disk /dev/dm-2: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/dm-2 doesn't contain a valid partition table

Disk /dev/dm-3: 20 MB, 20971520 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/dm-3 doesn't contain a valid partition table

Disk /dev/sdh: 20 MB, 20971520 bytes
1 heads, 40 sectors/track, 1024 cylinders
Units = cylinders of 40 * 512 = 20480 bytes

Disk /dev/sdh doesn't contain a valid partition table

Disk /dev/sdi: 20 MB, 20971520 bytes
1 heads, 40 sectors/track, 1024 cylinders
Units = cylinders of 40 * 512 = 20480 bytes
LINUX 3220 I 安装

本文标签:
网站声明:本文由风哥整理发布,转载请保留此段声明,本站所有内容将不对其使用后果做任何承诺,请读者谨慎使用!
【上一篇】
【下一篇】