Wednesday, May 15, 2013

Logical Volume Creation in HP-Unix 11iv3


1.Create Physical volume :

# pvcreate /dev/rdisk/disk38
Physical volume "/dev/rdisk/disk38" has been successfully created.





2.Create Volume Group :
# vgcreate -s 8 /dev/vg01 /dev/disk/disk38
Volume group "/dev/vg01" has been successfully created.
Volume Group configuration for /dev/vg01 has been saved in /etc/lvmconf/vg01.conf

Create LV:
# lvcreate -L 400m -n lv_001 /dev/vg01
Logical volume "/dev/vg01/lv_001" has been successfully created with
character device "/dev/vg01/rlv_001".
Logical volume "/dev/vg01/lv_001" has been successfully extended.
Volume Group configuration for /dev/vg01 has been saved in /etc/lvmconf/vg01.conf

# newfs -F vxfs /dev/vg01/rlv_001
    version 7 layout
    409600 sectors, 409600 blocks of size 1024, log size 1024 blocks
    largefiles supported

#mount /dev/vg01/lv_001 /data

Add the entries in /etc/fstab file for permanent mount.

Saturday, May 11, 2013

How to change default HTTP port in jboss7

1.Open standalone.xml file
vim $jboss_home/standalone/configuration/standalone.xml

2.Change http port value here marked in yellow color.

 <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
        <socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9999}"/>
        <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>
        <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9443}"/>
        <socket-binding name="ajp" port="8009"/>
        <socket-binding name="http" port="8080"/>
        <socket-binding name="https" port="8443"/>
        <socket-binding name="osgi-http" interface="management" port="8090"/>
        <socket-binding name="remoting" port="4447"/>
        <socket-binding name="txn-recovery-environment" port="4712"/>
        <socket-binding name="txn-status-manager" port="4713"/>
        <outbound-socket-binding name="mail-smtp">
            <remote-destination host="localhost" port="25"/>
        </outbound-socket-binding>
    </socket-binding-group>

Sunday, April 7, 2013

How to check Netbackup 7 server connectivity from linux client

bptestbpcd command used to test the connectivity between master netbackup server and all client server.



From the linux client :

cd to /usr/openv/netbackup/bin. Run the  utility three times from the client: once (with the -pn arguement) to see if the client can get a response from the master server via the name specified in the client's bp.conf file; once (with the -hn arguement) to see if the client can resolve the host name of the master server; and once (with the -ip arguement) to validate the association of the ip address obtained from the output of bpclient -hn, with the hostname used on the input command line to bpclient -hn



1)# ./bpclntcmd -pn
expecting response from server trout
pike pike 166.98.48.33 34455

Note: If, for example, the master server's name is entered incorrectly in the client's bp.conf file, this run of bpclntcmd will produce no output and simply retrun to the command line prompt

2)# ./bpclntcmd -hn trout
host trout: trout at 166.98.48.63 (0xa662303f)
checkhname: aliases:

3)# ./bpclntcmd -ip 166.98.48.63
checkhaddr: host   : trout: trout at 166.98.48.63 (0xa662303f)
checkhaddr: aliases:


Thanks!!!

Thursday, March 28, 2013

STATUS CODE 48: A Status 48 "Client hostname could not be found" message occurs during backup.

Problem:

STATUS CODE 48: A Status 48 "Client hostname could not be found" message occurs during backup.

 

Solution:

1. Ensure that all servers and clients are added to name service tables or local hosts file

2. Verify that name resolution is valid (hostnames are case-sensitive depending on the OS used). Try to "ping" the client from the server where this error occurs. Use the hostname for the client, as specified in the NetBackup Policy for the failing backup.

OR



1. Add host name/IP entries for the Master Server, Media Server and Client in their respective /etc/hosts files.
   Location of host file:

   UNIX:   /etc/hosts

   Windows:  %SystemRoot%\system32\drivers\etc\hosts

Ensure that all hosts involved have host entries for both themselves and one another.

                                       ************************
Thanks,
Big B

 

 

Wednesday, March 13, 2013

Mysql ERROR 1418

If get the error like above simply follow the below step to resolve it.

MySQL Error 1418
ERROR 1418 (HY000) at line 5: This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)

Type below command in your mysql command prompt:

# mysql -u root -p
 
MySQL> SET GLOBAL log_bin_trust_function_creators = ON;
OR
MySQL> # SET GLOBAL log_bin_trust_function_creators = 1;
 
******************** 

Friday, January 4, 2013

Lvm creation in Redhat 6.3

