Objective: To share the experiment environment with remote network storage in RedHat: 192.168.0.13 (server) 192.168.0.12 (client) (host name and
Objective: To share remote network storage in RedHat
Lab environment: 192.168.0.13 (server)
192.168.0.12 (client)
(The Host Name and ip address must be consistent, and iptables should be cleared)
Installation package required for the experiment: iscsi-initiator-utils-*. rpm (client)
Scsi-target-utils-*. rpm (server)
Tutorial steps:
A: Server:
1 .. Configure the YUM Repository:
# Cd/etc/yum. repos. d/
# Vim server1.repo configuration is as follows:
--------------------------------------
# Repos on server1 for classroom use
# Main rhel5 server
[Base]
Name = Server1 Server Repository
Baseurl = ftp: // 192.168.0.254/pub/Server
Gpgcheck = 0
Enabled = 1
# This one is needed for xen packages
[VT]
Name = Server1 VT Repository
Baseurl = ftp: // 192.168.0.254/pub/VT
Gpgcheck = 0
Enabled = 1
# GLS rpms go in here
[GLS]
Name = Server1 GLS Repository
Baseurl = ftp: // 192.168.0.254/pub/gls/RPMS
Gpgcheck = 0
Enabled = 1
# Rhel5 udates
[Updates]
Name = Server1 Updates Repository
Baseurl = ftp: // 192.168.0.254/pub/errata
Gpgcheck = 0
Enabled = 1
[Cluster]
Name = Server1 Cluster Repository
Baseurl = ftp: // 192.168.0.254/pub/Cluster
Gpgcheck = 0
Enabled = 1
[ClusterStorage]
Name = Server1 CusterStorage Repository
Baseurl = ftp: // 192.168.0.254/pub/ClusterStorage
Gpgcheck = 0
Enabled = 1
--------------------------------------
# Yum clean all
2. Install the server software package:
# Yum-y install scsi-target-utils
3. Create a partition to be shared:
# Fdisk/dev/hda
----> P --> t --> 1 --> + 300 M --> w
-------------------- Partition effect -----------------------
Device Boot Start End Blocks Id System
/Dev/hda1 1 621 293391 83 Linux
--------------------------------------------------
# Partprobe
4. Enable the service and set it to boot:
# Service tgtd start
# Chkconfig tgtd on
5. Create Share Name:
# Tgtadm -- lld iscsi -- op new -- mode target -- tid 1-T iqn.2009.11.com. example. station13: disk1
6. Mount the partition to be shared:
# Tgtadm -- lld iscsi -- op new -- mode logicalunit -- tid 1 -- lun 1-B/dev/hda1
7. Bound to a specified IP address (which host is allowed to access shared storage)
# Tgtadm -- lld iscsi -- op bind -- mode target -- tid 1-I 192.168.0.12
8. Test the shared storage created on the local machine:
# Tgtadm -- lld iscsi -- op show -- mode target
9. Allow 0.12 machines to access the server through port 3260
# Iptables-I INPUT-s 192.168.0.12-p tcp -- dport 3260-j ACCEPT
# Service iptables save