Configure a File system resource in cluster[luci]


Step 1:

Server test1 have 4GB target /dev/vgsrv/storage, then we provide this share to other 3 nodes[test2,3,4-initiators].

In test1,

[root@test1 ~]# tgt-admin --show
Target 1: iqn.2008-09.com.example:first
    System information:
        Driver: iscsi
        State: ready
    I_T nexus information:
    LUN information:
        LUN: 0
            Type: controller
            SCSI ID: IET     00010000
            SCSI SN: beaf10
            Size: 0 MB, Block size: 1
            Online: Yes
            Removable media: No
            Prevent removal: No
            Readonly: No
            Backing store type: null
            Backing store path: None
            Backing store flags:
        LUN: 1
            Type: disk
            SCSI ID: IET     00010001
            SCSI SN: beaf11
            Size: 4295 MB, Block size: 512
            Online: Yes
            Removable media: No
            Prevent removal: No
            Readonly: No
            Backing store type: rdwr
            Backing store path: /dev/vgsrv/storage
            Backing store flags:
    Account information:
    ACL information:
        31.x.x.x
        10.50.68.16
        31.x.x.x
        10.50.68.17
        31.x.x.x
        10.50.68.18


Step 2:

Configure multipath on all three nodes with that 4Gb share.

In test2,

yum install iscsi-initiator-utils
iscsiadm -m discovery -t sendtargets -p 213.180.70.83  [public Nic]
iscsiadm -m node -T iqn.2008-09.com.example:first -p 213.180.70.83 -l
iscsiadm -m discovery -t sendtargets -p 10.50.68.15   [Private Nic]
iscsiadm -m node -T iqn.2008-09.com.example:first -p 10.50.68.15 -l
service iscsi restart
[root@test22 ~]# yum install device-mapper-multipath
 mpathconf --user_friendly_names n
 getuid_callout "lib/udev/scsi_id --replace-whitespace --whitelisted --device=/dev/%n" - include this line to defaults section in /etc/multipath.conf

This two used for identify the multipath device mapper id.

 service multipathd start
[root@test22 ~]# ls -la /dev/mapper/1IET_00010001
lrwxrwxrwx 1 root root 7 Apr  2 22:10 /dev/mapper/1IET_00010001 -> ../dm-0

Repeat the steps in test3,4.

Step 3:

-Create a partition under /dev/mapper/1IET_00010001 on test1.
-Make sure test3,4 see that new partition under /dev/mapper/1IET_00010001 by running,
[root@test22 ~]# partprobe ; multipath -r
[root@test22 ~]# mkfs -t ext4 /dev/mapper/1IET_00010001p1
-Install httpd on test2,3,4 servers.
-On test1, mount the /dev/mapper/1IET_00010001p1 to /var/ww/html
[root@test22 ~]# mount /dev/mapper/1IET_00010001p1 /var/www/html
-create index.html file and unmount.

Step 4:

Login to Luci and add this filesystem resource to Resources.

Comments

Popular posts from this blog

Using a Linux server to route packets between two private networks

PHP Fatal error: Class 'JFactory' not found

KVM & Qemu