About Us

RSInfoMinds, a web based IT Training and Consultancy firm. It is established with high dreams in training people in IT Infrastructure Field. We provide Online and Class Room training in various fields of IT Infrastructure Management.

Join Us: http://www.facebook.com/RSInfoMinds
Mail Us: rsinfominds@gmail.com
Twitter: @RSInfoMinds

We are specialized in the below courses:

Redhat Linux Admin Redhat Linux Cluster
Redhat Virutualization IBM AIX Admin
IBM AIX Virtualization IBM AIX Cluster
HP Unix Admin HP Unix Cluster
HP Unix Virtualization Shell Scripting
Veritas Volume Manager Veritas Cluster
Oracle Core DBA VMWare


We provide training in such a way, So that you get in depth knowledge on the Courses you look for.

And we ensure you are very confident from each and every Techincal aspect that the IT Industry needs and expects from you.

We also conduct Workshops on the latest technology and the real time faculties sharing their work experiences to make you the best.

Monday 17 March 2014

VCS: Cluster Filesystem Extension

[root@node1 ~]# df -Th /oracle
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/vx/dsk/oracle/oracle_vol
              vxfs    500M  3.3M  466M   1% /oracle
[root@node1 ~]#


1) First we need to find if the /oracle is a clustered filesystem or not.


[root@node1 ~]# hares -display oracle_mnt -attribute MountPoint
#Resource    Attribute             System     Value
oracle_mnt   MountPoint            global     /oracle

[root@node1 ~]# hares -display  -attribute MountPoint
#Resource      Attribute             System     Value
oracle_mnt     MountPoint            global     /oracle
[root@node1 ~]#


So, /oracle belongs to the resource oracle_mnt.

2) Next we need to find the volume of the file system "/oracle", can also get it from df command.

[root@node1 ~]# hares -display  oracle_mnt -attribute BlockDevice MountPoint
#Resource    Attribute             System     Value
oracle_mnt   BlockDevice           global     /dev/vx/dsk/oracle/oracle_vol
oracle_mnt   MountPoint            global     /oracle
[root@node1 ~]#


3) Increased the volume by 100M.

[root@node1 ~]# vxassist -g oracle growby oracle_vol 100M


[root@node1 ~]# vxprint -g oracle
TY NAME         ASSOC        KSTATE   LENGTH   PLOFFS   STATE    TUTIL0  PUTIL0
dg oracle       oracle       -        -        -        -        -       -

dm disk_8       disk_8       -        2027264  -        -        -       -

v  oracle_vol   fsgen        ENABLED  1228800  -        ACTIVE   -       -
pl oracle_vol-01 oracle_vol  ENABLED  1228800  -        ACTIVE   -       -
sd disk_8-01    oracle_vol-01 ENABLED 1228800  0        -        -       -
[root@node1 ~]#

The size of the volume is 1228800.

[root@node1 ~]# /opt/VRTS/bin/fsadm -t vxfs -b 1228800 /oracle
UX:vxfs fsadm: INFO: V-3-25942: /dev/vx/rdsk/oracle/oracle_vol size increased from 1024000 sectors to 1228800 sectors
[root@node1 ~]# df -Th /oracle
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/vx/dsk/oracle/oracle_vol
              vxfs    600M  3.3M  560M   1% /oracle
[root@node1 ~]#


Sunday 16 March 2014

Adding a Resource to an existing Cluster

Now I am going to add a script as a resource to an existing cluster.

Sample Script:

[root@node1 oracle]# cat script.shout
Sat Mar 15 10:01:17 EDT 2014 on node1.cluster.com
[root@node1 oracle]# cat script.sh
#!/bin/ksh


while true
do
        echo "`date` on `hostname`"  >> ${0}out
        sleep 4
done
[root@node1 oracle]#

Creating a Process Resource:


[root@node1 oracle]# hares -add oracle_process Process oracle_sg
VCS NOTICE V-16-1-10242 Resource added. Enabled attribute must be set before agent monitors
[root@node1 ~]# hares -modify oracle_process Critical 1
[root@node1 ~]# hares -modify oracle_process UserName  root
[root@node1 ~]# hares -modify oracle_process PathName  /oracle/script.sh
[root@node1 ~]# hares -modify oracle_process Enabled 1
[root@node1 ~]# hares -link oracle_process oracle_ip

VCS Configruation: Part VI

Doing a Cluster Test:

[root@node1 /]# hastatus -sum

