Thursday, July 11, 2013

Lustre-2.4 with zfs backend

- Install ZFS on Linux.
- Install Lustre_2.4
...and you are running lustre with zfs backend. Its easy !!

[root@cos63 lustre-2.4]# FSTYPE=zfs /usr/lib64/lustre/tests/llmount.sh
Stopping clients: cos63 /mnt/lustre (opts:)                          
Stopping clients: cos63 /mnt/lustre2 (opts:)                         
Loading modules from /usr/lib64/lustre/tests/..                      
detected 2 online CPUs by sysfs                                      
Force libcfs to create 2 CPU partitions                              
debug=vfstrace rpctrace dlmtrace neterror ha config ioctl super      
subsystem_debug=all -lnet -lnd -pinger                               
gss/krb5 is not supported                                            
Formatting mgs, mds, osts                                            
Format mds1: lustre-mdt1/mdt1                                        
Format ost1: lustre-ost1/ost1                                        
Format ost2: lustre-ost2/ost2                                        
Checking servers environments                                        
Checking clients cos63 environments                                  
Loading modules from /usr/lib64/lustre/tests/..                      
detected 2 online CPUs by sysfs                                      
Force libcfs to create 2 CPU partitions                              
debug=vfstrace rpctrace dlmtrace neterror ha config ioctl super      
subsystem_debug=all -lnet -lnd -pinger                               
gss/krb5 is not supported                                            
Setup mgs, mdt, osts                                                 
Starting mds1:   lustre-mdt1/mdt1 /mnt/mds1                          
Started lustre-MDT0000                                               
Starting ost1:   lustre-ost1/ost1 /mnt/ost1                          
Started lustre-OST0000                                               
Starting ost2:   lustre-ost2/ost2 /mnt/ost2                          
Started lustre-OST0001                                               
Starting client: cos63: -o user_xattr,flock cos63@tcp:/lustre /mnt/lustre
Using TIMEOUT=20                                                        
seting jobstats to procname_uid                                         
Setting lustre.sys.jobid_var from disable to procname_uid               
Waiting 90 secs for update                                              
Updated after 8s: wanted 'procname_uid' got 'procname_uid'              
disable quota as required                                               

[root@cos63 lustre-2.4]# df -h                                          
Filesystem            Size  Used Avail Use% Mounted on                  
/dev/mapper/vg_cos63-lv_root                                            
                       18G  6.6G  9.9G  40% /                           
tmpfs                 431M  176K  431M   1% /dev/shm                    
/dev/sda1             485M  299M  162M  65% /boot                       
/dev/sdb              2.0G  774M  1.2G  41% /home/akam/Downloads        
lustre-mdt1/mdt1      154M  3.2M  149M   3% /mnt/mds1                   
lustre-ost1/ost1      154M  1.2M  151M   1% /mnt/ost1                   
lustre-ost2/ost2      154M  1.2M  151M   1% /mnt/ost2                   
cos63@tcp:/lustre     308M  2.3M  302M   1% /mnt/lustre
[root@cos63 lustre-2.4]#

[root@cos63 ~]# zpool status
  pool: lustre-mdt1
 state: ONLINE
  scan: none requested
config:

    NAME                STATE     READ WRITE CKSUM
    lustre-mdt1         ONLINE       0     0     0
      /tmp/lustre-mdt1  ONLINE       0     0     0

errors: No known data errors

  pool: lustre-ost1
 state: ONLINE
  scan: none requested
config:

    NAME                STATE     READ WRITE CKSUM
    lustre-ost1         ONLINE       0     0     0
      /tmp/lustre-ost1  ONLINE       0     0     0

errors: No known data errors

  pool: lustre-ost2
 state: ONLINE
  scan: none requested
config:

    NAME                STATE     READ WRITE CKSUM
    lustre-ost2         ONLINE       0     0     0
      /tmp/lustre-ost2  ONLINE       0     0     0

errors: No known data errors
[root@cos63 ~]#

[root@cos63 ~]# zpool status
  pool: lustre-mdt1
 state: ONLINE
  scan: none requested
config:

    NAME                STATE     READ WRITE CKSUM
    lustre-mdt1         ONLINE       0     0     0
      /tmp/lustre-mdt1  ONLINE       0     0     0

errors: No known data errors

  pool: lustre-ost1
 state: ONLINE
  scan: none requested
config:

    NAME                STATE     READ WRITE CKSUM
    lustre-ost1         ONLINE       0     0     0
      /tmp/lustre-ost1  ONLINE       0     0     0

errors: No known data errors

  pool: lustre-ost2
 state: ONLINE
  scan: none requested
config:

    NAME                STATE     READ WRITE CKSUM
    lustre-ost2         ONLINE       0     0     0
      /tmp/lustre-ost2  ONLINE       0     0     0

errors: No known data errors
[root@cos63 ~]#

[root@cos63 ~]# lctl get_param version
version=
lustre: 2.4.0
kernel: patchless_client
build:  2.4.0-RC2-gd3f91c4-PRISTINE-2.6.32-358.6.2.el6_lustre.g230b174.x86_64
[root@cos63 ~]#

[root@cos63 ~]# cat /etc/redhat-release
CentOS release 6.3 (Final)
[root@cos63 ~]#

Lustre ZFS_on_Linux

Thursday, June 6, 2013

More Git

1.
$ git log --oneline --decorate
4cf7a70 (HEAD, origin/next, origin/master, origin/HEAD, master) misc: fix gcc -Wall nits
fd9ca82 e2fsck: fix gcc -Wall nits
894eaf8 libext2fs: fix gcc -Wall nits
581ecb6 Merge branch 'maint' into next
6847735 (origin/maint) e2fsck: fix gcc -Wall nits


