Tuesday, January 29, 2013

How to configure a disk heartbeat in HACMP


Configuring a disk heartbeat network in HACMP

Ensure that the disks to be used for disk heartbeating are assigned and configured to each
cluster node. Enter:

lspv -> ensure that a PVID is assigned to the disk on each cluster node

If a PVID is not assigned, run one of the following commands:

chdev -l hdisk# -a pv=yes
OR
chdev -l vpath# -a pv=yes (if SDD is installed)


1.Create an enhanced concurrent mode volume group on the disk or disks in question using
Smitty Enter:

smitty hacmp
Select:
        System Management (C-SPOC)
            HACMP Concurrent
               Logical Volume Management
                  Concurrent Volume Groups
                       Create a Concurrent Volume Group (with Datapath Devices, if applicable)

Press F7 to select each cluster node. Select the PVID of the disk to be added to the Volume
Group. Enter the Volume Group Name, Desired Physical Partition Size, and major number.
Enhanced Concurrent Mode should be set to True.


2. Create a diskhb network. Enter:

smitty hacmp
Select:
        Extended Configuration
          Extended Topology
            Configuration
               Configure HACMP Networks
                 Add a Network to the HACMP cluster
                    Choose diskhb. Enter the network name or accept the default.


3.Add each disk-node pair to the diskhb network. Enter:

smitty hacmp
Select:
      Extended Configuration
         Extended Topology
            Configuration
               Configure HACMP Communication
                   Interfaces/Devices
                     Add Communication Interfaces/Devices
                        Add Pre-Defined Communication Interfaces and Devices
                           Communication Devices

Choose your diskhb Network Name. For Devices Name, enter a unique name; For device
path, enter /dev/vpath# or /dev/hdisk#; For nodename, enter the node on which this device
resides.

Repeat step 4 for every node in the cluster.


4.Verifying communication across a disk heartbeat network

Run the following command on the first node to put it in Receive Mode:

/usr/sbin/rsct/bin/dhb_read -p hdisk# -r  (replace hdisk# with rvpath# if using SDD)

The following should be displayed:

  Receive Mode:
  Waiting for Response . . .


Run the following command on a different node to put it in Transmit Mode:

/usr/sbin/rsct/bin/dhb_read -p hdisk# -t   (replace hdisk# with rvpath# if using SDD)
If communication is successful, the following should be displayed:

  Link operating normally.



Tuesday, January 22, 2013

How to install openssl and openssh in AIX?

How to install openssl and openssh in AIX?

Here are the instructions to download and install openssh 5.0 

Please follow the steps below to remove current version of openssh and install the 5.0 version  ( make sure connected through telnet or on console): 

1. Make a copy current /etc/ssh directory 
# cp -r /etc/ssh /etc/ssh.backup 

2. Remove current version of openssh 
# installp -u openssh.* 

3. Remove all existing versions of openssl using smitty(installp as above)or even rpm 

# rpm -qa | grep -i ssl 
# rpm -e <openssl label> 


OR 

# installp -u openssl* 

4. Download latest version of openssl and openssh 

Please download and install latest OpenSSL 61ssl98m.tar.Z from: 

https://www14.software.ibm.com/webapp/iwm/web/preLogin.do?source=aixbp 

The latest OpenSSH openssh_5.4p1.tar.Z from: 
http://sourceforge.net/projects/openssh-aix/ 

5. Install openssl and openssh 
Both openssl and openssh are installp images. 

Use smitty to install openssl first and then openssh. 

Here are the detailed installation instructions: 

a) Inside the directory where the installp images reside, run 'inutoc' to create table of content file 
# inutoc . 

b) Use this fast path to access smitty install menu: 
# smitty install_selectable_all 

- Enter the directory where the files reside and hit Return key 
- At the next screen, you are prompted for "software to install" 
-- Hit F4 key to display a list of files to install 
-- Select all relevant files and hit Return key 
-- Change "accept new license agreement" from no to yes 
-- Continue with install 

After a successful installation of openssh, the sshd daemon will be active and you will have a working ssh server. 


Thursday, January 17, 2013

How to solve "reading symbolic information ...dbx: fatal error: Not enough space"

reading symbolic information ...dbx: fatal error: Not enough space


Sometimes, app people wants to execute the dbx, but they stuck up with the below error.

Error:

Type 'help' for help.
[using memory image in core]
 reading symbolic information ...dbx: fatal error: Not enough space

Eventhough we have enough spaces on the filesystems, the server throw the "dbx: fatal error: Not enough space"

Solution:

Changing the ulimit (data) value will fix this issue.