-- SYSTEM STATE
-- System               State                Frozen

A  node1                RUNNING              0
A  node2                RUNNING              0

-- GROUP STATE
-- Group           System               Probed     AutoDisabled    State

B  oracle_sg       node1                Y          N               ONLINE
B  oracle_sg       node2                Y          N               OFFLINE
[root@node1 /]# df -Th /oracle
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/vx/dsk/oracle/oracle_vol
              vxfs    500M  3.3M  466M   1% /oracle

[root@node1 /]# hagrp -switch oracle_sg -to node2


[root@node1 /]# hastatus -sum

-- SYSTEM STATE
-- System               State                Frozen

A  node1                RUNNING              0
A  node2                RUNNING              0

-- GROUP STATE
-- Group           System               Probed     AutoDisabled    State

B  oracle_sg       node1                Y          N               OFFLINE
B  oracle_sg       node2                Y          N               ONLINE
[root@node1 /]#

Thats it.



VCS Configruation: Part V

Once everything is done. On the Java Console You would see the message:



Now the last step is create a  link between the resource.

Disk Group is the parent of the volume.

Volume is the parent of the mount.

[root@node1 /]# hares -link oracle_vol oracle_dg
[root@node1 /]# hares -link oracle_mnt oracle_vol



VCS Configruation: Part IV


Creating a Resources:

Disk Group:

[root@node1 /]# hares -add oracle_dg DiskGroup oracle_sg

[root@node1 /]# hares -modify oracle_dg DiskGroup oracle
[root@node1 /]# hares -modify oracle_dg Enabled 1
[root@node1 /]# hares -online oracle_dg -sys node1
[root@node1 /]# hares -state
#Resource    Attribute             System     Value
oracle_dg    State                 node1      ONLINE
oracle_dg    State                 node2      OFFLINE
[root@node1 /]#


Volume Resource:

[root@node1 /]# hares -modify oracle_vol DiskGroup oracle
[root@node1 /]# hares -modify oracle_vol Volume oracle_vol
[root@node1 /]# hares -modify oracle_vol Enabled 1
[root@node1 /]# hares -online oracle_vol -sys node1
[root@node1 /]# hares -state oracle_vol
#Resource    Attribute             System     Value
oracle_vol   State                 node1      ONLINE
oracle_vol   State                 node2      OFFLINE
[root@node1 /]#

Mount Point:

[root@node1 /]# hares -add oracle_mnt Mount oracle_sg
[root@node1 /]# hares -modify oracle_mnt Enabled 1
[root@node1 /]# hares -modify oracle_mnt FsckOpt %-y
[root@node1 /]# hares -modify oracle_mnt BlockDevice /dev/vx/dsk/oracle/oracle_vol
[root@node1 /]# hares -modify oracle_mnt FSType vxfs
[root@node1 /]# hares -modify oracle_mnt MountPoint /oracle
[root@node1 /]# hares -modify oracle_mnt Critical 1
[root@node1 /]# hares -online oracle_mnt -sys node1
[root@node1 /]# hares -state oracle_mnt
#Resource    Attribute             System     Value
oracle_mnt   State                 node1      ONLINE
oracle_mnt   State                 node2      OFFLINE
[root@node1 /]#


VCS Configruation: Part III

Creating the cluster resource.

Since we are going to create a HA LVM:

Disk Group: oracle

Volume: oracle_vol

Mount Point: /oracle

1) We are going to create a Service Group: oracle_sg

[root@node1 /]# hagrp -add oracle_sg
VCS NOTICE V-16-1-10136 Group added; populating SystemList and setting the Parallel attribute recommended before adding resources
[root@node1 /]# hagrp -modify oracle_sg SystemList node1 0 node2 1
[root@node1 /]# hagrp -list
oracle_sg               node1
oracle_sg               node2
[root@node1 /]#

[root@node1 /]# hagrp -list
oracle_sg               node1
oracle_sg               node2
[root@node1 /]#


[root@node1 /]# hagrp -state
#Group       Attribute             System     Value
oracle_sg    State                 node1      |OFFLINE|
oracle_sg    State                 node2      |OFFLINE|
[root@node1 /]#



VCS Configruation: Part II

Export and Import the disk group on the alternate node:

[root@node1 /]# umount /oracle
[root@node1 /]# vxdg list
NAME         STATE           ID
oracle       enabled,cds          1394886552.14.node1.cluster.com
[root@node1 /]# vxdg deport oracle
[root@node1 /]# vxdg list
NAME         STATE           ID
[root@node1 /]#


