Tuesday, August 29, 2017

Procedure for lupatch upgrade on Solaris

1) Copy the patch to any location, for instance /tmp/10_Recommended_CPU_2013-07

2) Stop the application

3) Edit passwd and group file to unhash entries

4) Create an alternate boot environment
     #lucreate -n zfs6BE

5) Verify the status
     #lustatus

6) Apply the patches to zfs6BE
    #luupgrade -n zfs6BE -t -s /tmp/10_Recommended_CPU_2013-07/patches/

7) Verify the BE status
     #lustatus

8) #ludelete <oldbename> //deletes oldbe and all zfs filesystem associated with it.
    #ludelete zfs3BE

9) Activate the new Boot environment
     #luactivate zfs6BE

10) Reboot
     #init 6

11) After booting , verify the patch version
      #uname -a
   

Wednesday, August 23, 2017

xhost:  unable to open display "localhost:0.0"


1) just run vncserver on root and oracle user.

# vncserver
New 'oracle.triples.com:1 (root)' desktop is oracle.triples.com:1
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/oracle.triples.com:1.log
[root@oracle sysconfig]#

2) Make sure 2 processes are running ( with :1 and :2). One is from root and other one is from oracle user.

# ps -ef | grep -i vnc
root      1607     1  0 Aug21 ?        00:00:00 Xvnc :1 -desktop oracle.triples.com:1 (root) -httpd /usr/share/vnc/classes -auth /root/.Xauthority -geometry 1024x768 -depth 16 -rfbwait 30000 -rfbauth /root/.vnc/passwd -rfbport 5901 -pn
root      1646     1  0 Aug21 ?        00:00:00 vncconfig -iconic
root      7528 20562  0 08:58 pts/3    00:00:00 grep -i vnc
oracle   28023     1  0 Aug22 ?        00:00:00 Xvnc :2 -desktop oracle.triples.com:2 (oracle) -httpd /usr/share/vnc/classes -auth /home/oracle/.Xauthority -geometry 1024x768 -depth 16 -rfbwait 30000 -rfbauth /home/oracle/.vnc/passwd -rfbport 5902 -pn
oracle   28044     1  0 Aug22 ?        00:00:00 vncconfig -iconic

3) check if vnc service is running

oracle# service vncserver status
Xvnc is running...

4) Download vncviewer and run in Jumphost machine.

5) connect to oracle machine (while connecting use oracle1:1) where :1 is the process that is started with root

6) Now make sure xhost + is running (this should be from vnc viewer)

oracle#xhost +
access control disabled, clients can connect from any host



Friday, August 18, 2017

Syslog configuration in RHEL 6

1.  Log in to the server by putty and switch to “root” user

2.  Check which syslog is running as daemon by
    #ps -ef |grep syslog

3.  Copy the original config file by
    #cp /etc/rsyslog.conf /etc/rsyslog.org

4.  Edit the rsyslog.conf and add the destination like the following rows depending on the region the system belongs.
#########This is the destination for forwarding syslog messages######
############ DATACENTER AND LOAD BALANCER#######
*.*     @10.130.X.X:514
############################################################

5.  Restart the rsyslog service by
    #service rsyslog restart

6.  Check the rsyslog has been restarted with new PID and test with sending an event to the syslog
    #ps –ef |grep syslog
    #logger –p user.err “ A test for check”
    #tail /var/log/messages to see if the above test has arrived

Veritas Volume Manager Commands and Examples


display disk listings:

        # vxdisk list


display volume manager object listings

        # vxprint -ht


display free space in a disk group    

        # vxdg -g <diskgroup> free


       
list all volume manager tasks currently running on the system  

        # vxtask list



add a disk to Volume Manager (devicename = cXtXdX) (prompt driven)
               
        # vxdiskadd <devicename>



designate/remove a disk as a hot-relocation spare

        # vxedit set spare=on <diskname>

        # vxedit set spare=off <diskname>



rename a disk

        # vxedit rename <old_diskname> <new_diskname>



