Configuration steps:
1. Check whether the iSCSI driver is installed.
rpm -qa|grep iscsi
2. view the yum installation Source
yum list |grep iscsi
3. Install the iSCSI driver
yum install iscsi-initiator-utils
4. Configure the client name
vim /etc/iscsi/initiatorname.iscsi
#initiatorname.iscsiInitiatorName=iqn.2012-10.net.cpd:san.initiator01InitiatorAlias=initiator01
5. modify the configuration file
vim /etc/iscsi/iscsid.conf
#iscsid.conf# To manually startup the session set to "manual". The default is automatic.node.startup = automatic# To enable CHAP authenticationnode.session.auth.authmethod = CHAP# To set a CHAP username and password for initiatornode.session.auth.username = iscsiadmnode.session.auth.password = iscsiadm123
6. Search for target Storage
iscsiadm -m discovery -t sendtargets -p 192.168.130.201
7. View check information
iscsiadm -m node -o show
8. log on
#登录全部扫描到的服务器iscsiadm -m node --login #登录某一个#iscsiadm --mode node --targetname iqn.2012-10.net.cpd:san.target01 --portal 172.16.201.200 --login
7. Check logon information
iscsiadm -m session -o show
8. view disk Information
fdisk -l#or#cat /proc/partitions
9. format the disk
mkfs.ext4 /dev/mapper/san
#格式化大文件 #mkfs.ext4 -T largefile /dev/mapper/san
PS: San hard disks can usually see three after being scanned by iscsiadm. Mount the ER er ing.
10. Attach a disk
mkdir /mnt/san
mount -t ext4 /dev/mapper/san /mnt/san
10. Set the iSCSI process to automatically mount with system startup and startup
#1#查看启动设置chkconfig --list netfs#设置启动chkconfig iscsi on chkconfig iscsid on#2#设置自动挂载vim /etc/fstab#add #/dev/sdb1 /var/kvm ext4 _netdev 0 0
Problem:
Question.UseService iSCSI startAndService iscsid startUnable to start
Try to use/Sbin/iscsistartStartup error: initiatorname not set. exiting iscsistart
Solution:Directly use iscsiadm to query and automatically start iSCSI and iscsid
Problem B.After login, the SDB network hard disk cannot be found in the/dev directory, and SG1 can be found.
Solution:It should be about server configuration. After the server administrator modifies the configuration, the disk is displayed.
Problem solving:
1. Check whether the logon is normal.
iscsiadm -m session
2. Check whether the network is normal.
netstat -n -p|grep 3260
Refer:
[1] sunshyfangtian. centos5 iSCSI deployment. http://sunshyfangtian.blog.51cto.com/1405751/560162.2013-10-16
[2] Ivan Mora pé Rez. etup iSCSI target & initiator on centos 6. http://opentodo.net/2012/10/setup-iscsi-target-initiator-on-centos-6/.2013-10-16
Open-iSCSI.http: // www.open-iscsi.org/
[4] Linux-iSCSI project. http://linux-iscsi.sourceforge.net/
[5] configure iSCSI initiator. http://www.server-world.info/en/note? OS = centos_6 & P = iSCSI & F = 2.2013-10-16
[6] nixcraftnixcraft. centos/Red Hat Linux: Install and manage iSCSI volume. http://www.cyberciti.biz/tips/rhel-centos-fedora-linux-iscsi-howto.html.2013-10-16
[6] ext4 (Simplified Chinese). https://wiki.archlinux.org/index.php/Ext4_ (% E7 % AE % 80% E4 % BD % 93% E4 % B8 % ad % E6 % 96% 87 ).
Centos iSCSI client Configuration