环境:
服务器系统RHEL 5.2,盘柜型号HP MSA2000 2012i
第一次使用盘柜,把步骤记下来,其他操作系统和RedHat的配置步骤类似。
1.选择安装redhat server版本
2.安装后使用setup命令,修改防火墙和网络配置。记得打开ssh,http等端口(最好关闭防火墙和SELinux)
3.安装mysql和gcc
1)挂载安装光盘:
#su
#mkdir /mnt/disk
#mount /dev/cdrom /mnt/disk
2)rpm安装 (会有依赖的包,按照系统提示安装依赖的包即可)
#cd /mnt/disk/Server
#find *mysql*
#rpm -ivh mysql-5.0.45-7.el5.i386.rpm
#rpm -ivh mysql-server-5.0.45-7.el5.i386.rpm
#rpm -ivh mysql-devel-5.0.45-7.el5.i386.rpm #mysql.h等头文件需要先安装这个包
#find *gcc*
#rpm -ivh gcc-4.1.2-42.el5.i386.rpm
#rpm -ivh gcc-c++-4.1.2-42.el5.i386.rpm
#find *zlib*
#rpm -ivh zlib-1.2.3-3.i386.rpm
#rpm -ivh zlib-devel-1.2.3-3.i386.rpm
3)配置mysql(root用户执行,不然会报错)
#mysql_install_db
#mysqld_safe &
#mysql
看到进入mysql提示界面,就说明mysql安装好了。默认没有用户名和密码,需要自己配置.
#mysqladmin -uroot -p
4.安装iscsi(ubuntu下面是安装open-iscsi)
#cd /mnt/disk/Server
#find *iscsi*
#rpm -ivh iscsi-initiator-utils-6.2.0.868-0.7.el5.i386.rpm
5.配置iscsi
#su
#vim /etc/iscsi/iscsid.conf
node.startup = automatic #这一项在redhat是默认‘自动’的,ubuntu里面是默认‘手动’的
node.session.auth.username = My_ISCSI_USR_NAME
node.session.auth.password = MyPassword
discovery.sendtargets.auth.username = My_ISCSI_USR_NAME
discovery.sendtargets.auth.password = MyPassword
# /etc/init.d/iscsi start
6.连接盘柜 (如果有些命令找不到,试一试/sbin下面的。比如/sbin/iscsiadm)
#iscsiadm -m discovery -t sendtargets -p 10.0.0.63
#/etc/init.d/iscsi start
应该可以看到盘柜了,信息会是这样:
Stopping iSCSI daemon: /etc/init.d/iscsi: line 33: 28218 Killed /etc/init.d/iscsid stop
iscsid dead but pid file exists [ OK ]
Turning off network shutdown. Starting iSCSI daemon: [ OK ]
[ OK ]
Setting up iSCSI targets: Logging in to [iface: default, target: iqn.1986-03.com.hp:storage.msa2012i.0830d5d413.a, portal: 10.0.0.64,3260]
Logging in to [iface: default, target: iqn.1986-03.com.hp:storage.msa2012i.0830d5d413.a, portal: 10.0.0.63,3260]
Login to [iface: default, target: iqn.1986-03.com.hp:storage.msa2012i.0830d5d413.a, portal: 10.0.0.64,3260]: successful
Login to [iface: default, target: iqn.1986-03.com.hp:storage.msa2012i.0830d5d413.a, portal: 10.0.0.63,3260]: successful
[ OK ]
7.在盘柜的web页面配置
8.服务器挂载盘柜
#/etc/init.d/iscsi restart
#fdisk -l
可以看到盘柜了,找到dev下面的对应盘即可
如果没有格式化,执行 # mkfs.ext3 /dev/sdd1
#mkdir /mnt/iscsi
# mount /dev/sdd1 /mnt/iscsi
9.开机启动自动挂载
#vim /etc/fstab
/dev/sdd1 /mnt/iscsi ext3 _netdev 0 0
HP MSA2000 2012i 的盘柜在同一个volume上面只能有一台服务器连接上去写,不然会有写冲突。
没有评论:
发表评论