reserve/unreserve a disk (space won't be allocated unless specifically mentioned in vxassist)

        # vxedit set reserve=on <diskname>

        # vxedit set reserve=off <diskname>



take a disk offline (first remove the disk from its disk group) (devicename=cXtXdXs2)

        #vxdisk offline <devicename>
       


remove a disk

        (first, stop any applications associated with the volume,
         unmount the volume, stop the volume,
         if you need the data on the disk, move the volumes to another disk or back up volume)

        --removing the disk from its disk group:

        # vxdg -g <diskgroup> rmdisk <diskname>


        --remove the disk from volume manager control  (devicename=cXtXdXs2)

        # vxdisk rm <devicename>



display multipath information

        # vxdisk list <diskname>



create a disk group

        (see 'add a disk to volume manager - if the group does not exist, you will be prompted)



upgrade a disk group

        --list disk group version
       
        # vxdg list <diskgroup>


        --upgrade disk group to highest version currently running

        # vxdg upgrade <diskgroup>



destroy a disk group

        # vxdg destroy <diskgroup>



display disk group information

        # vxdg list

        # vxdg list <diskgroup>



move a disk group

        (stop any applications associated with all volumes in the disk group,
         unmount and stop all volumes in the disk group:

        --deport (disable local access) the disk group to be moved on first system

        # vxdg deport <diskgroup>


        --import (enable local access) the disk group and its disks from the second system

        # vxdg import <diskgroup>


        --start all volumes in the disk group on the second system

        # vxrecover -g <diskgroup> -sb

    or  # vxvol -g <diskgroup> startall



estimating maximum volume size (any_valid_type = raid5, stripe, mirror)

        # vxassist -g <diskgroup> maxsize layout=<any_valid_type>



create a concatenated volume (length examples = 15g, 15m)

        # vxassist -g <diskgroup> make <volumename> <length> <diskname> <diskname>



create a striped volume (length examples = 15g, 15m)

        # vxassist -g <diskgroup> make <volumename> <length> layout=stripe <diskname> \
                      <diskname>



create a raid5 volume (without logging) (length examples = 15g, 15m)

        # vxassist -g <diskgroup> make <volumename> <length> layout=raid5,nolog <diskname> \
          <diskname> <diskname> <diskname>



create a raid5 volume (with logging) (length examples = 15g, 15m)

        # vxassist -g <diskgroup> make <volumename> <length> layout=raid5,log <diskname> \
          <diskname> <diskname> <diskname>



create a mirrored volume (without DRL) (length examples = 15g, 15m)

        # vxassist -g <diskgroup> make <volumename> <length> layout=mirror,nolog <diskname> \
                      <diskname>



create a mirrored volume (with DRL) (length examples = 15g, 15m)

        # vxassist -g <diskgroup> make <volumename> <length> layout=mirror,log <diskname> \
                      <diskname>



mirror an existing volume

        # vxassist mirror <volumename> <diskname_of_disk_to_be_mirrored>



mirror all volumes within a disk group

        # vxmirror -g <diskgroup> -a



mirror the root (boot) disk

        EEPROM variable "use-nvramrc?" must be set to true
       
        # vxrootmir -v <medianame>



remove a mirror (use 'vxprint -g <diskgroup> -ht' to get plexname)

       
        # vxplex -o rm dis <plexname>



add a log to an existing volume

        # vxassist addlog <volumename> <diskname>



remove a log from an existing volume

        # vxassist remove log <volumename>



create a raid 0+1 volume (without DRL)

        # vxassist -g <diskgroup> make <volumename> <length> layout=mirror-stripe,nolog \
          nmirror=# nstripe=# <diskname> <diskname> <diskname>



create a raid 1+0 volume (without DRL)

        # vxassist -g <diskgroup> make <volumename> <length> layout=stripe-mirror,nolog \
          nmirror=# nstripe=# <diskname> <diskname> <diskname>



resize a volume

        # vxassist -g <diskgroup> growto <volumename> <length>

        # vxassist -g <diskgroup> growby <volumename> <length>

        # vxassist -g <diskgroup> shrinkto <volumename> <length>

        # vxassist -g <diskgroup> shrinkby <volumename> <length>



estimate how much a volume can grow

        # vxassist -g <diskgroup> maxgrow <volumename>



remove a volume

        (stop all applications associated with the volume,
         unmount volume (remove /etc/vfstab entry))

        --stop volume

        # vxvol stop <volumename>

        -- remove volume  (for raid 1+0, use 'rf-rm')

        # vxedit -r rm <volumename>              

     or # vxassist remove volume <volumename>



change the volume read policy

        # vxvol rdpol <policy> <volumename>

        # vxvol rdpol prefer <volumename> <preferred_plex_name>



change volume attributes

        # vxedit set <field>=<value> <volumename>



resize a filesystem  (ufs cannot be shrunk, only grown)

        # vxresize -g <diskgroup> <volumename> + <size>
        # vxresize -g <diskgroup> <volumename> - <size>

       

join subdisks  (must be in the order of offset on disks)

        # vxsd join <subdisk> <subdisk> <subdisk>     
NFS Stale Error 

When your NFS server is restarted, it is common for existing clients to report a "Stale NFS file handle" when accessing shared resources. This is a server issue, not a client issue as one may assume.

To resolve this, there are 2 options:

1) Refresh the server (Recommended)

The server needs to have a new registry of connected clients in the local exports table. To achieve this, just run the following command:

exportfs -f
This is described in the manual page as:

In 'new' mode, flush everything out of the kernels export table.
Any clients that are active will get new entries added by mountd when they make their next request.

2) Remount the client mount

Remounting the share can be achieved as follows:

#mount -o remount /home
The client may not let you do this if there are processes using the share. You will see an error like this:

umount.nfs: /home: device is busy
If this is the case, use fuser to see what is using the share like this:

#fuser -fvm /home/
The response may be similar to this:

root@server# fuser -fvm /home/
 USER PID ACCESS COMMAND
 /home/: root kernel mount /home root 1884 ..c.. tail

Check and kill the process and mount accordingly.



Increase size of volume in VxVM

1) Shutdown the Database or application running on the Server.

