[jboss-user] [Clustering/JBoss] - Re: Lost in the documentation UDP->TCP

giddion do-not-reply at jboss.com
Sat Jun 27 19:02:02 EDT 2009


Ok to update this thread in case anyone else is looking for the same solution. I followed the post by bstansberry and modified my init script. Ended up with this run command:

  | /opt/jboss/bin/run.sh -c all -b 0.0.0.0 -g cameldev -Djboss.default.jgroups.stack=tcp -Djgroups.tcpping.initial_hosts=cameldev1:7600,cameldev2:7600
  | 

Which critically fails the server start. I looked over the default values in jgroups-channelfactory-stacks.xml and realized the fault.

Functional run command:

  | /opt/jboss/bin/run.sh -c default -b 0.0.0.0 -g cameldev -Djboss.default.jgroups.stack=tcp -Djgroups.tcpping.initial_hosts=cameldev1[7600],cameldev2[7600]
  | 

The key difference being how the ports are identifed.

Also in case it helps someone, here is my modified init script

  | #!/bin/sh
  | #
  | # $Id: jboss_init_redhat.sh 81068 2008-11-14 15:14:35Z dimitris at jboss.org $
  | #
  | # JBoss Control Script
  | # chkconfig: - 85 15
  | # description: Runs JBoss service
  | #
  | 
  | #define where jboss is - this is the directory containing directories log, bin, conf etc
  | JBOSS_HOME=${JBOSS_HOME:-"/opt/jboss"}
  | 
  | #Define location for console log
  | JBOSS_CONSOLE="$JBOSS_HOME/server/default/log/jboss.log"
  | 
  | #define the user under which jboss will run, or use 'RUNASIS' to run as the current user
  | JBOSS_USER=${JBOSS_USER:-"jboss"}
  | 
  | #make sure java is in your path
  | JAVAPTH=${JAVAPTH:-"/usr/java/jdk1.6.0_14"}
  | 
  | #configuration to use, usually one of 'minimal', 'default', 'all'
  | JBOSS_CONF=${JBOSS_CONF:-"default"}
  | 
  | #IP Address to Bind to 0.0.0.0 binds all IP default is loopback only
  | JBOSS_HOST="0.0.0.0"
  | 
  | #Partition Name for Clustering
  | JBOSS_PARTION="cameldev" 
  | 
  | #JGroups Stack leave blank for default UDP stack 
  | JGROUPS_STACK="tcp"
  | 
  | #Cluster Hosts if Stack is tcp and TCPPing is enabled in jgroups-channelfactory-stacks.xml
  | JGROUPS_HOSTS="cameldev1[7600],cameldev2[7600]"
  | 
  | #If JBOSS_HOST specified, use -b to bind jboss services to that address
  | JBOSS_BIND_ADDR=${JBOSS_HOST:+"-b $JBOSS_HOST"}
  | 
  | #If JBOSS_PARTION specified, use -g to bind jboss services to that address
  | JBOSS_PARTION_NAME=${JBOSS_PARTION:+"-g $JBOSS_PARTION"}
  | 
  | #Set command line flag for JGroups stack
  | JGROUPS_STACK_LINE=${JGROUPS_STACK:+"-Djboss.default.jgroups.stack=$JGROUPS_STACK"}
  | 
  | #Set command line flag for JGroup Inital Hosts
  | JGROUPS_HOSTS_LINE=${JGROUPS_HOSTS:+"-Djgroups.tcpping.initial_hosts=$JGROUPS_HOSTS"}
  | 
  | #define the classpath for the shutdown class
  | JBOSSCP=${JBOSSCP:-"$JBOSS_HOME/bin/shutdown.jar:$JBOSS_HOME/client/jnet.jar"}
  | 
  | #define the script to use to start jboss
  | JBOSSSH=${JBOSSSH:-"$JBOSS_HOME/bin/run.sh -c $JBOSS_CONF $JBOSS_BIND_ADDR $JBOSS_PARTION_NAME $JGROUPS_STACK_LINE $JGROUPS_HOSTS_LINE"}
  | 
  | if [ "$JBOSS_USER" = "RUNASIS" ]; then
  |   SUBIT=""
  | else
  |   SUBIT="su - $JBOSS_USER -c "
  | fi
  | 
  | if [ -n "$JBOSS_CONSOLE" -a ! -d "$JBOSS_CONSOLE" ]; then
  |   # ensure the file exists
  |   touch $JBOSS_CONSOLE
  |   if [ ! -z "$SUBIT" ]; then
  |     chown $JBOSS_USER $JBOSS_CONSOLE
  |   fi 
  | fi
  | 
  | if [ -n "$JBOSS_CONSOLE" -a ! -f "$JBOSS_CONSOLE" ]; then
  |   echo "WARNING: location for saving console log invalid: $JBOSS_CONSOLE"
  |   echo "WARNING: ignoring it and using /dev/null"
  |   JBOSS_CONSOLE="/dev/null"
  | fi
  | 
  | #define what will be done with the console log
  | JBOSS_CONSOLE=${JBOSS_CONSOLE:-"/dev/null"}
  | 
  | JBOSS_CMD_START="cd $JBOSS_HOME/bin; $JBOSSSH"
  | JBOSS_CMD_STOP=${JBOSS_CMD_STOP:-"java -classpath $JBOSSCP org.jboss.Shutdown --shutdown"}
  | 
  | if [ -z "`echo $PATH | grep $JAVAPTH`" ]; then
  |   export PATH=$PATH:$JAVAPTH
  | fi
  | 
  | if [ ! -d "$JBOSS_HOME" ]; then
  |   echo JBOSS_HOME does not exist as a valid directory : $JBOSS_HOME
  |   exit 1
  | fi
  | 
  | echo JBOSS_CMD_START = $JBOSS_CMD_START
  | 
  | case "$1" in
  | start)
  |     cd $JBOSS_HOME/bin
  |     if [ -z "$SUBIT" ]; then
  |         eval $JBOSS_CMD_START >${JBOSS_CONSOLE} 2>&1 &
  |     else
  |         $SUBIT "$JBOSS_CMD_START >${JBOSS_CONSOLE} 2>&1 &" 
  |     fi
  |     ;;
  | stop)
  |     if [ -z "$SUBIT" ]; then
  |         $JBOSS_CMD_STOP
  |     else
  |         $SUBIT "$JBOSS_CMD_STOP"
  |     fi 
  |     ;;
  | restart)
  |     $0 stop
  |     $0 start
  |     ;;
  | *)
  |     echo "usage: $0 (start|stop|restart|help)"
  | esac
  | 


View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4240534#4240534

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4240534



More information about the jboss-user mailing list