Please change the data value to unlimited on the user attribute. It will fix the issue.

chuser data=-1 siva

Note: please make sure we have enough paging space on our server.


Thursday, January 10, 2013

How to install and configure the telnet on rhel/linux?

How to install and configure the telnet on RHEL/Linux?


Steps:

* Install "telnet-server" using "yum install telnet-server"     (Install the telnet-server rpm)

* Edit the file "/etc/xinetd.d/telnet" & change "disable yes" to "disable no"   (Enable the telnet service)

* Execute /etc/init.d/xinetd restart [or] service xinetd restart  (port 23 will be open....)

* chkconfig telnet on   (we can use chkconfig for add xinetd to startup services.)

* telnet localhost 23     (Make sure you can telnet with your local host)


How to contact IBM for technical support


The main phone number to contact IBM technical support in North America is

                   1-800-IBM-SERV   (1-800-426-7378)

The 1-800-IBM-SERV phone number is the number to call for Pseries hardware and AIX operating system voice support if you've already purchased a contract for support.

The automated phone system will do some initial routing of your call to the proper entity based on your responses. Having a good idea of the nature of the problem will help you at this point. If you don't know if the problem is hardware or software related, choose "software." The IBM technical person that you speak to will do some additional problem determination and route you to a more specific support area if necessary.

The answers to this questionnaire can help AIX Pseries technical support better understand the problem. Please take the time to answer these questions before you contact IBM.

What is the serial number of the server?.
Command: # prtconf|grep -i "Machine Serial Number”

What is the model number of the Pseries hardware that the problem is happening on?  Command: # prtconf|grep -i "System Model"

What is the version and maintenance level of AIX on that hardware?
Command: #oslevel –s 



How to change the directories/files permission in unix?


How to change the directories/files permission in unix?

Using the "find" command we can change the permission of all the directories/files very easily.


For example, if we want to change the permission of all the directories and files under /opt/hddocs then follow the below commands,

To change all the directories under /opt/hddocs to 755:

    find /opt/hddocs -type d -exec chmod 755 {} \;

To change all the files to 644:

    find /opt/hddocs -type f -exec chmod 644 {} \;



Wednesday, January 9, 2013

How to recover a deleted file in aix?

How to recover a deleted file in aix?


It is possible to recover the file using the "fsdb" command (filesystem debugger). when,
No new files have been created on the filesystem.
No files have been extended.
The filesystem is able to be unmounted.

Warning: I have test this in my test server. This is undocumented one. You may facing the critical problem when you follow the below steps on your systems. So try this at your own risk. Please avoid directly try this with your production servers. Here is the output for your reference.


# lsvg -l testvg
testvg:
LV NAME             TYPE       LPs   PPs   PVs  LV STATE      MOUNT POINT
loglv00             jfs2log    1     1     1    closed/syncd  N/A
#
# crfs -a size=256M -v jfs2 -g testvg -m /new            à create a "/new" FS
File system created successfully.
261932 kilobytes total disk space.
New File System size is 524288
#
# lsvg -l testvg
testvg:
LV NAME             TYPE       LPs   PPs   PVs  LV STATE      MOUNT POINT
loglv00             jfs2log    1     1     1    closed/syncd  N/A
fslv00              jfs2       16    16    1    closed/syncd  /new
#
# mount /new         à mount the /new FS
#
# lsvg -l testvg
testvg:
LV NAME             TYPE       LPs   PPs   PVs  LV STATE      MOUNT POINT
loglv00             jfs2log    1     1     1    open/syncd    N/A
fslv00              jfs2       16    16    1    open/syncd    /new
#
# cd /new
#
# ls -l
total 0
drwxr-xr-x   2 root     system          256 Apr 03 16:47 lost+found
#
# cat >> film         à Create a file named “film”
Hi this is the test file. I want to use this file for recovery test
^C#
#
# cat film
Hi this is the test file. I want to use this file for recovery test
#
# ls –il        Ã  check the inode number of the file “film”. That is 4
total 8
    4 -rw-r--r--   1 root     system           68 Apr 03 16:49 film
    3 drwxr-xr-x   2 root     system          256 Apr 03 16:47 lost+found
#
#
# rm film     à remove the file “film”
#
# ls -l
total 0
drwxr-xr-x   2 root     system          256 Apr 03 16:47 lost+found
#
# cd ~
#
# umount /new     à unmount the /new FS
#
# lsvg -l testvg
testvg:
LV NAME             TYPE       LPs   PPs   PVs  LV STATE      MOUNT POINT
loglv00             jfs2log    1     1     1    closed/syncd  N/A
fslv00              jfs2       16    16    1    closed/syncd  /new
#
# fsdb /dev/fslv00       Ã  use the “fsdb <lv_name>” to recover the deleted  file.