2) Unmount the respective filesystem using umount command

3) /etc/vx/bin/vxresize -g AB06F_DG -F vxfs lvol2 15g

4) Mount the file system back. 
Ignite backup commands on HP-Ux


1) make_net_recovery -Av -s 192.168.0.15 int_entire=vg00

2) go to ignite server 192.168.0.15 /var/opt/ignite/recovery/archives

3) check the old&new sizes and if the variation is less, delete the old file.

4) can run 7 to 8 servers in a single time.

Thursday, August 17, 2017

rpm erase fails on Linux

# rpm -e maui-3.3-alt1.1.x86_64
/var/tmp/rpm-tmp.FJADIo: line 1: /usr/sbin/preun_service: No such file or directory
error: %preun(maui-3.3-alt1.1.x86_64) scriptlet failed, exit status 127
error: maui-3.3-alt1.1.x86_64: erase failed

Tried with yum also, doesn't work.

# yum remove maui-3.3-alt1.1.x86_64
Loaded plugins: fastestmirror, langpacks
Resolving Dependencies
--> Running transaction check
---> Package maui.x86_64 0:3.3-alt1.1 will be erased
--> Finished Dependency Resolution
base/7/x86_64                                            | 3.6 kB     00:00
extras/7/x86_64                                          | 3.4 kB     00:00
updates/7/x86_64                                         | 3.4 kB     00:00

Dependencies Resolved

================================================================================
 Package        Arch             Version              Repository           Size
================================================================================
Removing:
 maui           x86_64           3.3-alt1.1           installed           3.0 M

Transaction Summary
================================================================================
Remove  1 Package

Installed size: 3.0 M
Is this ok [y/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
** Found 3 pre-existing rpmdb problem(s), 'yum check' output follows:
ipa-client-4.4.0-14.el7.centos.7.x86_64 has installed conflicts freeipa-client: ipa-client-4.4.0-14.el7.centos.7.x86_64
ipa-client-common-4.4.0-14.el7.centos.7.noarch has installed conflicts freeipa-client-common: ipa-client-common-4.4.0-14.el7.centos.7.noarch
ipa-common-4.4.0-14.el7.centos.7.noarch has installed conflicts freeipa-common: ipa-common-4.4.0-14.el7.centos.7.noarch
/var/tmp/rpm-tmp.ocZcPk: line 1: /usr/sbin/preun_service: No such file or directory
error: %preun(maui-3.3-alt1.1.x86_64) scriptlet failed, exit status 127
Error in PREUN scriptlet in rpm package maui-3.3-alt1.1.x86_64
  Verifying  : maui-3.3-alt1.1.x86_64                                       1/1

Failed:
  maui.x86_64 0:3.3-alt1.1

Complete

# rpm -qa | grep -i maui
maui-3.3-alt1.1.x86_64

 
It works with below command

# rpm -e maui-3.3-alt1.1.x86_64 --noscripts
warning: /var/spool/maui/maui-private.cfg saved as /var/spool/maui/maui-private.cfg.rpmsave
# rpm -qa | grep -i maui
#

Tuesday, August 15, 2017

yppasswd: can't find the master ypserver: Internal NIS error - Cent OS 7

1)  When trying to change the password from the NIS client, it throws the below error :

# yppasswd drbalep
yppasswd: can't find the master ypserver: Internal NIS error

