activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dejan Bosanac <de...@nighttale.net>
Subject Re: Starting 2 (or more) Brokers in a single config
Date Fri, 11 Sep 2009 13:27:11 GMT
Hi,

activemq-admin script tried to connect to default jmx url using 1099 port.
If you want to different jmx url you have to pass it as an extra argument,
such as

activemq-admin --jmxurl
service:jmx:rmi:///jndi/rmi://remotehost:61618/jmxrmi stop

Additionally, activemq-admin script in 5.3 will try first to detect local
process and connect to it, instead of using port 1099, so it'll generally
work with any port configuration (you might consider it)

Cheers
--
Dejan Bosanac

Open Source Integration - http://fusesource.com/
ActiveMQ in Action - http://www.manning.com/snyder/
Blog - http://www.nighttale.net


On Thu, Sep 10, 2009 at 5:47 PM, RKParkJr <ronald.park@cbs.com> wrote:

>
> Hello,
>
> I have just started with ActiveMQ and am looking at how we will internally
> repackage it.  At this time, we have two existing (yet seperate) groups
> using the system, each with their own packaging/deployment; I am trying to
> generalize what they have for potentially many different organizations
> within our company.
>
> Enough preamble... on to my problem. :)
>
> I am trying to find a way to correctly configure a different JMX port than
> the (seemingly undocumented port 1099).
>
> Initially, I make only these few changes to the default config:
>
>
> ...he-activemq-5.2.0> diff conf/activemq.xml conf/activemq.xml.orig
> 33c33
> <     <broker useJmx="true" xmlns="http://activemq.apache.org/schema/core"
> brokerName="localhost" dataDirectory="${activemq.base}/data">
> ---
> >     <broker xmlns="http://activemq.apache.org/schema/core"
> > brokerName="localhost" dataDirectory="${activemq.base}/data">
> 56c56
> <             <managementContext createConnector="true"/>
> ---
> >             <managementContext createConnector="false"/>
>
>
> Startup and stopping are clean with just these changes:
>
>
> ...he-activemq-5.2.0> bin/activemq-admin start &
> [1] 24250
> ...he-activemq-5.2.0> ACTIVEMQ_HOME: /var/tmp/amqt/apache-activemq-5.2.0
> ACTIVEMQ_BASE: /var/tmp/amqt/apache-activemq-5.2.0
> Loading message broker from: xbean:activemq.xml
> INFO  DefaultCamelContext            - JMX enabled. Using
> InstrumentationLifecycleStrategy.
> INFO  BrokerService                  - Using Persistence Adapter:
> AMQPersistenceAdapter(/var/tmp/amqt/apache-activemq-5.2.0/data)
> INFO  AMQPersistenceAdapter          - AMQStore starting using directory:
> /var/tmp/amqt/apache-activemq-5.2.0/data
> INFO  KahaStore                      - Kaha Store using data directory
> /var/tmp/amqt/apache-activemq-5.2.0/data/kr-store/state
> INFO  AMQPersistenceAdapter          - Active data files: []
> INFO  BrokerService                  - ActiveMQ 5.2.0 JMS Message Broker
> (localhost) is starting
> INFO  BrokerService                  - For help or more information please
> see: http://activemq.apache.org/
> INFO  ManagementContext              - JMX consoles can connect to
> service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
> INFO  KahaStore                      - Kaha Store using data directory
> /var/tmp/amqt/apache-activemq-5.2.0/data/kr-store/data
> INFO  TransportServerThreadSupport   - Listening for connections at:
> tcp://cn-sfo1-pma-theoden.cnet.com:61616
> INFO  TransportConnector             - Connector openwire Started
> INFO  TransportServerThreadSupport   - Listening for connections at:
> ssl://cn-sfo1-pma-theoden.cnet.com:61617
> INFO  TransportConnector             - Connector ssl Started
> INFO  TransportServerThreadSupport   - Listening for connections at:
> stomp://cn-sfo1-pma-theoden.cnet.com:61613
> INFO  TransportConnector             - Connector stomp Started
> INFO  TransportServerThreadSupport   - Listening for connections at:
> xmpp://cn-sfo1-pma-theoden.cnet.com:61222
> INFO  TransportConnector             - Connector xmpp Started
> INFO  NetworkConnector               - Network Connector default-nc Started
> INFO  BrokerService                  - ActiveMQ JMS Message Broker
> (localhost, ID:cn-sfo1-pma-theoden.cnet.com-48711-1252597129965-0:0)
> started
> INFO  log                            - Logging to
> org.slf4j.impl.JCLLoggerAdapter(org.mortbay.log) via
> org.mortbay.log.Slf4jLog
> INFO  log                            - jetty-6.1.9
> INFO  WebConsoleStarter              - ActiveMQ WebConsole initialized.
> INFO  /admin                         - Initializing Spring FrameworkServlet
> 'dispatcher'
> INFO  log                            - ActiveMQ Console at
> http://0.0.0.0:8161/admin
> INFO  log                            - ActiveMQ Web Demos at
> http://0.0.0.0:8161/demo
> INFO  log                            - RESTful file access application at
> http://0.0.0.0:8161/fileserver
> INFO  log                            - Started
> SelectChannelConnector@0.0.0.0:8161
> INFO  TransportConnector             - Connector vm://localhost Started
>
> ...he-activemq-5.2.0>
> ...he-activemq-5.2.0> bin/activemq-admin stop
> ACTIVEMQ_HOME: /var/tmp/amqt/apache-activemq-5.2.0
> ACTIVEMQ_BASE: /var/tmp/amqt/apache-activemq-5.2.0
> Stopping broker: localhost
> INFO  BrokerService                  - ActiveMQ Message Broker (localhost,
> ID:cn-sfo1-pma-theoden.cnet.com-48711-1252597129965-0:0) is shutting down
> INFO  NetworkConnector               - Network Connector default-nc Stopped
> INFO  TransportConnector             - Connector openwire Stopped
> INFO  TransportConnector             - Connector ssl Stopped
> INFO  TransportConnector             - Connector stomp Stopped
> INFO  TransportConnector             - Connector xmpp Stopped
> INFO  TransportConnector             - Connector vm://localhost Stopped
> INFO  BrokerService                  - ActiveMQ JMS Message Broker
> (localhost, ID:cn-sfo1-pma-theoden.cnet.com-48711-1252597129965-0:0)
> stopped
> [1]  + done       bin/activemq-admin start
>
>
> [Note the JMX port at 1099.]
>
>
> Because we may have multiple applications, each starting and stopping their
> own brokers independently, I need to 'templatize' the config, allowing each
> application to set independent ports (broker names, data files, etc) and
> access the appropriate JMX port for them.  So, I add the following change:
>
>
> ...he-activemq-5.2.0> diff conf/activemq.xml conf/activemq.xml.orig
> 33c33
> <     <broker useJmx="true" xmlns="http://activemq.apache.org/schema/core"
> brokerName="localhost" dataDirectory="${activemq.base}/data">
> ---
> >     <broker xmlns="http://activemq.apache.org/schema/core"
> > brokerName="localhost" dataDirectory="${activemq.base}/data">
> 56c56
> <             <managementContext createConnector="true"
> connectorPort="61618" />
> ---
> >             <managementContext createConnector="false"/>
>
>
>
> And it starts up just fine:
>
>
> ...he-activemq-5.2.0> bin/activemq-admin start &
> [1] 24619
> ...he-activemq-5.2.0> ACTIVEMQ_HOME: /var/tmp/amqt/apache-activemq-5.2.0
> ACTIVEMQ_BASE: /var/tmp/amqt/apache-activemq-5.2.0
> Loading message broker from: xbean:activemq.xml
> INFO  DefaultCamelContext            - JMX enabled. Using
> InstrumentationLifecycleStrategy.
> INFO  BrokerService                  - Using Persistence Adapter:
> AMQPersistenceAdapter(/var/tmp/amqt/apache-activemq-5.2.0/data)
> INFO  AMQPersistenceAdapter          - AMQStore starting using directory:
> /var/tmp/amqt/apache-activemq-5.2.0/data
> INFO  KahaStore                      - Kaha Store using data directory
> /var/tmp/amqt/apache-activemq-5.2.0/data/kr-store/state
> INFO  AMQPersistenceAdapter          - Active data files: []
> INFO  BrokerService                  - ActiveMQ 5.2.0 JMS Message Broker
> (localhost) is starting
> INFO  BrokerService                  - For help or more information please
> see: http://activemq.apache.org/
> INFO  ManagementContext              - JMX consoles can connect to
> service:jmx:rmi:///jndi/rmi://localhost:61618/jmxrmi
> INFO  KahaStore                      - Kaha Store using data directory
> /var/tmp/amqt/apache-activemq-5.2.0/data/kr-store/data
> INFO  TransportServerThreadSupport   - Listening for connections at:
> tcp://cn-sfo1-pma-theoden.cnet.com:61616
> INFO  TransportConnector             - Connector openwire Started
> INFO  TransportServerThreadSupport   - Listening for connections at:
> ssl://cn-sfo1-pma-theoden.cnet.com:61617
> INFO  TransportConnector             - Connector ssl Started
> INFO  TransportServerThreadSupport   - Listening for connections at:
> stomp://cn-sfo1-pma-theoden.cnet.com:61613
> INFO  TransportConnector             - Connector stomp Started
> INFO  TransportServerThreadSupport   - Listening for connections at:
> xmpp://cn-sfo1-pma-theoden.cnet.com:61222
> INFO  TransportConnector             - Connector xmpp Started
> INFO  NetworkConnector               - Network Connector default-nc Started
> INFO  BrokerService                  - ActiveMQ JMS Message Broker
> (localhost, ID:cn-sfo1-pma-theoden.cnet.com-48733-1252597448818-0:0)
> started
> INFO  log                            - Logging to
> org.slf4j.impl.JCLLoggerAdapter(org.mortbay.log) via
> org.mortbay.log.Slf4jLog
> INFO  log                            - jetty-6.1.9
> INFO  WebConsoleStarter              - ActiveMQ WebConsole initialized.
> INFO  /admin                         - Initializing Spring FrameworkServlet
> 'dispatcher'
> INFO  log                            - ActiveMQ Console at
> http://0.0.0.0:8161/admin
> INFO  log                            - ActiveMQ Web Demos at
> http://0.0.0.0:8161/demo
> INFO  log                            - RESTful file access application at
> http://0.0.0.0:8161/fileserver
> INFO  log                            - Started
> SelectChannelConnector@0.0.0.0:8161
> INFO  TransportConnector             - Connector vm://localhost Started
>
>
> But stopping doesn't work at all:
>
>
> ...he-activemq-5.2.0> bin/activemq-admin stop
> ACTIVEMQ_HOME: /var/tmp/amqt/apache-activemq-5.2.0
> ACTIVEMQ_BASE: /var/tmp/amqt/apache-activemq-5.2.0
> ERROR: java.lang.RuntimeException: Failed to execute stop task. Reason:
> java.io.IOException: Failed to retrieve RMIServer stub:
> javax.naming.ServiceUnavailableException [Root exception is
> java.rmi.ConnectException: Connection refused to host: localhost; nested
> exception is:
>        java.net.ConnectException: Connection refused]
> java.lang.RuntimeException: Failed to execute stop task. Reason:
> java.io.IOException: Failed to retrieve RMIServer stub:
> javax.naming.ServiceUnavailableException [Root exception is
> java.rmi.ConnectException: Connection refused to host: localhost; nested
> exception is:
>        java.net.ConnectException: Connection refused]
>        .... [trimming the stack dump] ....
>
>
> Any ideas?
>
> Thanks,
> Ron
> --
> View this message in context:
> http://www.nabble.com/Starting-2-%28or-more%29-Brokers-in-a-single-config-tp25385344p25385344.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message