1、配置环境:存储厂家:Infortrend主机系统:CentOS6.0目 录1、关闭防火墙步 12、彻底关闭 SELinux .23、开机网卡启动, 设置固定 IP34、开启 SSh45、 device-mapper-multipath 安装与配置 45.1 挂载光驱 45.2 多路径安装: 45.3 检查安装情况 55.5 创建多路径文件 55.6 将多路径软件 multipath 设置为开机启动 .65.7 修改多路径配置文件: 65.8 格式化 mpathap1 和 mpathap2 85.9 挂在分区: 86、 DD 测试 91、关闭防火墙步关闭命令: service iptables
2、stop 永久关闭防火墙:chkconfig iptables off 两个命令同时运行,运行完成后查看防火墙关闭状态 :service iptables statusrootlocalhost # service iptables stopiptables:清除防火墙规则: 确定iptables:将链设置为政策 ACCEPT:filter 确定iptables:正在卸载模块: 确定rootlocalhost # chkconfig iptables offrootlocalhost # service iptables statusiptables:未运行防火墙。rootlocalhost
3、#2、彻底关闭 SELinuxrootlocalhost etc# vi /etc/selinux/config # This file controls the state of SELinux on the system.# SELINUX= can take one of these three values:# enforcing - SELinux security policy is enforced.# permissive - SELinux prints warnings instead of enforcing.# disabled - No SELinux policy
4、is loaded.#SELINUX=enforcing-前面加个#号注释掉它# SELINUXTYPE= can take one of these two values:# targeted - Targeted processes are protected,# mls - Multi Level Security protection.SELINUXTYPE=disabled-修改为 disabled“selinux/config“ 13L, 458C writtenrootlocalhost etc#保存,退出,重启系统,搞定。3、开机网卡启动, 设置固定 IProotlocalho
5、st # vi /etc/sysconfig/network-scripts/ifcfg-eth0DEVICE=“eth0“HWADDR=“00:25:90:DA:9C:2F“NM_CONTROLLED=“yes“ONBOOT=“yes“-修改如下内容为 yes 就可以开机自动启动了.IPADDR=192.168.1.237 PREFIX=24GETWAY=192.168.1.1DNS1=192.168.1.1DNS2=8.8.8.8“/etc/sysconfig/network-scripts/ifcfg-eth0“ 9L, 154C written#设置临时 IP rootlocalhos
6、t # ifconfig eth0 192.168.1.237 broadcast 192.168.1.1 netmask 255.255.255.0rootlocalhost # ifconfigeth0 Link encap:Ethernet HWaddr 00:25:90:DA:9C:2F inet addr:192.168.1.237 Bcast:192.168.1.1 Mask:255.255.255.0inet6 addr: fe80:225:90ff:feda:9c2f/64 Scope:LinkUP BROADCAST RUNNING MULTICAST MTU:1500 Me
7、tric:1RX packets:14762 errors:0 dropped:0 overruns:0 frame:0TX packets:1564 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000 RX bytes:4076998 (3.8 MiB) TX bytes:166320 (162.4 KiB)Memory:dfb00000-dfb20000 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0inet6 addr: :1
8、/128 Scope:HostUP LOOPBACK RUNNING MTU:16436 Metric:1RX packets:48 errors:0 dropped:0 overruns:0 frame:0TX packets:48 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:0 RX bytes:3968 (3.8 KiB) TX bytes:3968 (3.8 KiB)4、开启 SSh打开终端命令。输入 rpm -qa |grep ssh 查找当前系统是否已经安装安装好了之后,就开启 ssh 服务。Ssh
9、服务一般叫做 SSHD命令行输入 service sshd start 可以启动5、 device-mapper-multipath 安装与配置5.1 挂载光驱 :mount /dev/cdrom /media5.2 多路径安装:rootlocalhost CentOS_6.0_Final# lsdevice-mapper-1.02.53-8.el6.x86_64.rpmdevice-mapper-event-1.02.53-8.el6.x86_64.rpmdevice-mapper-event-libs-1.02.53-8.el6.x86_64.rpmdevice-mapper-libs-1
10、.02.53-8.el6.x86_64.rpmdevice-mapper-multipath-0.4.9-31.el6.x86_64.rpmdevice-mapper-multipath-libs-0.4.9-31.el6.x86_64.rpmkpartx-0.4.9-31.el6.x86_64.rpmrootlocalhost CentOS_6.0_Final# rpm -ivh kpartx-0.4.9-31.el6.x86_64.rpm warning: kpartx-0.4.9-31.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key
11、 ID c105b9de: NOKEYPreparing. (# 100%package kpartx-0.4.9-31.el6.x86_64 is already installedrootlocalhost CentOS_6.0_Final# rpm -ivh device-mapper-1.02.53-8.el6.x86_64.rpm warning: device-mapper-1.02.53-8.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEYPreparing. (# 100%package
12、 device-mapper-1.02.53-8.el6.x86_64 is already installedrootlocalhost CentOS_6.0_Final# rpm -ivh device-mapper-libs-1.02.53-8.el6.x86_64.rpm warning: device-mapper-libs-1.02.53-8.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEYPreparing. (# 100%package device-mapper-libs-1.02.5
13、3-8.el6.x86_64 is already installedrootlocalhost CentOS_6.0_Final# rpm -ivh device-mapper-multipath-0.4.9-31.el6.x86_64.rpm warning: device-mapper-multipath-0.4.9-31.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEYPreparing. (# 100%package device-mapper-multipath-0.4.9-31.el6.x
14、86_64 is already installedrootlocalhost CentOS_6.0_Final# rpm -ivh device-mapper-multipath-libs-0.4.9-31.el6.x86_64.rpm warning: device-mapper-multipath-libs-0.4.9-31.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEYPreparing. (# 100%package device-mapper-multipath-libs-0.4.9-31
15、.el6.x86_64 is already installedrootlocalhost CentOS_6.0_Final#5.3 检查安装情况:rpm -qa|grep multipath5.3.1 输出结果为: rootlocalhost CentOS_6.0_Final# rpm -qa|grep multipath device-mapper-multipath-0.4.9-31.el6.x86_64device-mapper-multipath-libs-0.4.9-31.el6.x86_64rootlocalhost CentOS_6.0_Final#5.5 创建多路径文件/et
16、c/multipath.conf#mpathconf -enable -find_multipaths y -with_multipathd y -with_chkconfig y5.5.1 重启多路径服务5.5.2 将多路径软件添加到内核模块中:rootlocalhost etc# modprobe dm-multipathrootlocalhost etc# modprobe dm-round-robin55.3 检查内核添加情况:rootlocalhost etc# lsmod |grep multipath5.6 将多路径软件 multipath 设置为开机启动rootlocalhos
17、t etc# chkconfig multipathd on检查rootlocalhost etc# chkconfig -list|grep multipathd启动 multipath 服务:rootlocalhost etc# service multipathd restart5.7 修改多路径配置文件:rootlocalhost /# vi /etc/multipath.conf# Use user friendly names, instead of using WWIDs as names.defaults find_multipaths yesuser_friendly_nam
18、es yes# Here is an example of how to configure some standard options.#defaults udev_dir /devpolling_interval 10# selector “round-robin 0“path_grouping_policy multibusgetuid_callout “/lib/udev/scsi_id -whitelisted -device=/dev/%n“# prio aluapath_checker readsector0rr_min_io 100max_fds 8192rr_weight p
19、rioritiesfailback immediateno_path_retry fail# user_friendly_names yes保存退出5.7.1 查看、检查多路径rootlocalhost # multipath -l|morempathb (3600d02310003498c3030bca94afb6000) dm-4 UDsafe,ESS630TU-R16Esize=200G features=0 hwhandler=0 wp=rw-+- policy=round-robin 0 prio=-1 status=active|- 0:0:0:1 sdc 8:32 active
20、undef running- 1:0:0:1 sde 8:64 active undef runningmpatha (3600d02310003498c4517d01d79f01d5e) dm-3 UDsafe,ESS630TU-R16Esize=100G features=0 hwhandler=0 wp=rw-+- policy=round-robin 0 prio=-1 status=active|- 0:0:0:0 sdb 8:16 active undef running- 1:0:0:0 sdd 8:48 active undef running5.7.2 启用 multipat
21、h 配置后,会在/dev/mappper 下生成多路径逻辑盘rootlocalhost /# cd /dev/mapper/rootlocalhost mapper# ll总用量 0crw-rw- 1 root root 10, 58 7 月 8 18:57 controlbrw-rw- 1 root disk 253, 0 7 月 8 18:57 ddf1_4c53492020202020100000791000926147114711ca3d8277lrwxrwxrwx 1 root root 7 7 月 8 18:57 ddf1_4c534920202020201000007910009
22、26147114711ca3d8277p1 - /dm-1lrwxrwxrwx 1 root root 7 7 月 8 18:57 ddf1_4c53492020202020100000791000926147114711ca3d8277p2 - /dm-2lrwxrwxrwx 1 root root 7 7 月 8 19:01 mpatha - /dm-3lrwxrwxrwx 1 root root 7 7 月 8 19:01 mpathap1 - /dm-5lrwxrwxrwx 1 root root 7 7 月 8 19:01 mpathb - /dm-4lrwxrwxrwx 1 roo
23、t root 7 7 月 8 19:01 mpathbp1 - /dm-6rootlocalhost mapper#5.8 格式化 mpathap1 和 mpathap2rootlocalhost /# mkfs.ext4 /dev/mapper/mpathap1mke2fs 1.41.12 (17-May-2010)文件系统标签=操作系统:Linux块大小=4096 (log=2)分块大小=4096 (log=2)Stride=0 blocks, Stripe width=0 blocks6553600 inodes, 26214055 blocks1310702 blocks (5.00%
24、) reserved for the super user第一个数据块=0Maximum filesystem blocks=4294967296800 block groups32768 blocks per group, 32768 fragments per group8192 inodes per groupSuperblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424, 2048
25、0000, 23887872正在写入 inode 表 : 完成 Creating journal (32768 blocks): 完成Writing superblocks and filesystem accounting information: 完成This filesystem will be automatically checked every 23 mounts or180 days, whichever comes first. Use tune2fs -c or -i to override.rootlocalhost /#5.9 挂在分区:建立挂载点:rootlocalho
26、st /# mkdir /mpatha1挂在分区:rootlocalhost /# mount /dev/mapper/mpathap1 /mpatha1查看分区:rootlocalhost /# df -h文件系统 容量 已用 可用 已用% 挂载点/dev/mapper/ddf1_4c53492020202020100000791000926147114711ca3d8277p1449G 3.1G 423G 1% /tmpfs 3.9G 88K 3.9G 1% /dev/shm/dev/mapper/mpathbp1 197G 188M 187G 1% /mpathb1/dev/mapper/mpathap1 99G 188M 94G 1% /mpatha16、 DD 测试