Implementation of iSCSI + GFS shared storage on CentOS5

Source: Internet
Author: User
1. Install the system environment: CentOSrelease5.5? BRL. 18-194. el5xen installs iscsi-target, which is the storage end. The storage end installs iscsi-target to install iscsi-initiator on a host with a shared disk, the storage server installs iscsi-initiator on the host that uses shared storage. globalfile0000e is installed on all GFS nodes. 1. Installation

System Environment: CentOS release 5.5? 2.6.18-194. el5xen
Install iscsi-target. The storage target is the storage end.
Install iscsi-target on a host with a shared Disk
Install iscsi-initiator on the Storage Server
Install iscsi-initiator on the host that uses shared storage, and all GFS nodes
Install global FileSystem: Global File system
Install the gfs module on a host that uses shared storage
The main gfs components are, ClusterVolume management, lock management, cluster management, cluster configuration management, fences, and recovery.

Assume that there are three computers whose IP addresses are each has an available disk as a shared disk.
All three computers are GFS nodes, that is, shared disks.
Install and configure iscsi-target, iscsi-initiator, and gfs on
Install and configure iscsi-target, iscsi-initiator, and gfs on
Install and configure iscsi-initiator and gfs on
1. Install iscsi-target
# Yum install scsi-target-uti Ls
# Yum install libibverbs-devel libibverbs librdmacm-devel

2. Install iscsi-initiator
# Yum install iscsi-initiator-utils

3. Install gfs
# Yum install-y gfs2-utils cman kmod-gfs kmod-dlm cluster-snmp lvm2-cluster rgmanager

Ii. Configure shared storage

Configure iscsi-target
Create a target device
Configure iscsi-initiator
Record and log on to the target device
Configure GFS sharing
Use GFS for file sharing and Synchronization

1. Configure iscsi-target

#/Etc/init. d/tgtd start

Create a partition in ( Fdisk):/Dev/sda9

# Tgtadm -- lld iscsi -- op new -- mode target -- t Id1-T nfschina: nfs-storage24
Add a new iscsi-target: nfschina: nfs-storage
-- Tid target id
-- T is equivalent to-targetname.
Iqn (iSCSI Qualifi EdName) Naming rules:
Format meaning example
Yyyy-mm year-2011-09
Rever Sed-Domain-name: Write the domain name in turn. Generally, write the Company domain name in reverse form to com. nfschina.
Identifier, usually indicating the purpose of the bucket nfs-storage

# Tgtadm -- lld iscsi -- op new -- mode logicalunit -- tid 1 -- lun 1-B/dev/sda9
Add the disk partition to the target device.
# Tgtadm -- lld iscsi--op show-mode target

# Tgtadm -- lld -- op bind? Mode target? Tid 1-I initiator-ip
Replace initiator-ip with ALL
# Tgtadm -- lld iscsi -- op bind -- mode target -- tid 1-I
# Tgtadm -- lld iscsi -- op bind -- mode target -- tid 1-I ALL

Configure iscsi-target on with the target name nfschina: nfs-storage07 using the same method

2. Configure iscsi-initiator

Install and configure iscsi-initiator on all three computers

#/Etc/init. d/iscsi start
Start the iscsi Module

# Iscsiadm-m discovery-t sendtargets-p
# Iscsiadm-m discovery-t sendtargets-p
Use iscsiadm CommandTest iscsi device
After the command is executed, device information will be logged locally:/var/lib/iscsi/nodes/ nfschina: rhcs-storage08/
The next time iscsi is started, it will automatically read the information and log on to the device. To cancel Automatic Logon, delete the corresponding folder.

# Iscsiadm-m node-T nfschina: nfs-storage24-p
# Iscsiadm-m node-T nfschina: nfs-storage07-p
Log on to the target device.
After successful logon, you can use fdisk-l to find two more hard disk partitions, sdb and sdc. This is the iscsi shared partition.
Logout: # iscsiadm-m node-T nfschina: nfs-storage-p target-ip-u

3. Configure GFS

Add the following content at the end of the/etc/hosts file on the three computers: gfs1 gfs2 gfs3
Several GFS nodes are added, and each node needs to be added.

The following describes how to configure a gfs1 node.
# Echo \ '\ 'initiatoralias = gfs1 \'>/etc/iscsi/initiatorname. iscsi
Initiator alias

Create a configuration file:/etc/cluster. conf and add the following content:


< Rm>

#/Etc/init. d/gfs start
#/Etc/init. d/gfs2 start
Enable the gfs service.
#/Etc/init. d/rgmanager start
Enable cluster management.
#/Etc/init. d/cman start
Enable the cluster.
#/Etc/init. d/clvm start
Enable cluster volume management.
Ps: The above to "3. Configure GFS" must be executed on each GFS node (3 computers.
The following configuration can be executed on any computer.

Assume that the local host has an additional/dev/sdb/dev/sdc disk after the login node logs on to the taget device.

# Pvcreate-ff/dev/sdb view physical volume details through pvdisplay
# Pvcreate-ff/dev/sdc
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.