Dirty setup iSCSI server(target)
1. Install iscsi server
shell# yum -y install scsi-target-utils
or
shell# rpm -ivh scsi-target-utils
2. Edit the configuration file and allow incoming connection to 3260
shell# vi /etc/tgt/targets.conf
# default
defaults-driver iscsi
add this parameter
<target iqn.2012-05.com.example:disk0>
backing-store /dev/vg00/lvscis00
</target>
backing-store /dev/vg00/lvscis00
</target>
shell# vi /etc/sysconfig/iptables
add this
-A INPUT -p tcp -m state --state NEW -m tcp --dport 3260 -j ACCEPT
restart IPTABLES
shell# /etc/init.d/iptables restart
or in command line
/sbin/iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 3260 -j ACCEPT
save IPTABLES
shell# /etc/init.d/iptables save
3. Create disk for our iscsi using LVM
vg name = vg00
lv name = lvscsi00
4. then start the iscsi server
shell# /etc/init.d/tgtd start
or
shell# service tgtd start
5. then lets test our server
-check the config and disk
shell# tgtadm --lld iscsi --mode target --op show
on client side
shell# iscsiadm -m discovery -t st -p iscsiserver.example.com
NOTE: you need to have iscsi client (initiator)
install this package: iscsi-initiator-utilsiSCSI Initiator
discover iSCSI target
iscsiadm -n discovery -t st -p 192.168.0.254
Login in one or more iSCSI targets
iscsiadm -m node -T iqn.2011-10.com.example:rdisks.demo -p 192.168.0.254 -l
Logout to disconnect temporary
iscsiadm -m node -T iqn.2011-10.com.example:rdisks.demo -p 192.168.0.254 -u
Delete the local record
iscsiadm -m node -T iqn.2011-10.com.example:rdisks.demo -p 192.168.0.254 -o delete
Comments
Post a Comment