2009年4月29日

Fix ActiveMQ start/stop problem and startup script

To fix the ActiveMQ Stop problem, activeMQ must enable the jmxremote in port 1099 for START only, type this command before start, then clear:
# export SUNJMX="-Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote=true"

# sudo {path to ActiveMQ}/bin/activemq-admin start &

# export SUNJMX=""
To stop the service, simply type

# sudo {path to ActiveMQ}/bin/activemq-admin stop

Below is the startup script, create a file /etc/init.d/activemq
#!/bin/bash

# the base directory
AMQ_DIR="/opt/activemq"

CMD="$AMQ_DIR/bin/activemq-admin"

case "$1" in
start)
echo "Starting ActiveMQ "
export SUNJMX="-Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote=true"
$CMD $1 >/dev/null 2>&1 &
;;
stop)
echo "Shutting down ActiveMQ"
$CMD $1
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac
Note:
  • Login as root
  • Change the owner to root:root
  • Change permission to 755

沒有留言:

發佈留言