File System:                    /dev/fslv00

File System Size:               523864  (512 byte blocks)
Aggregate Block Size:           4096
Allocation Group Size:          8192    (aggregate blocks)

> dir 2
 idotdot = 2

 3      lost+found
> 
> i 4     à provide the inode number of our deleted file. That is 4
Inode 4 at block 33, offset 0x800:

[1] di_fileset:         16                 [18] di_inostamp:       0x4d98ead4
[2] di_number:          4               [19] di_gen:            3940655789
[3] di_size:    0x0000000000000044      [20] di_ixpxd.len:      4
[4] di_nblocks: 0x0000000000000001      [21] di_ixpxd.addr1:    0x00
[5] di_nlink:           0               [22] di_ixpxd.addr2:    0x00000021
[6] di_mode:            0x000081a4           di_ixpxd.address:  33
                0100644 -rw-r--r--      [24] di_uid:            0
                                        [25] di_gid:            0
[9] di_atime.tj_nsec:   0x1e8a1025      [26] di_atime.tj_sec:0x000000004d98eb7d
[10] di_ctime.tj_nsec:  0x0ca85614      [27] di_ctime.tj_sec:0x000000004d98ebac
[11] di_mtime.tj_nsec:  0x1af63892      [28] di_mtime.tj_sec:0x000000004d98eb77
[12] di_otime.tj_nsec:  0x03b74a9a      [29] di_otime.tj_sec:0x000000004d98eb24
[13] di_ea.flag:        0x00            [30] di_ea.len:         0
     EAv1                               [31] di_ea.addr1:       0x00
[15] di_ea.nEntry:      0x00            [32] di_ea.addr2:       0x00000000
[16] di_ea.type:        0x0000               di_ea.address:     0
                                        [34] di_ea.nblocks:     0
change_inode: [m]odify, [e]a, [t]ree, or e[x]it > m     à choose “m” to modify
Please enter: field-number value > 5  1   à  put the field number is 5, change the di_nlink value to 1
Inode 4 at block 33, offset 0x800:

[1] di_fileset:         16              [18] di_inostamp:       0x4d98ead4
[2] di_number:          4               [19] di_gen:            3940655789
[3] di_size:    0x0000000000000044      [20] di_ixpxd.len:      4
[4] di_nblocks: 0x0000000000000001      [21] di_ixpxd.addr1:    0x00
[5] di_nlink:           1               [22] di_ixpxd.addr2:    0x00000021
[6] di_mode:            0x000081a4           di_ixpxd.address:  33
                0100644 -rw-r--r--      [24] di_uid:            0
                                        [25] di_gid:            0
[9] di_atime.tj_nsec:   0x1e8a1025      [26] di_atime.tj_sec:0x000000004d98eb7d
[10] di_ctime.tj_nsec:  0x0ca85614      [27] di_ctime.tj_sec:0x000000004d98ebac
[11] di_mtime.tj_nsec:  0x1af63892      [28] di_mtime.tj_sec:0x000000004d98eb77
[12] di_otime.tj_nsec:  0x03b74a9a      [29] di_otime.tj_sec:0x000000004d98eb24
[13] di_ea.flag:        0x00            [30] di_ea.len:         0
     EAv1                               [31] di_ea.addr1:       0x00
[15] di_ea.nEntry:      0x00            [32] di_ea.addr2:       0x00000000
[16] di_ea.type:        0x0000               di_ea.address:     0
                                        [34] di_ea.nblocks:     0
change_inode: [m]odify, [e]a, [t]ree, or e[x]it > x    à exit
> quit
#
# fsck -yp /dev/fslv00     Ã  run fsck to repaired the  inconsistencies.
The current volume is: /dev/fslv00
Primary superblock is valid.
J2_LOGREDO:log redo processing for /dev/fslv00
logredo start at: 1301867616 sec and end at 1301867616 sec
Primary superblock is valid.
*** Phase 1 - Initial inode scan
*** Phase 2 - Process remaining directories
*** Phase 3 - Process remaining files
*** Phase 4 - Check and repair inode allocation map
File system inode map is corrupt (FIXED)
Superblock marked dirty because repairs are about to be written.
*** Phase 5 - Check and repair block allocation map
Block allocation map is corrupt (FIXED)
Inodes not connected to the root directory
         tree have been detected.  Will reconnect.
