🚀 DevOps & SRE Certification Program 📅 Starting: 1st of Every Month 🤝 +91 8409492687 🔍 Contact@DevOpsSchool.com

Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

Starting multiple instances of jboss from shell script

tpatil created the topic: Starting multiple instances of jboss from shell script

For starting the multiple instances of jboss I have created the following 2 scripts.

Please let me know if anybody has any other suggestions.

JBstartall.sh will call JBstart.sh
[code language=”css”]
{code}
##############
#JBstartall.sh
##############
#!/bin/sh

cluster=”node1:192.168.32.45,node2:192.168.32.46″

for clust in ${cluster//,/ };
do
HOST=`echo $clust |cut -f2 -d:`
NODE=`echo $clust |cut -f1 -d:`
echo “Starting jboss $NODE on $HOST …..”
./JBstart.sh $NODE $HOST
done

date
echo “JBstartall.sh complete”
exit 0

#####
# EOS
#####
{code}

and

{code}
#!/bin/sh
### ====================================================================== ###
## ##
## JBoss Startup Script ##
## ARG1 =====>Name of profile ##
## ARG2 =====>Hostname/IP address of node ##
### ====================================================================== ###

JBOSSDIR=/local/sys/jboss-eap-5.1/jboss-as
TARGETDIR=$JBOSSDIR/server/$1
BINDHOST=$2
JMXUSER=admin
JMXPASS=admin

echo “Starting jboss………..”

rm /tmp/jboss.$1.start > /dev/null

$JBOSSDIR/bin/run.sh -c $1 -b $BINDHOST > /tmp/jboss.$1.start 2>&1 &
pid=$!

started=false

for i in `seq 1 30` ; do
if ps -p $pid > /dev/null ; then : ; else
break
fi
sleep 2
result=”`$JBOSSDIR/bin/twiddle.sh -s $BINDHOST -u $JMXUSER -p $JMXPASS get “jboss.system:type=Server” Started –noprefix`”
if [ $? == 0 -a x”$result” == x”true” ] ; then
started=true
break
fi
done

if $started ; then
echo $pid >> $TARGETDIR/log/jboss.pid
echo “………Sucessfully Started”
exit 0
elif test i = 30 ; then
echo “……………Timed Out”
exit 1
else
echo “……………Failed to Start”
exit 1
fi

date
echo “JBstart.sh complete”
exit 0

#####
# EOS
#####
{code}
[/code]

Subscribe
Notify of
guest


0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments

Certification Courses

DevOpsSchool has introduced a series of professional certification courses designed to enhance your skills and expertise in cutting-edge technologies and methodologies. Whether you are aiming to excel in development, security, or operations, these certifications provide a comprehensive learning experience. Explore the following programs:

DevOps Certification, SRE Certification, and DevSecOps Certification by DevOpsSchool

Explore our DevOps Certification, SRE Certification, and DevSecOps Certification programs at DevOpsSchool. Gain the expertise needed to excel in your career with hands-on training and globally recognized certifications.

0
Would love your thoughts, please comment.x
()
x