2.
git clone -b stable_1.2.0 ssh://username@my.git.repo.com:29418/e2fsprogs

3.
The name-rev command can tell us the position of a commit relative to tags in the project.
 
$ git name-rev --name-only 737da033
tags/2.2.51~30

$

This tells us that this commit is located 30 commits before “2.2.51” was tagged—we can be certain that this change is now part of 2.2.51, then.

4.
Find out which branch contains the change;
 
$ git branch --contains 5bdbd0e
* b_neo_stable_1.2.0

$

5.
See which changes from a branch are already present upstream

$ git cherry -v master
+ 244a9a58c06db1317360a6ec42a6344ff5cc73e6 initial work on AD support for lustre
+ b5e324519aacf6c0a7891783fd7b9e4dce710004 import xyratex patch
+ cb03cca8bbcd62541ce822e9be9099f2a7e947ef inital implementation of Windows AD integration
+ cd5ee7a2698d51dbc46a7b31586eee0a2d70de4d fix build without ldap
...


6.
Show last commit message that matches a regex

$ git show :/fix

Show the last commit which has "fix" in it.

7.
$ git log --follow -p file

This will show the entire history of the file (including history beyond renames and with diffs for each change)

Courtesy : [ git tips][stackoverflow] 

Wednesday, June 5, 2013

Glossary

Intent


An intent is a piece of data supplied with a lock enqueue indicating special processing is needed during lock enqueue, and the data themselves are the parameters for that processing. Namespaces can have different intent handlers defined for such processing.
The intent feature allows the caller of namei and lookup to pass some information about what they want to accomplish in the end. The net effect of this is a reduced number of RPC requests when interacting with the MDS.
A intent is defined as follows (inode.h):
struct intent {
    unsigned    int_opmask;
    void        * int_arg1;
    void        * int_arg2;
};
Six intention operations are defined (encoded in int_opmask). These are get attributes, set attributes, insert or delete, open, create, and read links.

Glimpse Callback
An RPC made by an OST or MDT to another system, usually a client, to indicate to that an extent lock it is holding should be surrendered if it is not in use. If the system is using the lock, then the system should report the object size in the reply to the glimpse callback. Glimpses are introduced to optimize the acquisition of file sizes.
Glimpse is the optimal method to get file size during active IO.

In layman language, 
If I setup a Dr.'s appointment, I can give them my phone number, so they can call me the day before to confirm the appointment. A callback is like that, except instead of just being a phone number, it can be arbitrary instructions like "send me an email at this address, and also call my secretary and have her put it in my calendar. [from stackoverflow

Monday, April 8, 2013

git - patch

1. Download the patch from gerrit.
$ git fetch http://review.whamcloud.com/p/fs/lustre-release refs/changes/22/3522/4 && git format-patch -1 --stdout FETCH_HEAD > LU-1488.patch
 
2. Checkout the right git repo with correct 'tag'
$ git checkout -b clstr-1136 v1_8_8_WC

 
3. git branch
$ git branch
* clstr-1136
 master

4. apply patch
4.1 git apply -stat
$ git apply --stat LU-1488.patch
lustre/mdc/mdc_fid.c |   10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
 
4.2 git apply --check
$git apply --check LU-1488.patch
$
4.3 git apply
$ git apply LU-1488.patch
 
5. Use 'git cherry-pic' instead
5.1 $ git log v1_8_9_WC1 --oneline --all | grep LU-1488
944d1c1 LU-1488 mdc: fix fid_res_name_eq() issue.
 
5.2 $ git branch
* clstr-1136
master
 
5.3 $ git cherry-pick 944d1c1
 
 

Friday, April 5, 2013

Increasing the /boot size in RHEL63 Guest

[root@osh ~]# sudo fdisk -l /dev/sdb

Disk /dev/sdb: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x8f8fb048

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         261     2096451   83  Linux
[root@osh ~]#


[root@osh~]# mkfs.ext3 /dev/sdb1

[root@osh~]# mount -t ext3 /dev/sdb1 /boot1

[root@osh~]# cp -ar /boot/* /boot1/

Edit fstab to mount this /dev/sdb1 as /boot every time we boot.

grub> root (hd1,0)
root (hd1,0)
 Filesystem type is ext2fs, partition type 0x83
grub> setup (hd1)
setup (hd1)
 Checking if "/boot/grub/stage1" exists... no
 Checking if "/grub/stage1" exists... yes
 Checking if "/grub/stage2" exists... yes
 Checking if "/grub/e2fs_stage1_5" exists... yes
 Running "embed /grub/e2fs_stage1_5 (hd1)"...  26 sectors are embedded.
succeeded
 Running "install /grub/stage1 (hd1) (hd1)1+26 p (hd1,0)/grub/stage2 /grub/grub.conf"... succeeded
Done.
grub> quit 
quit
[root@osh ~]#grub-install --recheck /dev/sdb1

Probing devices to guess BIOS drives. This may take a long time.
Unknown partition table signature

Installation finished. No error reported.
This is the contents of the device map /boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.

(fd0)    /dev/fd0
(hd0)    /dev/sda
(hd1)    /dev/sdb
(hd2)    /dev/sdc
(hd3)    /dev/sdd
(hd4)    /dev/sde

[root@osh ~]# reboot


Monday, April 1, 2013

git

In short you use following the most,

git clone
git checkout --track -b
git add
git status
git diff
git commit

More here git basics git git-hg

About git-staging area
Index 1

Index 2