Here we are going to create lvm for /dev/sdb (newly assigned partition)

# fdisk  /dev/sdb
Create physical partition as /dev/sdb1 from /dev/sdb/
Create Physical voilume:
# pvcreate /dev/sdb1
Create volume group and add the pv to VG :
# vgcreate /dev/mapper/vg_rsatest_disk2 /dev/sdb1
To display volume group information:
# vgdisplay
Create lvm using PE value :
# lvcreate -l 2434 /dev/mapper/vg_rsatest_disk2
Formatted the newly created lvm:
#mkfs.ext4 /dev/mapper/vg_rsatest_disk2-lvol0
Create new directory to mount lvm:
#mkdir -p  /data
Add the below line into /etc/fstab/
/dev/mapper/vg_rsatest_disk2-lvol0 /data         ext4    defaults        0 0
"lvol0"

Thursday, January 3, 2013

Tomcat 7 installation in Redhat 6.3

* Download tomcat 7 from http://tomcat.apache.org/download-60.cgi

* Downlo0ad latest jdk from http://www.oracle.com/technetwork/java/javase/downloads/index.html

* Install jdk in /usr/local/jdk/

* Unzip downloaded apache tomcat in /usr/local/apache-tomcat-7.0.34
                  #unzip apache-tomcat-7.0.34.zip

* Set java home path :
                   # JAVA_HOME=/usr/local/jdk1.7.0_07

* Set Tomcat home path :
                  # CATALINA_HOME=/usr/local/apache-tomcat-7.0.34
                  # BASEDIR=/usr/local/apache-tomcat-7.0.34

* Go  to directory /usr/local/apache-tomcat-7.0.34/bin/

* Edit Catalina.sh and add the java path in the first line.
       #vim catalina.sh
         JAVA_HOME=/usr/local/jdk1.7.0_07 (Add it in the top of the Catalina.sh script).

* Provide the executive permission to all script file under in bin directory.
           # chmod  +x  startup.sh
            #chmod  +x   Catalina.sh

* Start the tomcat :
          #./startup.sh
* Check the Tomact from Browser:
http://10.0.0.0:8080   you will get the tomcat home page..



Tuesday, December 18, 2012

Soft link creation in linux

We are going to create soft link for test folder in new directory under disk2

#cd /root/test
#mv -v test /disk2/
#ln -s /cvs2/test/  test

Rsync command

From local system to remote system:

# rsync -avzpe ssh modules/ root@10.10.2.42:/usr/local/jboss-as/modules/



--delete : delete files that don't exist on sender (system)
-v : Verbose (try -vv for more detailed information) 
-e "ssh options" : specify the ssh as remote shell 
-a : archive mode 
-r : recurse into directories 
-z : compress file data


                          ****************************************


Saturday, December 15, 2012

Errcode: 28 in Mysql in linux

Error :

[root@ghrmsdb dbbackup]# mysql -p DBNAME < DBNAME_14122012-0700.sql
Enter password:
ERROR 3 (HY000) at line 33: Error writing file './GHRMS/B2B_Exception_Dtls.frm'



Answer :

If you get error like this, you need to check all filesystems where MySQL installed..  
It will happen only if no space left on hard disk...


    ************************************************************************8

Friday, December 14, 2012

Jboss 7 Installation on RHEL 6.3

Check the server hostname correctly assigned:

# vim /etc/hosts
# vim /etc/sysconfig/network

Check http service running or not:

#/etc/init.d/httpd status.
It should running....

Create jboss user :

#useradd jboss

Download latest  jdk 7 to /user/local and install it:

# rpm -ivh jdk-7u7-linux-x64.rpm
 
To check java installed or not:
# java --version  

Set java variable path:

#JAVA_HOME=/usr/java/latest
#export JAVA_HOME
#PATH=$JAVA_HOME/bin:$PATH:$HOME/bin


Also add the above 3 lines  in vim /etc/bash_profile save and close it.

Download jboss7 to /usr/local/ and unzip it.

#unzip jboss-as-7.1.1.Final.zip  (It will unzip as jboss-as-7.1.1 )
#mv jboss-as-7.1.1 jboss-as

Assign the owner permission to jboss for /usr/local/jboss-as directory.
 
#chown -R jboss:jboss /usr/local/jboss-as


To create service user /etc/init.d do as follow:

#cp /usr/local/jboss-as/bin/init.d/jboss-as-standalone.sh /etc/init.d/jboss
#mkdir /etc/jboss-as
#cp /usr/local/jboss-as/bin/init.d/jboss-as.conf /etc/jboss-as/

