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.