# cat /etc/yp.conf
# /etc/yp.conf - ypbind configuration file
# Valid entries are
#
# domain NISDOMAIN server HOSTNAME
#       Use server HOSTNAME for the domain NISDOMAIN.
#
# domain NISDOMAIN broadcast
#       Use  broadcast  on  the local net for domain NISDOMAIN
#
# domain NISDOMAIN slp
#       Query local SLP server for ypserver supporting NISDOMAIN
#
# ypserver HOSTNAME
#       Use server HOSTNAME for the  local  domain.  The
#       IP-address of server must be listed in /etc/hosts.
#
# broadcast
#       If no server for the default domain is specified or
#       none of them is rechable, try a broadcast call to
#       find a server.
#
#domain abc server jkty.triples.com
domain abc broadcast

2) Change the entries in /etc/yp.conf

# vi /etc/yp.conf

domain abc server jkty.triples.com
#domain abc broadcast

3) Start and enable the ypbind service.

# systemctl start ypbind
# systemctl enable ypbind

# yppasswd drbalep
Changing NIS account information for drbalep on jkty.
Please enter root password:
Changing NIS password for drbalep on jkty.
Please enter new password:
Please retype new password:

The NIS password has been changed on jkty.




Failed to start NIS/YP...Unit ypbind service ent..


1) when trying to restart the ypbind service or whenever you reboot the server you get the above error message, then follow the below steps.

2) check /etc/yp.conf file entries

# broadcast
#       If no server for the default domain is specified or
#       none of them is rechable, try a broadcast call to
#       find a server.
#
#domain abc server hundi.triples.com
#domain abc server jkty.triples.com
domain abc broadcast

3) Change the entries in /etc/yp.conf file as it is trying to broadcast the NIS servers that are available. So, it is waiting to respond and nothing got reply.

Just point to the definite server to respond immediately.

#domain abc server hundi.triples.com
domain abc server jkty.triples.com
#domain abc broadcast

4) Restart the service

# systemctl start ypbind
# systemctl enable ypbind

#ypwhich
jkty.triples.com







Monday, August 14, 2017

No such file or directory while accessing NFS shared directory -- Cent OS 7


1) When trying to access NFS shared directory which are already exported fine, you get no such file or directory then check the firewall is enabled or not. In my case firewall is enabled.

# sestatus
SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   enforcing
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Max kernel policy version:      28

]# cat /etc/sysconfig/selinux | grep -i selinux
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=enforcing -----
# SELINUXTYPE= can take one of three two values:
SELINUXTYPE=targeted

2) # cat /etc/sysconfig/selinux | grep -i selinux
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled ----

3) Now reboot the server

# reboot








Exportfs error on Cent OS 7


Error : No host name given with /home (rw, no_root_squash) , suggest * (rw, no_root_squash) to avoid warning

Make the correct entries in the exportfs file like below :

# cat /etc/exports
/home  triple.fso.com(rw,no_root_squash)

# exportfs -a   ( Export the entries to kernel)






How to add new user without user id and group id 


1) useradd -m <username>

    useradd -m raj

2) passwd <username>

    passwd raj

Sunday, August 13, 2017

Procedure for collecting getsysinfo in HP-Ux

    Running getsysinfo script
      a. FTP the file to machine in Binary format.
      b. #chmod 755 getsysinfo.sh
      c. #sh getsysinfo.linux.sh

    Send across the outputs (/tmp/sysinfo.zip)

Run the script: HPUX

1. From your email, save the attached file to your PC e.g. \ directory and extract it.
2. ftp getsysinfo.sh to the server, any directory e.g. /tmp.

   Steps to ftp getsysinfo.sh from PC to server,
   a. In Start-Programs, open MS-DOS prompt, cd \
   b. ftp hostname, or ftp IP_address, login as root.
   c. ftp> cd /tmp
   d. ftp> bin
   e. ftp> put getsysinfo.sh
   f. ftp> bye

3. in the server, # cd /tmp
4. # chmod 755 getsysinfo.sh
5. # sh ./getsysinfo.sh ( run this command )
6. Please e-mail the out put file..


Logical Volume Management in HP-Ux


1) Reducing LV

fsadm -d -D -e -E /triples
fsadm -F vxfs -b 76800M /triples
lvreduce -L 76800M /dev/AR/lvol8

2) Extending LV

fsadm -d -D -e -E /triples1
lvextend -L 174080M /dev/AR/lvol4
fsadm -F vxfs -b 174080M /triples1

3) Creating LV

#lvcreate -L 10240M /dev/vg00
Logical volume "/dev/vg00/lvol10" has been successfully created with
character device "/dev/vg00/rlvol10".
Logical volume "/dev/vg00/lvol10" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf

#newfs -F vxfs /dev/vg00/rlvol10
version 6 layout
10485760 sectors, 10485760 blocks of size 1024, log size 16384 blocks
largefiles supported