#chmod 755 /etc/ini.d/jboss

Edit and add the below entries in /etc/init.d/jboss:

#vim /etc/init.d/jboss

# chkconfig: - 234 80 20  to run jboss in 234 run level
 

# Set defaults.

JBOSS_USER=jboss
export JBOSS_USER

if [ -z "$JBOSS_HOME" ]; then
  JBOSS_HOME=/usr/local/jboss-as

Save and close text editor...


To access jboss console through browser from remote system:

change 0.0.0.0 instead of 127.0.0.0. only in the below lines.

# vim /usr/local/jboss-as/standalone/configuration/standalone.xml 

 <interface name="management">
            <inet-address value="${jboss.bind.address.management:0.0.0.0}"/>
        </interface>
        <interface name="public">
            <inet-address value="${jboss.bind.address:0.0.0.0}"/>



save and close text editor.

#chkconfig --add jboss
#chkconfig jboss on

Now we can start the jboss as system service:

#/etc/init.d/jboss start

and 

We can access it through browser.
10.0.0.1:8080




     *************************************************************

To add jboss mnagement user:

Go to /usr/local/jboss-as/bin/
#./add-user.sh
You should see the following message on the console after executing the command:
What type of user do you wish to add?
a) Management User (mgmt-users.properties)
b) Application User (application-users.properties)
(a): a
We select “a”, next you should see the following message:
Enter the details of the new user to add.
Realm (ManagementRealm) :
Username : jboss
Password :
Re-enter Password :
* hit enter for Realm to use default, then provide a username and password
We select the default value for the Realm (ManagementRealm), by hitting enter, and select “jboss” as our username and password.


 

 




Thursday, October 25, 2012

Acl in linux



1.To set acl for a folder :

# setfacl -m u:username:rwx foldername

2.To set acl for solder and their sub folder.

.#setfacl -R -m u:username:rwx foldername 

3.To view acl for a folder :
#getfacl foldername

4.To remove acl for a folder :
setfacl -b u:username:rwx foldername

 
 
 

Tuesday, October 23, 2012

How to import store proceedure in mysql

To fix this.

Export store procedure from existing database with below command;

#mysqldump -p --no-create-db --no-create-info --no-data --routines DBNAME > DBNAME_23Oct2012.sql
 
And imoprt .sql file to running db.
 
#mysql -u root -p DBNAME < DBNAME_23Oct2012.sql  
 
 
Restart Mysql DB
 
To check Store procedure in Mysql
 
#Login into mysql DB and type the below command
 
SHOW PROCEDURE STATUS;
SHOW FUNCTION STATUS;
 
Thats it!!!!

Thursday, October 18, 2012

Starting MySQL.Manager of pid-file quit without updating fi[FAILED]

Am getting below eror on of my mysql server while starting mysql service"Starting MySQL.Manager of pid-file quit without updating fi[FAILED] "


 To resolve this issue i tried the below
# ps -ef | grep -i mysql
kill the all running process 

Try to start mysql
#services mysqld start

It worked for me..



Wednesday, October 10, 2012

How to import and Export Mysql db

To export mysqlDB:


1.Type the below command to export mysql db:

# mysqldump -u root -p dbname> dbname11092012.sql

To import mysql DB:

1.Go to file location where you saved  backup db and type following command.

 2.login into mysql and create new database.

> create databases newdb

3.exit from sql and type as following

# mysql -u root -p  newdb < db_04102012-0700.sql

[where newdb is newly created db and db_04102012-0700.sql is going to restore newly created db.]

Friday, October 5, 2012

How to Allow MySQL Client to Connect to Remote MySQL server

If you try to connect to a remote MySQL database from your client system, you will get “ERROR 1130: Host is not allowed to connect to this MySQL server” message as shown below.

# mysql -h 10.10.28.8 -u root -p
Enter password:
ERROR 1130: Host '10.10.28.8' is not allowed to connect to this MySQL server


1.Try to telnet server from client machie

# telnet 192.168.1.8 3306
host 10.10.28.8 is not allowed to connect to this mysql server



 2.To allow a specific client ip-address (10.10.28.8) to access the mysql database running on a server,

# mysql -u root -p
Enter password:

mysql> use mysql

mysql> GRANT ALL ON *.* to root@'10.10.28.8' IDENTIFIED BY '$dfg!23'; 

mysql> FLUSH PRIVILEGES;
 

That's it.....It should work!!!!


  

To resolve!! Starting jboss-as: chown: missing operand after `/var/run/jboss-as' Try `chown --help' for more information.in Jboss 7