File system is clean.
Superblock is marked dirty (FIXED)
All observed inconsistencies have been repaired.
#
# mount /new   à mount the /new FS
# lsvg -l testvg
testvg:
LV NAME             TYPE       LPs   PPs   PVs  LV STATE      MOUNT POINT
loglv00             jfs2log    1     1     1    open/syncd    N/A
fslv00              jfs2       16    16    1    open/syncd    /new
#
# cd /new  à goto the /new FS
#
# ls -l
total 0
drwxr-xr-x   2 root     system          256 Apr 03 16:47 lost+found
#
# cd lost+found   à go to lost+found dir
#
# pwd
/new/lost+found
#
# ls -l
total 8
-rw-r--r--   1 root     system           68 Apr 03 16:49 4     à you can see the deleted file in the name of your inode number
#
# cat 4   à confirm the file content
Hi this is the test file. I want to use this file for recovery test
#
# mv 4 /new/.      à move the file to the exact place where it was before
#
# pwd
/new/lost+found
# cd ..
#
# pwd
/new
# ls -l
total 8
-rw-r--r--   1 root     system           68 Apr 03 16:49 4
drwxr-xr-x   2 root     system          256 Apr 03 16:55 lost+found
#
# cat 4
Hi this is the test file. I want to use this file for recovery test
#
# mv 4 film  à change the name of the recovered file to the old one.
#
# ls -l
total 8
-rw-r--r--   1 root     system           68 Apr 03 16:49 film   à the deleted file has been recovered.
drwxr-xr-x   2 root     system          256 Apr 03 16:55 lost+found
#
#




How to mirror the rootvg in AIX?

How to mirror the rootvg in AIX?

This procedure is to assume the rootvg having hdisk0 and we need to take a mirror to hdisk1. 




1. Ground work:

lspv                                 --> find out the none disk on the server for the mirroring.
bootinfo -s hdisk1            --> check the size of the hdisk1 (It should be equal or bigger than hdisk0)


2. Mirror the rootvg

extendvg rootvg hdisk1             --> Extend hdisk1 into the rootvg (force to extend if it throws error "extendvg -f rootvg hdisk1")
mirrovg -S rootvg hdisk1           --> To initiate the mirror in background which help us to access the rootvg volume group
lsvg rootvg|grep -i stale      --> To check status of the sync process. (Execute the cmd again and again until the stale PPs becomes zero
lsvg -l rootvg                             --> Check and confirm the number of PPs is double than number of LPs.
bosboot -ad /dev/hdisk1            --> To create the boot images on hdisk1
bootlist -m normal hdisk0 hdisk1  -->  To add the hdisk1 on the bootlist.
bootlist -m normal -o           --> To confirm both hdisk0 and hdisk1 is part of the boot sequence.



3. Validation

lsvg -l rootvg                        --> Check and confirm the number of PPs is double than number of LPs.
lsvg rootvg|grep -i stale       --> To check the number of stale pp is Zero



4. Roll back

unmirrorvg rootvg hdisk1    --> To unmirror the hdisk1 in the mirroring.
reducevg rootvg hdisk1       --> To get the hdisk1 out of the rootvg
chpv -c hdisk1                         --> To Clear the boot image on the hdisk1
bootlist -m normal hdisk0    --> To remove hdisk1 on the boot sequence which means add the hdisk0 alone on the boot sequence.
bootlist -m normal -o           --> To confirm only hdisk0 is part of the boot sequence.



5. Downtime

NO downtime required for this mirror process.





if you happy with the above article, please leave your comments/reactions.


Wednesday, January 2, 2013

How to find out the parent device using script in AIX?

How to find out the parent device using script in AIX?

Using the below script we can find out the parent device (path of the device) of any device. Create the file  with the below script and provide the execute permission.


#!/usr/bin/ksh
f_lsdev ()
{
echo $1
lsdev -l $1 -F parent 2>/dev/null | read y
f_lsdev $y
}
set -e
f_lsdev $1 | xargs echo
#


touch lsdevpath
# vi lsdevpath   -----> (paste the above script on the file)
# chmod +x lsdevpath

Here we run the script to find out the path (parent device) of the hdisk3


./parent_device hdisk3
hdisk3   scsi2    sisscsia1    pci3    pci1    sysplanar0    sys0
t#

From the above output, we can find out the parent device (path of the device)of the hdisk3.

hdisk3 --parent_device--> scsi2 --parent_device-->sisscsia1--parent_device-->pci3 --parent_device-->psi1 --parent_device-->sysplanar0--parent_device-->sys0