konfigurasi iscsi target dan initiator di centos 6

Berikut adalah cara instalasi ISCSI server sebagai target sedangakan client sebagai initiator: Untuk iscsi target berikut langkah-langkahnya :

iscsi-target , IP Address 192.168.56.2
iscsi-initiator, IP Address 192.168.56.3

Install paket scsi-target-utils

root-# yum install scsi-target-utils

Edit file konfigurasi /etc/tgt/targets.conf, tambahkan parameter konfigurasi di baris paling bawah

target iqn.2012-11.simplyaddo.com:iscsi1;
        backing-store /dev/vg_iscsi/lv1_iscsi
        initiator-address 192.168.56.3
        incominguser iscsitest centos
target;

Untuk penamaan target

iqn.2012-11.simplyaddo.com:iscsi1

bisa disesuaikan dengan kebutuhan anda. Untuk dokumentasi penamaan target, silahkan buka file /etc/tgt/targets.conf , disana cukup jelas untuk model penamaannya.
Backing-store adalah disk yang akan digunakan untuk iscsi target nya.
Initiator-address adalah IP Address yang diijinkan untuk mengakses iscsi target yang dibuat.
Incoming-user bisa disesuaikan dengan kebutuhan.
Jalankan service tgt / tgtd

root-# /etc/init.d/tgt start
root-# chkconfig tgt on

Cek status iscsi target

root-# tgtdadm --mode target --op show

Konfigurasi iscsi-initiator di client
Install paket iscsi-initiator-utils

root-# yum install iscsi-initiator-utils

Edit file konfigurasi /etc/iscsi/iscsid.conf. Uncomment pada baris 49 atau pada bagian berikut :

node.session.auth.authmethod = CHAP
 # To set a CHAP username and password for initiator
 # authentication by the target(s), uncomment the following lines:
 node.session.auth.username = useriscsi
 node.session.auth.password = P@ssw0rd

Username dan password disesuaikan dengan konfigurasi pada iscsi-target.
Jalankan perintah berikut untuk mengecek koneksi antara iscsi client dengan iscsi target

root-# iscsiadm -m discovery -t sendtargets -p 192.168.56.2
root-# chkconfig iscsi on
root-# chkconfig iscsid on

Konfirmasi status discovery diatas, jalankan perintah berikut :

root-# iscsiadm -m node -o show

maka akan Keluar output seperti berikut :

# BEGIN RECORD 2.0-872
node.name = iqn.2012-11.1rstwap.com:iscsi1
node.tpgt = 1
node.startup = automatic
iface.hwaddress = <empty>
iface.ipaddress = <empty>
iface.iscsi_ifacename = default
iface.net_ifacename = <empty>
iface.transport_name = tcp
iface.initiatorname = <empty>
node.discovery_address = 192.168.56.2
node.discovery_port = 3260
node.discovery_type = send_targets
node.session.initial_cmdsn = 0
node.session.initial_login_retry_max = 8
node.session.xmit_thread_priority = -20
node.session.cmds_max = 128
node.session.queue_depth = 32
node.session.auth.authmethod = CHAP
node.session.auth.username = iscsitest
node.session.auth.password = ********
node.session.auth.username_in = <empty>
node.session.auth.password_in = <empty>
node.session.timeo.replacement_timeout = 120
node.session.err_timeo.abort_timeout = 15
node.session.err_timeo.lu_reset_timeout = 30
node.session.err_timeo.tgt_reset_timeout = 30
node.session.err_timeo.host_reset_timeout = 60
node.session.iscsi.FastAbort = Yes
node.session.iscsi.InitialR2T = No
node.session.iscsi.ImmediateData = Yes
node.session.iscsi.FirstBurstLength = 262144
node.session.iscsi.MaxBurstLength = 16776192
node.session.iscsi.DefaultTime2Retain = 0
node.session.iscsi.DefaultTime2Wait = 2
node.session.iscsi.MaxConnections = 1
node.session.iscsi.MaxOutstandingR2T = 1
node.session.iscsi.ERL = 0
node.conn[0].address = 192.168.56.2
node.conn[0].port = 3260
node.conn[0].startup = manual
node.conn[0].tcp.window_size = 524288
node.conn[0].tcp.type_of_service = 0
node.conn[0].timeo.logout_timeout = 15
node.conn[0].timeo.login_timeout = 15
node.conn[0].timeo.auth_timeout = 45
node.conn[0].timeo.noop_out_interval = 5
node.conn[0].timeo.noop_out_timeout = 5
node.conn[0].iscsi.MaxXmitDataSegmentLength = 0
node.conn[0].iscsi.MaxRecvDataSegmentLength = 262144
node.conn[0].iscsi.HeaderDigest = None
node.conn[0].iscsi.IFMarker = No
node.conn[0].iscsi.OFMarker = No
# END RECORD