While starting Jboss service i am getting following error meesage in jboss7.

 "Starting jboss-as: chown: missing operand after `/var/run/jboss-as'Try `chown --help' for more information."


To over come this ,

#vim /usr/local/jboss-as/standalone/configuration/standalone.xml

 and add the below line into standalone.xml file

# Set defaults.
JBOSS_USER=jboss
export JBOSS_USER









Now we can start the jboss server as usual without any error message.
#/etc/init.d/jboss start

Enjoy!!!!...


Wednesday, September 26, 2012

Enabling php-imap module in php(Cent OS)

1.Install php-imap with following command.

#yum --enablerepo=webtatic install php54w-imap* 


2.Restart HTTP service
#. service httpd restart 

3.Check imap module install in php
# php -i | grep -i imap

Friday, August 17, 2012

How to determine given OS in 32 bit or 64 bit in Linux

Type the following simple command in your linux boxes:

# uname-m

If it 32 bit os the output would  be  follow:

i686   ==> 32-bit kernel
 

If it 64 bit os the output would be follow:

 
x86_64 ==> 64-bit kernel
 
Or
 
 can use following command to check the OS versions:
 
# uname -a
 
# getconf LONG_BIT
 
# cat /proc/cpuinfo

Wednesday, August 8, 2012

How to fix Could not complete SSL handshake error.in rhel5

In this case, you need to check on the /etc/xinetd.d/nrpe as following.

# default: on
# description: NRPE (Nagios Remote Plugin Executor)
service nrpe
{
        flags           = REUSE
        socket_type     = stream   
 port  = 5666   
        wait            = no
        user            = nagios
 group  = nagios
        server          = /usr/local/nagios/bin/nrpe
        server_args     = -c /usr/local/nagios/etc/nrpe.cfg --inetd
        log_on_failure  += USERID
        disable               = no
 only_from                = 10.1.2.2
}


You need to make sure the only_from ip is the IP for nagios monitoring server.
If the only_from IP is not correct, rectify it and then restart xinetd.d by using the following command.
[admin@remotehost ~]$ sudo /etc/init.d/xinetd restart
Stopping xinetd:                                           [  OK  ]
Starting xinetd:                                           [  OK  ]

If the nrpe setting is already correct, then you need to check in /var/log/messages in the remote host. You might see the following error.
Jul 29 13:36:56 remotehost xinetd[7336]: FAIL: nrpe address from=10.1.2.2
Jul 29 13:36:56 remotehost xinetd[6595]: START: nrpe pid=7336 from=10.1.2.2
Jul 29 13:36:56 remotehost xinetd[6595]: EXIT: nrpe status=0 pid=7336 duration=0(sec)

Try to restart xinetd daemon using the command above and then check on /var/log/messages again. If you see the following error, it might mean that xinetd had problem to start up nrpe becuase of its bug to release the address.
Jul 29 13:35:54 remotehost xinetd[6595]: bind failed (Address already in use (errno = 98)). service = nrpe
Jul 29 13:35:54 remotehost xinetd[6595]: Service nrpe failed to start and is deactivated.
Jul 29 13:35:54 remotehost xinetd[6595]: xinetd Version 2.3.14 started with libwrap loadavg labeled-networking options compiled in.


In this case, you cannot start nrpe as embeded service in xinetd since this is a bug in xinetd. To fix this, you can start nrpe as standalone daemon. Before you started nrpe as standalone daemon, you need to verify the configuration in /usr/local/nagios/etc/nrpe.cfg. The following are two parameters that you need to take care of. The value for allowed_hosts should be the ip of nagios monitoring host and the server_port is 5666.
allowed_hosts=10.1.8.2
server_port=5666
Besides, you need to make sure xinetd is not running or you need to remove /etc/xinetd.d/nrpe and restart xinetd daemon.
Then, you can issue the following command to start nrpe as standalone daemon.
[admin@remotehost]$ /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
You should see the following log in /var/log/messages.
Jul 29 14:18:31 remotehost nrpe[5947]: Starting up daemon
Jul 29 14:18:31 remotehost nrpe[5947]: Listening for connections on port 5666
Jul 29 14:18:31 remotehost nrpe[5947]: Allowing connections from: 10.1.2.2
In this case, you can now verify the nrpe connection by running check_nrpe from nagios monitoring host as following.
[admin@monitoringhost ~]$ /usr/local/nagios/libexec/check_nrpe -H 10.1.2.12
NRPE v2.12
No more error 'CHECK_NRPE: Error - Could not complete SSL handshake.' now.