[root@node2 ~]# vxdg -t import oracle
[root@node2 ~]# vxdg list
NAME         STATE           ID
oracle       enabled,cds          1394886552.14.node1.cluster.com
[root@node2 ~]# vxprint -g oracle
TY NAME         ASSOC        KSTATE   LENGTH   PLOFFS   STATE    TUTIL0  PUTIL0
dg oracle       oracle       -        -        -        -        -       -

dm disk_8       disk_8       -        2027264  -        -        -       -

v  oracle_vol   fsgen        ENABLED  1024000  -        ACTIVE   -       -
pl oracle_vol-01 oracle_vol  ENABLED  1024000  -        ACTIVE   -       -
sd disk_8-01    oracle_vol-01 ENABLED 1024000  0        -        -       -
[root@node2 ~]#


Mounting on alternate node:


[root@node2 ~]# mount -t vxfs /dev/vx/dsk/oracle/oracle_vol /oracle
[root@node2 ~]# df -Th /oracle
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/vx/dsk/oracle/oracle_vol
              vxfs    500M  3.3M  466M   1% /oracle
[root@node2 ~]#


VCS Configruation: Part I

The below post will show how to create a Cluster HA filesystem resource:

[root@node1 /]# vxdisk -e list
DEVICE       TYPE           DISK        GROUP        STATUS               OS_NATIVE_NAME   ATTR
disk_8       auto:cdsdisk   -            -           online               sdc              -
sda          auto:none      -            -           online invalid       sda              -
sdb          auto:LVM       -            -           LVM                  sdb              -
[root@node1 /]#

[root@node2 ~]# vxdisk -e list
DEVICE       TYPE           DISK        GROUP        STATUS               OS_NATIVE_NAME   ATTR
disk_8       auto:cdsdisk   -            -           online               sdb              -
sda          auto:none      -            -           online invalid       sda              -
[root@node2 ~]#


Creating a disk group:

[root@node1 /]# vxdg init oracle disk_8
[root@node1 /]# vxdg list
NAME         STATE           ID
oracle       enabled,cds          1394886552.14.node1.cluster.com
[root@node1 /]#

Creating a volume:

[root@node1 /]# vxassist -g oracle make oracle_vol 500M
[root@node1 /]# vxprint -g oracle
TY NAME         ASSOC        KSTATE   LENGTH   PLOFFS   STATE    TUTIL0  PUTIL0
dg oracle       oracle       -        -        -        -        -       -

dm disk_8       disk_8       -        2027264  -        -        -       -

v  oracle_vol   fsgen        ENABLED  1024000  -        ACTIVE   -       -
pl oracle_vol-01 oracle_vol  ENABLED  1024000  -        ACTIVE   -       -
sd disk_8-01    oracle_vol-01 ENABLED 1024000  0        -        -       -
[root@node1 /]#

Formating and Mount the filesystem:

[root@node1 /]# mount -t vxfs /dev/vx/dsk/oracle/oracle_vol /oracle
[root@node1 /]# df -Th /oracle
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/vx/dsk/oracle/oracle_vol
              vxfs    500M  3.3M  466M   1% /oracle
[root@node1 /]#




Thursday 6 March 2014

/usr/sbin/alt_rootvg_op[1246]: v1 > v2 : 0403-009 The specified number is not valid for this command = PART 2

With the debug mode, I could see the issue with the blv set on the disk:

# /usr/lpp/bosinst/blvset -d /dev/hdisk1 -g level
5.3

# /usr/lpp/bosinst/blvset -d /dev/hdisk0 -g level
 
BLV for hdisk1 is 5.3 but for hdisk0 is empty.

Thats the reason for the failure.

 ((  v1 > v2  ))

/usr/sbin/alt_rootvg_op[1246]:  v1 > v2 : 0403-009 The specified number is not valid for this command.

Hence I change the BLV using the same command to fix the issue.

 # /usr/lpp/bosinst/blvset -d /dev/hdisk0 -p levlel
5.3

# /usr/lpp/bosinst/blvset -d /dev/hdisk0 -g level
5.3

# alt- _rootg vg_op -W-    -d hdisk0
Waking up altinst_rootvg volume group ...
#

