Reference Guide
Create ISCI Server
- yum install scsi-target-utils.x86_64'
- Turn on tgtd
- # chkconfig tgtd on
- # service tgtd start Starting SCSI target daemon: [ OK ]
- Use tgtadm to configure target
- tgtadm -help
- Check if any existing targets exist
- tgtadm --lld iscsi --mode target --op show
- Configure the first target ID as 101
- # tgtadm --lld iscsi --mode target --op new --tid 101 --targetname iqn.server1.example.com:target1
- Verify the target
- # tgtadm --lld iscsi --mode target --op show
- Create 1G logical volume for testing (of course in the real world you'd use a storage volume or lun)
- ]# lvcreate -L 1G -n lv_iscsi vg_server1
- Attach LUN to the ISCSI Target (decide which disk to use - example in step above)
- ]# tgtadm --lld iscsi --mode logicalunit --op new --tid 101 --lun 1 --backing-store /dev/mapper/vg_server1-lv_iscsi
- repeat of you want two 'luns'
- Verify new lun
- # tgtadm --lld iscsi --mode target --op show
- Share to specific Network or Client
- # tgtadm --lld iscsi --mode target --op bind --tid 101 --initiator-address 192.168.0.0/24
- Configure authentication to the target
- # tgtadm --lld iscsi --mode account --op new --user iclient --password password
- Attach user to the 101 target
- # tgtadm --lld iscsi --mode account --op bind --tid 101 --user iclient
- Verify User was attached to target 101
- # tgtadm --lld iscsi --mode account --op show Account list: iclient
- # tgtadm --lld iscsi --mode target --op show
- Backup the original configuration
- # cp /etc/tgt/targets.conf /etc/tgt/targets.orig
- Create configuration file from the dump command
- # tgt-admin --dump default-driver iscsi <target iqn.server1.com.example.target1> backing-store /dev/mapper/vg_server1-lv_iscsi incominguser iclient PLEASE_CORRECT_THE_PASSWORD initiator-address 192.168.0.0/24 </target>
- Copy or 'echo' the output of above dump command into targets.conf file to allow for persitance
- tgt-admin --dump >> /etc/tgt/targets.conf
- remove or comment out the duplicate 'default-driver iscsi'
- Verify configuration after restart
- # service tgtd restart
- Check what ports are in use
- # netstat -pantl | grep tgt
- Add firewall rules (if using iptables)
Client Configuration
- Install client tools if not installed
- # yum install iscsi-initiator-utils
- Configure for restart
- # service iscsid restart Stopping iscsid: Starting iscsid: [ OK ] [root@tester1 ~]# service iscsid force-start Starting iscsid: [root@tester1 ~]# chkconfig --list iscsid iscsid 0:off 1:off 2:off 3:on 4:on 5:on 6:off
- # iscsiadm -m discovery -t st -p 192.168.56.102
- # dmesg | tail
- # iscsiadm -m node T iqn.2013-10.com.example.server1:target1 -p 192.168.56.102:3260,1 -l
###################
Firs not down question points correctly
Exam use FQDN DON’T FORGET TO LOGOUT AT END ITS VERY IMP
yum install iscsi* -y
man iscsiadm , go to end of page it will be given
iscsiadm --mode discoverydb --type sendtargets --portal 192.168.0.254 --discover [ change to server ip ]
192.168.0.254:3260,1 iqn.2010-09.com.example:rdisks.server24
now copy IQN "iqn.2010-09.com.example:rdisks.server24" IP 192.168.0.254 , leave port as it is.
Copy Login line , replace iqn and ip of server
iscsiadm --mode node --targetname iqn.2010-09.com.example:rdisks.server24 --portal 192.168.0.254:3260 --login
now fdisk -l
check the mounted /dev/sda
create partition of given size
now mkfs.xt4 /dev/sda1
blkid /dev/sda1 and copy uuid [ UUID="f48afc51-d621-4046-932e-b6084d2286be" ]
vim /etc/fstab
[ Device Name] [Where to store] file-type defaults
UUID="f48afc51-d621-4046-932e-b6084d2286be" /mnt/storage ext4 _netdev 0 0
umount -a
mount -a
go to mount /mnt/storage
No comments:
Post a Comment