How to Check If Jboss Is Running on Unix Server

How to check jboss running in redhat environment?

Open the standalone.xml file from the JBOSS_HOME/standalone/configuration directory.

Look for all the texts jboss.bind.address in there and change the ip with the server's IP address so that you can access it from your local pc.

For example

${jboss.bind.address:192.168.1.68}

${jboss.bind.address.management:192.168.1.68}

... and so on...

Also, you can look for the loop back ip address(127.0.0.1) in the xml file as well and replace it.

How to check if a WildFly Server has started successfully using command/script?

I found a better solution. The command is

netstat -an | grep 9990 | grep LISTEN

Check the management port (9990) state before the WildFly is ready to accept management commands.

After that, use ./jboss-cli.sh -c command=':read-attribute(name=server-state)' | grep running to check if the server has started. Change the port
if the management port config is not the default 9990.

Here is my start & deploy script, the idea is continually check until the server started.

Then, use the jboss-cli command to deploy my application. And just print the log to the screen, so don't need to use another shell to tail the log file.

#!bin/sh
totalRow=0
printLog(){ #output the new log in the server.log to screen
local newTotal=$(awk 'END{print NR}' ./standalone/log/server.log) #quicker than wc -l
local diff=$(($newTotal-$totalRow))
tail -n $diff ./standalone/log/server.log
totalRow=$newTotal
}

nohup bin/standalone.sh>/dev/null 2>&1 &
echo '======================================== Jboss-eap-7.1 is starting now ========================================'
while true #check if the port is ready
do
sleep 1
if netstat -an | grep 9990 | grep LISTEN
then
printLog
break
fi
printLog
done
while true #check if the server start success
do
if bin/jboss-cli.sh --connect command=':read-attribute(name=server-state)' | grep running
then
printLog
break
fi
printLog
sleep 1
done
echo '======================================== Jboss-eap-7.1 has started!!!!!! ========================================'
bin/jboss-cli.sh --connect command='deploy /bcms/jboss-eap-7.1/war/myApp.war' &
tail -f -n0 ./standalone/log/server.log

Ant script to check if remote instance of Jboss is running

After a short check, I've found following, maybe you could reuse/or use as an inspiration for your script: http://shrubbery.homeip.net/c/display/W/Starting+JBoss+with+ANT

The relevant part for you seem to be:

<java jvm="@{jdkHome}/bin/java"
classname="org.jboss.Shutdown" fork="true" failonerror="false" resultproperty="shutdown.rc">
<arg line="-s jnp://@{bindAddr}:@{jnpPort}"/>
<classpath>
<pathelement path="@{jbossInstallDir}/bin/shutdown.jar"/>
<pathelement path="@{jbossInstallDir}/client/jbossall-client.jar"/>
</classpath>
</java>
<echo>Shutdown rc = ${shutdown.rc}</echo>
<condition property="shutdown.okay">
<equals arg1="${shutdown.rc}" arg2="0"/>
</condition>
<fail unless="shutdown.okay" message="Unable to shut down JBoss (maybe it hasn't fully started yet?)."/>
<echo>Waiting for @{bindAddr}:@{jnpPort} to stop listening...</echo>

What version of JBoss I am running?

JBoss has an MBean called Server. That reports the build and version of JBoss itself. Once you know the version, you can see what components are involved. It is not that well cataloged, but you can see it in the release notes.

How to know Jboss EAP version

Assuming you have the required permissions to execute the command

$JBOSS_HOME/bin/jboss-cli.sh --connect
# next two lines to enter in the JBoss command line interface
/:read-attribute(name=product-name)
/:read-attribute(name=product-version)

Or you can use JConsole and explore the jboss.as:server MBean the attributes have the names

productName
productVersion

Or (might not work with 5.1.0 GA, was tested with a newer version)

cat $JBOSS_HOME/modules/system/layers/base/org/jboss/as/product/eap/dir/META-INF/MANIFEST.MF


Related Topics



Leave a reply



Submit