Login ke iscsi target

root-# iscsiadm -m node --login

Konfirmasi login session

root-# iscsiadm -m session -o show

Cek partisi baru yang didapat dari iscsi target

root-# cat /proc/partitions
 root-# fdisk -l
 root-# tail /var/log/messages
 iscsi2-server kernel: iscsi: registered transport (iser)
 iscsi2-server kernel: cxgb3i: tag itt 0x1fff, 13 bits, age 0xf, 4 bits.
 iscsi2-server kernel: iscsi: registered transport (cxgb3i)
 iscsi2-server kernel: cnic: Broadcom NetXtreme II CNIC Driver cnic v2.1.2 (May 26, 2010)
 iscsi2-server kernel: Broadcom NetXtreme II iSCSI Driver bnx2i v2.1.1 (Mar 24, 2010)
 iscsi2-server kernel: iscsi: registered transport (bnx2i)
 iscsi2-server kernel: iscsi: registered transport (be2iscsi)
 iscsi2-server iscsid: iSCSI logger with pid=1430 started!
 iscsi2-server iscsid: transport class version 2.0-870. iscsid version 2.0-872
 iscsi2-server iscsid: iSCSI daemon with pid=1431 started!
 iscsi2-server kernel: scsi3 : iSCSI Initiator over TCP/IP
 iscsi2-server kernel: scsi 3:0:0:0: RAID IET Controller 0001 PQ: 0 ANSI: 5
 iscsi2-server kernel: scsi 3:0:0:0: Attached scsi generic sg2 type 12
 iscsi2-server kernel: scsi 3:0:0:1: Direct-Access IET VIRTUAL-DISK 0001 PQ: 0 ANSI: 5
 iscsi2-server kernel: sd 3:0:0:1: Attached scsi generic sg3 type 0
 iscsi2-server kernel: sd 3:0:0:1: [sdb] 6291456 512-byte logical blocks: (3.22 GB/3.00 GiB)
 iscsi2-server kernel: sd 3:0:0:1: [sdb] Write Protect is off
 iscsi2-server kernel: sd 3:0:0:1: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
 iscsi2-server kernel: sdb: unknown partition table
 iscsi2-server kernel: sd 3:0:0:1: [sdb] Attached SCSI disk
 iscsi2-server iscsid: Connection1:0 to [target: iqn.2012-11.1rstwap.com:iscsi1, portal: 192.168.56.2,3260] through [iface: default] is operational now

Membuat partisi dengan fdisk

root# fdisk /dev/sdb

Format filesystem dengan ext4

root# mkfs.ext4 /dev/sdb1

iscsi disk siap digunakan
Untuk logout dari iscsi target, gunakan perintah berikut :

root-# iscsiadm -m node -u
Be Sociable, Share!

2 thoughts on “konfigurasi iscsi target dan initiator di centos 6

Leave a Reply

Your email address will not be published. Required fields are marked *


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

[+] kaskus emoticons nartzco