# df
Filesystem    512-blocks      Free %Used    Iused %Iused Mounted on
/dev/hd4         2162688   1998512    8%     1682     1% /
/dev/hd2        19070976   8906760   54%    25659     2% /usr
/dev/hd9var      2162688   2071424    5%      406     1% /var
/dev/hd3         2097152   2026448    4%      104     1% /tmp
/dev/hd1         1114112   1078472    4%       57     1% /home
/proc                  -         -    -         -     -  /proc
/dev/hd10opt     1179648   1067728   10%      713     1% /opt
/dev/alt_hd4     2162688   1998520    8%     1664     1% /alt_inst
/dev/alt_hd1     1114112   1078472    4%       57     1% /alt_inst/home
/dev/alt_hd10opt    1179648   1067728   10%      713     1% /alt_inst/opt
/dev/alt_hd3     2097152   2026360    4%       98     1% /alt_inst/tmp
/dev/alt_hd2    19070976   8906760   54%    25659     2% /alt_inst/usr
/dev/alt_hd9var    2162688   2071568    5%      406     1% /alt_inst/var

/usr/sbin/alt_rootvg_op[1246]: v1 > v2 : 0403-009 The specified number is not valid for this command = PART 1

# at lt_rootg vg_op -W -d hdisk0
Waking up altinst_rootvg volume group ...
/usr/sbin/alt_rootvg_op[1246]:  v1 > v2 : 0403-009 The specified number is not valid for this command.
#

# lspv 
hdisk0          00046474e2326aa4                    altinst_rootvg  
hdisk1          000b026db61a3de7                    rootvg          active

The cloning has completed fine:

Changing logical volume names in volume group descriptor area.
Fixing LV control blocks...
Fixing file system superblocks...
Bootlist is set to the boot disk: hdisk0

But still not able to wake up the altinst_rootvg.

Wake the alt inst in debug mode:

#  alt_rootvg_op -W -d hdisk0 -D
+ typeset +f
+ typeset -ft FAIL
+ typeset -ft abspath
+ typeset -ft adjust_idata_fs_size


BOOT_DISK=hdisk1
+ + /usr/lpp/bosinst/blvset -d /dev/hdisk1 -g level
BOOT_OS=5.3
+ + /usr/lpp/bosinst/blvset -d /dev/hdisk0 -g level
ALT_BOOT_OS=   
+ is_level_greater 5.3
+ [[ 5.3 =  ]]
+ echo 5.3
+ read v1 r1 leftover1
+ /usr/bin/tr .  
+ echo
+ read v2 r2 leftover2
+ /usr/bin/tr .  
+ ((  v1 > v2  ))
/usr/sbin/alt_rootvg_op[1246]:  v1 > v2 : 0403-009 The specified number is not valid for this command.

CONTINUED.............


How To Do OS Cloning on AIX In Debug Mode

The hardware cloning in AIX is done using  # alt_disk_copy or # alt_disk_install command.

You can use the flag : -D to enable the debug mode.


Sunday 2 March 2014

Linux: Command Belongs To Which RPM

If you want to install a Command and not sure which package it belongs to. Here are the steps:

[root@vm1 /]# nslookup vm1
-bash: nslookup: command not found

I am trying to use "nslookup" but it does not exist on the server.

But I have CD mounted with repository configured.

Now find out which RPM has the command.

root@vm1 /]# yum whatprMatched from:
Filename    : /usr/share/zsh/4.3.10/functions/nslookup



32:bind-utils-9.8.2-0.7.rc1.el6.x86_64 : Utilities for querying DNS name servers
Repo        : cluster
Matched from:
Filename    : /usr/bin/nslookup



32:bind-utils-9.8.2-0.7.rc1.el6.x86_64 : Utilities for querying DNS name servers
Repo        : server
Matched from:
Filename    : /usr/bin/nslookup



zsh-4.3.10-5.el6.x86_64 : A powerful interactive shell
Repo        : server
Matched from:
Filename    : /usr/share/zsh/4.3.10/functions/nslookup

So, You can install any of the above RPM to get the Command. :)

Linux: Show the number of CPU cores and sockets on your system

dmidecode -t 4 |grep Thread # number or cpu listed as well by cat /proc/cpuinfo

dmidecode -t 4 |grep CPU # number of physical CPU

Appending groups to a user

For example, if testuser is a member of  group1 and group2, and you need to add the user to group3, the command would be:

usermod -G group1,group2,group3 testuser

If you mistakenly ran:

usermod -G group3 testuser

Then testuser would be removed from group1 and group2 and only be a member of group3.