Ask Me

Showing posts with label openfiler. Show all posts
Showing posts with label openfiler. Show all posts

Basic Configuration for Linux Server and Open Filer Server

 Linux Server:

--------------------
1. Create New virtual machine for  Redhat Linux Or Oracle enterprize Linux with below configuration.
a. RAM: 1.6 Gb Minmum
b. Hard Disk : 60gb
c. Use Custom partition when installing Linux
* /boot 100Mb
* / 4000 Mb
* /usr 8000 Mb
* /tmp 3000 Mb
* /swap 3000 Mb
* /u 40000 Mb

2. Install all packages if Needed.
3. Disable Firewall, SELinux.
4. Use your timezone as per requirement
5. Use Root password
6. Complete Installation.


OpenFiler SAN Server

--------------------------
1. Create New virtual machine for  Openfiler SAN woth below configuration.
a. RAM : 512 MB
b. Hard Disk : IDE : 8 GB
SCSI : 20GB (continued)
SCSi : 20Gb (as per requirement you can add more.

c. Use Custom partition  on 8gb hard disk (Hda)

* /boot 100Mb
* / 1500 Mb
* /usr 1500 Mb
* /tmp 3000 Mb
* /swap 3000 Mb


2. Use your timezone as per requirement
3. Use Root password
4. Complete Installation.

Setup NFS Mount Point Using Open Filer NAS storage

 


NFS (Network File System ) is acts like other mount point in Unix server as accessible to other client servers in the network. Its acts like shared storage for all configured servers in network.


1. Log In to Open filer (Userid : Openfiler Passowrd:Password)

2. Go to Volume manager .



3.Create New Physical volume . select your attached hard disk /dev/sda/b/c/d give volume name

4. Add Volume
 a. physical volume.
 b. XFS file system
 c. Specify size
 d. create.




5. Enable NFS services in service section



6.Go to Shares Section.
a. create a foler
b. make share this folder




7. Go to Shared foler and update the access to client server with below option.
(note: UID:GID Mapping NO root Squash-- so client can modify the ownership of this folder.






8. Go to Client system.

[root@test3 oradba]# cat /etc/fstab
LABEL=/                 /                       ext3    defaults        1 1
LABEL=/tmp              /tmp                    ext3    defaults        1 2
LABEL=/u                /u                      ext3    defaults        1 2
LABEL=/usr              /usr                    ext3    defaults        1 2
LABEL=/boot             /boot                   ext3    defaults        1 2
/dev/hda8               /backup                 ext3    defaults        1 2
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
LABEL=SWAP-hda5         swap                    swap    defaults        0 0
# device       mountpoint     fs-type     options      dump fsckorder
vsan:/mnt/svol/shared/oradba /oradba nfs rw 0 0
vsan:/mnt/backup/backup/backup /backup nfs rw 0 0

[root@test3 oradba]#


Create LUNs for database servers using Open-filer (virtual storage server)

 :::: Openfiler configuration:::::


1. open firefox on linux box with below URL

  https://192.168.18.133:446 (Ip of openfiler server : port number)
Or
Use https://openfiler.home.com:446

(DNS NAME and port Number if its configured on your DNS server)

2. Use username : openfiler

      passsword : password

3. Go to System Menu

go down : network access configuration

** ADD your client server name and ip 

Name ip network type
rac1 192.168.2.1 255.255.255.255 shared

Update more if required


4. go to Volumes  groups


create new physical volume use below of disks

Block Device Management
Edit Disk  Type  Description  Size  Label type  Partitions
/dev/hda  IDE  VMware Virtual IDE Hard Drive  8.00 GB  msdos  6 (view)
/dev/sda  SCSI  VMware, VMware Virtual S  19.99 GB  msdos  1 (view)
/dev/sdb  SCSI  VMware, VMware Virtual S  19.99 GB  msdos  1 (view)
/dev/sdc  SCSI  VMware, VMware Virtual S  19.99 GB  msdos  0 (view)
/dev/sdd  SCSI  VMware, VMware Virtual S  19.99 GB  msdos  0 (view)
/dev/sde  SCSI  VMware, VMware Virtual S  19.99 GB  msdos  0 (view)

Edit partitions in /dev/sdc (2610 cylinders with "msdos" label)

Mode  Partition Type  Starting cylinder  Ending cylinder  Size Create  Reset

Primary physical volume




Create

5. go to volume groups


volume group name < VOL1 >

/dev/sda

Add Volume group

6. Use volume group name <VOL1> change

Volume Name  Linux1
description SCSi

Create

7. ISCSI target 



-----> Target configuration : give LUN name and update it.

Target IQN Add
iqn.2006-01.com.openfiler:tsn.ff77104d727a
(LUN NAME)

Update

-----> Lun mapping : map selected volumes

Map New LUN to Target: "iqn.2006-01.com.openfiler:LINUX2"

Name LUN Path R/W Mode SCSI Serial No.  SCSI Id. Transfer Mode Map LUN
LINUX-SCSI /dev/vol1/linux1 kvKX5n-GWP5-2rtZ kvKX5n-GWP5-2rtZ Map

-----> Network ACL : 

Name  Network/Host  Netmask  Access
test1.home.com  192.168.18.134  255.255.255.255  allow
test2.home.com  192.168.18.135  255.255.255.255  allow

Update

8. Service : Start iscsi service 


9. configure iscsi disk in Linux Server



a. Open terminal on Linux box.
b. install required package for iscsi service ( scsi-initiator-utils )

[root@openfiler1 ~]# service iscsi-target restart
Stopping iSCSI target service: [  OK  ]
Starting iSCSI target service: [  OK  ]

[root@linux3 ~]# chkconfig iscsid on
[root@linux3 ~]# chkconfig iscsi on

c. Now that the iSCSI service is started, use the iscsiadm command-line interface to discover all available targets on the network storage server:


[root@linux3 ~]# iscsiadm -m discovery -t sendtargets -p openfiler1-san( can use ip instead of openfiler-san name)
192.168.2.195:3260,1 iqn.2006-01.com.openfiler:scsi.linux3-data-1


d. Manually login targets.

[root@linux3 ~]# iscsiadm -m node -T iqn.2006-01.com.openfiler:scsi.linux3-data-1 -p 192.168.2.195 --login
Logging in to [iface: default, target: iqn.2006-01.com.openfiler:scsi.linux3-data-1, portal: 192.168.2.195,3260]
Login to [iface: default, target: iqn.2006-01.com.openfiler:scsi.linux3-data-1, portal: 192.168.2.195,3260]: successful

e. Configure Automatic Login

The next step is to make certain the client will automatically login to the target(s) listed above when the machine is booted (or the iSCSI initiator service  is started/restarted):


[root@linux3 ~]# iscsiadm -m node -T iqn.2006-01.com.openfiler:scsi.linux3-data-1 -p 192.168.2.195 --op update -n node.startup -v automatic

F.NOW We can see iscsi disk as /sda in linux server

[root@linux3 ~]# (cd /dev/disk/by-path; ls -l *openfiler* | awk '{FS=" "; print $9 " " $10 " " $11}')
ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:scsi.linux3-data-1 -> ../../sda

Current iSCSI Target Name to local SCSI Device Name Mappings iSCSI Target Name  SCSI Device Name
iqn.2006-01.com.openfiler:scsi.linux3-data-1  /dev/sda

g. As you can see, it is impractical to rely on using the local SCSI device names like /dev/sda or /dev/sdb given there is no way to predict the iSCSI target  mappings after a reboot. 

 What we need is a consistent device name we can reference like /dev/iscsi/linux3-data-1 that will always point to the appropriate iSCSI target through  reboots. This is where the Dynamic Device Management tool named udev comes in. udev provides a dynamic device directory using symbolic links that point to the  actual device using a configurable set of rules. When udev receives a device event (for example, the client logging in to an iSCSI target), it matches its  configured rules against the available device attributes provided in sysfs to identify the device. Rules that match may provide additional device information  or specify a device node name and multiple symlink names and instruct udev to run additional programs (a SHELL script for example) as part of the device event handling process.

The first step is to create a new rules file. This file will be named /etc/udev/rules.d/55-openiscsi.rules and contain only a single line of name=value pairs  used to receive events we are interested in. It will also define a call-out SHELL script (/etc/udev/scripts/iscsidev.sh) to handle the event.

Create the following rules file /etc/udev/rules.d/55-openiscsi.rules on the client node linux3:


# /etc/udev/rules.d/55-openiscsi.rules
KERNEL=="sd*", BUS=="scsi", PROGRAM="/etc/udev/scripts/iscsidev.sh %b",SYMLINK+="iscsi/%c/part%n"

Next, create the UNIX SHELL script that will be called when this event is received. Let's first create a separate directory on the linux3 node where udev  scripts can be stored:


[root@linux3 ~]# mkdir -p /etc/udev/scripts

Finally, create the UNIX shell script /etc/udev/scripts/iscsidev.sh:


#!/bin/sh

# FILE: /etc/udev/scripts/iscsidev.sh

BUS=${1}
HOST=${BUS%%:*}

[ -e /sys/class/iscsi_host ] || exit 1

file="/sys/class/iscsi_host/host${HOST}/device/session*/iscsi_session*/targetname"

target_name=$(cat ${file})

# This is not an open-scsi drive
if [ -z "${target_name}" ]; then
   exit 1
fi

# Check if QNAP drive
check_qnap_target_name=${target_name%%:*}
if [ $check_qnap_target_name = "iqn.2004-04.com.qnap" ]; then
     target_name=`echo "${target_name%.*}"`
fi

echo "${target_name##*.}"

After creating the UNIX SHELL script, change it to executable:


[root@linux3 ~]# chmod 755 /etc/udev/scripts/iscsidev.sh

Now that udev is configured, restart the iSCSI initiator service:


[root@linux3 ~]# service iscsi stop
Logging out of session [sid: 3, target: iqn.2006-01.com.openfiler:scsi.linux3-data-1, portal: 192.168.2.195,3260]
Logout of [sid: 3, target: iqn.2006-01.com.openfiler:scsi.linux3-data-1, portal: 192.168.2.195,3260]: successful
Stopping iSCSI daemon: /etc/init.d/iscsi: line 33:  5143 Killed                  /etc/init.d/iscsid stop


[root@linux3 ~]# service iscsi start
iscsid dead but pid file exists
Turning off network shutdown. Starting iSCSI daemon: [  OK  ]
[  OK  ]
Setting up iSCSI targets: Logging in to [iface: default, target: iqn.2006-01.com.openfiler:scsi.linux3-data-1, portal: 192.168.2.195,3260]
Login to [iface: default, target: iqn.2006-01.com.openfiler:scsi.linux3-data-1, portal: 192.168.2.195,3260]: successful
[  OK  ]


[root@linux3 ~]# ls -l /dev/iscsi/
total 0
drwxr-xr-x 2 root root 60 Apr  7 01:57 linux3-data-1


[root@linux3 ~]# ls -l /dev/iscsi/linux3-data-1/
total 0



lrwxrwxrwx 1 root root 9 Apr  7 01:57 part -> ../../sda

Popular Posts