Thursday, August 10, 2017

yppasswdd not running on nis master host on centos 7

1) Make sure you have the correct DNS entries and hosts file entries

# yppasswd
yppasswd: yppasswdd not running on NIS master host

2) Include Master server and slave server details in /etc/hosts file.

# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
#::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
134.18.X.X  testclient.wing.com testclient
134.18.X.X  testslave.wing.com testslave
134.18.X.X  testmaster.wing.com  testmaster

3) Now it works

# yppasswd
Changing NIS account information for dumper on testserver.
Please enter old password:
Changing NIS password for dumper on testserver.
Please enter new password:






Wednesday, August 9, 2017

Changing the hostname on Centos 7
-------------------------------------------

1) To check the current hostname of the Server/VM

[root@dhana-testrhel7 ~]# hostname
dhana-testrhel7

[root@dhana-testrhel7 ~]# cat /etc/sysconfig/network
# Created by anaconda
HOSTNAME=cs-centos7vm-01.test.com
GATEWAY=192.168.10.1
[root@dhana-testrhel7 ~]#

[root@dhana-testrhel7 ~]# hostnamectl status
 Static hostname: dhana-testrhel7
 Icon name: computer-vm
 Chassis: vm
 Machine ID: f786930c19gd428fa8d40d328573bd67
 Boot ID: 0b0dfb1f19j54b44b90c2d94bb91c785
 Virtualization: vmware
 Operating System: Red Hat Enterprise Linux Server 7.3 (Maipo)
 CPE OS Name: cpe:/o:redhat:enterprise_linux:7.3:GA:server
 Kernel: Linux 3.10.0-514.el7.x86_64
 Architecture: x86-64
[root@dhana-testrhel7 ~]#

2) To change the hostname to cs-centos7vm-01

[root@dhana-testrhel7 ~]# hostnamectl set-hostname cs-centos7vm-01

[root@dhana-testrhel7 ~]# hostname
cs-centos7vm-01.test.com

[root@dhana-testrhel7 ~]# hostnamectl status
   Static hostname: cs-centos7vm-01.test.com
   Icon name: computer-vm
   Chassis: vm
   Machine ID: f786930c19gd428fa8d40d328573bd67
   Boot ID: 0b0dfb1f19j54b44b90c2d94bb91c785
   Virtualization: vmware
   Operating System: Red Hat Enterprise Linux Server 7.3 (Maipo)
   CPE OS Name: cpe:/o:redhat:enterprise_linux:7.3:GA:server
   Kernel: Linux 3.10.0-514.el7.x86_64
   Architecture: x86-64
[root@dhana-testrhel7 ~]#

3) Reboot the server to apply permanently.

[root@dhana-testrhel7 ~]# reboot

[root@cs-centos7vm-01 ~]# hostname
cs-centos7vm-01.test.com


Tuesday, August 1, 2017

How to make Veritas disk online 

1. Set the "remove" flag.

To be able to get the disks back in the disk-group, we need to be able to reinitialize them. To reinitialize the disks, disks have to be removed from the disk-group. To be able to remove disks with the failed flag on, the -k flag has to be used with the rmdisk command.

#vxdg -k -g rootdg rmdisk disk02

NOTE: "failed" flag will be replaced by "removed" flag.

2. Uninitialize the disk.

#cd /usr/lib/vxvm/bin
#./vxdiskunsetup -C c5t1d0

NOTE: Disk status changes from error state to offline state.


3. Initialize the disk.
#./vxdisksetup -I c5t1d0

NOTE: Disk status changes from offline status to online status.

4. "Add" the disk to the disk-group.

NOTE: To add the disks back in the disk-group, the adddisk command has to be used with the -k flag. With this command automatically the vxvm header information of the "failed" vxvm disks is updated with the existing disk-group information.

#vxdg -k -g rootdg adddisk disk02=c5t1d0

NOTE: The "removed" flag is set to off and as a result no more "removed was:" messages. The disks are also again part of there original disk-groups.


5. Re-synchronize the volumes.
#vxrecover -g rootdg -sb

Note:
-s start any disabled volumes
-b execute vxrecover in the background

6. Run vxtask list to check the progress.
Open SSL installation on IBM-AIX

1) Export the path of the compiler before installation.

# export PATH=/usr/vac/bin/:$PATH
# which xlc
/usr/vac/bin/xlc

# export cc=xlc

2) Configuring and compiling 

# ./config --prefix=/usr/local/ssl<version> --openssldir=/usr/local/ssl<version>
# make
# make install

3) To check the installed version of OpenSSL

# openssl -v