You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by bbuzzard <Bi...@bnsflogistics.com> on 2016/07/21 14:45:18 UTC

How do I Set Up Multiple ActiveMQ Services on one Windows Machine

I am using ActiveMQ-5.13.3 with jdk1.7.0_79 on a Windows 7 laptop for
testing.  I ran bin\activemq-admin and created two instances: prod and test. 
I successfully started both instances from the command line and they work
great.  I would like to create two Window's Services: one for prod and the
other for test, but I have not yet figured out how to configure the
wrapper.conf and/or environment to create either service.  Would someone
please provide some assistance?



--
View this message in context: http://activemq.2283324.n4.nabble.com/How-do-I-Set-Up-Multiple-ActiveMQ-Services-on-one-Windows-Machine-tp4714245.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: How do I Set Up Multiple ActiveMQ Services on one Windows Machine

Posted by Tim Bain <tb...@alumni.duke.edu>.
I don't run on Windows, so I can't help with specifics, but in general
you'll need to make sure you deconflict the ports used by the two services
to let them co-exist.  You can set those ports via environment variables
(letting you use a single config file) or hard-code the ports in the config
file (which means you need two config files, and you'll need to pass in the
config file as a runtime argument when invoking the bat script from your
service).

Hopefully that very general guidance is useful; if not, maybe you can tell
us more about what you've tried and what's not working about it.

Tim

On Thu, Jul 21, 2016 at 8:45 AM, bbuzzard <Bi...@bnsflogistics.com>
wrote:

> I am using ActiveMQ-5.13.3 with jdk1.7.0_79 on a Windows 7 laptop for
> testing.  I ran bin\activemq-admin and created two instances: prod and
> test.
> I successfully started both instances from the command line and they work
> great.  I would like to create two Window's Services: one for prod and the
> other for test, but I have not yet figured out how to configure the
> wrapper.conf and/or environment to create either service.  Would someone
> please provide some assistance?
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/How-do-I-Set-Up-Multiple-ActiveMQ-Services-on-one-Windows-Machine-tp4714245.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

RE: How do I Set Up Multiple ActiveMQ Services on one Windows Machine

Posted by bbuzzard <Bi...@bnsflogistics.com>.
Yes I was able to get it working.  From the console, execute "activemq create <path and name to new instance>".  So if you want to create a "test" instance in the "/opt" folder on a Linux machine, you would execute "activemq create /opt/test".  The "/opt/test/bin" folder will contain a script that has the same name as the instance, "test", that is used to launch the instance.  Configuration information is stored in the "/opt/test/conf" folder.


From: adnan [via ActiveMQ] [mailto:ml+s2283324n4725891h0@n4.nabble.com]
Sent: Wednesday, May 10, 2017 10:04 AM
To: Billy Buzzard <bi...@bnsflogistics.com>
Subject: Re: How do I Set Up Multiple ActiveMQ Services on one Windows Machine

Any luck with this? Were you able to get this to work on a Windows machine? I am trying to do the same in a Linux machine.

If possible could you outline the steps you had taken to fix this?
________________________________
If you reply to this email, your message will be added to the discussion below:
http://activemq.2283324.n4.nabble.com/How-do-I-Set-Up-Multiple-ActiveMQ-Services-on-one-Windows-Machine-tp4714245p4725891.html
To unsubscribe from How do I Set Up Multiple ActiveMQ Services on one Windows Machine, click here<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4714245&code=QmlsbHkuQnV6emFyZEBibnNmbG9naXN0aWNzLmNvbXw0NzE0MjQ1fC05MjA3NTk2MzE=>.
NAML<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>




--
View this message in context: http://activemq.2283324.n4.nabble.com/How-do-I-Set-Up-Multiple-ActiveMQ-Services-on-one-Windows-Machine-tp4714245p4726065.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

RE: How do I Set Up Multiple ActiveMQ Services on one Windows Machine

Posted by bbuzzard <Bi...@bnsflogistics.com>.
With my instances, I run the instance and specify STOP.  So if I had a test instance at /opt/test then I would execute /opt/test/bin/test STOP.


From: adnan [via ActiveMQ] [mailto:ml+s2283324n4726154h53@n4.nabble.com]
Sent: Monday, May 15, 2017 9:46 AM
To: Billy Buzzard <bi...@bnsflogistics.com>
Subject: RE: How do I Set Up Multiple ActiveMQ Services on one Windows Machine

Thank you for your response.

For the most part i am able to run multiple instances of apache on a single Linux machine. As rightly identified updated the XML files with different port and able to process XML files through the MQ.

But when trying to stop a specific service its always stopping the first instance that was started and successfully stops the first instance, upon looking at the logs i could see its trying to stop the second instance but fails.

My issue now is what else need to be modified or any other changes required that would ensure when i go about stopping a specific instance it only stops it instead of the instance that was first started? Any insight? We are using 4.1.2 but are open to upgrade if that helps. Validated the same in higher version, but the issue persists i.e. starting multiple instances and consuming from those MQ is fine, but when stopping it always stops the service that was first started.

For now living with kill -9 PID. Need some help!
________________________________
If you reply to this email, your message will be added to the discussion below:
http://activemq.2283324.n4.nabble.com/How-do-I-Set-Up-Multiple-ActiveMQ-Services-on-one-Windows-Machine-tp4714245p4726154.html
To unsubscribe from How do I Set Up Multiple ActiveMQ Services on one Windows Machine, click here<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4714245&code=QmlsbHkuQnV6emFyZEBibnNmbG9naXN0aWNzLmNvbXw0NzE0MjQ1fC05MjA3NTk2MzE=>.
NAML<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>




--
View this message in context: http://activemq.2283324.n4.nabble.com/How-do-I-Set-Up-Multiple-ActiveMQ-Services-on-one-Windows-Machine-tp4714245p4726168.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

RE: How do I Set Up Multiple ActiveMQ Services on one Windows Machine

Posted by Tim Bain <tb...@alumni.duke.edu>.
Great, I'm glad to hear that 5.14.5 works for you. Thanks for letting us
know.

Tim

On Jun 5, 2017 7:25 AM, "adnan" <ad...@yahoo.com> wrote:

> Thanks Tim for the response. Apperantly it looks like this is an issue with
> AMQ 4.1.2 and 5.8.0. Upon looking for ports being invoked in both of these
> versions found a JAVA resource that wasn't part of the AMQ code hooking on
> to any new service that was started.
>
> When did the changes and ran multiple instances on AMQ 5.14.5 it worked
> like
> a charm and was able to start and stop them without impacting other
> services. So will use AMQ 5.14.5 for now.
>
> Thank you all for your inputs.
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.
> nabble.com/How-do-I-Set-Up-Multiple-ActiveMQ-Services-on-
> one-Windows-Machine-tp4714245p4727023.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

RE: How do I Set Up Multiple ActiveMQ Services on one Windows Machine

Posted by adnan <ad...@yahoo.com>.
Thanks Tim for the response. Apperantly it looks like this is an issue with
AMQ 4.1.2 and 5.8.0. Upon looking for ports being invoked in both of these
versions found a JAVA resource that wasn't part of the AMQ code hooking on
to any new service that was started.

When did the changes and ran multiple instances on AMQ 5.14.5 it worked like
a charm and was able to start and stop them without impacting other
services. So will use AMQ 5.14.5 for now.

Thank you all for your inputs.



--
View this message in context: http://activemq.2283324.n4.nabble.com/How-do-I-Set-Up-Multiple-ActiveMQ-Services-on-one-Windows-Machine-tp4714245p4727023.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

RE: How do I Set Up Multiple ActiveMQ Services on one Windows Machine

Posted by Tim Bain <tb...@alumni.duke.edu>.
I don't see what's materially different between the two approaches (both
involve making two copies of the relevant files and changing them as
needed, but one just involves copying more files than is strictly
necessary), but yes, I believe that the approach you want to take will
work, and that you can use the same approach that's described in the
tutorials you say you've found. (Caveat: I've never run anything out of the
4.x version family, so it's possible that it won't work for some reason I'm
not aware of.)

You don't have to (and wouldn't want to, for what you're trying to do) use
a .activemqrc file to configure the different instances; you'd want to use
an env file as described in
http://activemq.apache.org/unix-shell-script.html. That would let you use
different ports for the different instances.

Also, I'm curious: if you're going to spend the time upgrading to a recent
version instead of 4.1.2 (I can't believe you're actually running that old
of a version), why would you pick a version that's still fairly old (5.8.0)
instead of one of the current releases (5.13.x or 5.14.x)?

Tim

On May 16, 2017 7:30 AM, "adnan" <ad...@yahoo.com> wrote:

> I am not referring to Apache (the web server). This is with reference with
> JMS broker APACHEMQ. We are fine with upgrading it, but looks like after
> the
> upgrade i will end up making lot more changes than what i can live with in
> 4.1.2.
>
> Let me make myself clear here, i am looking for ways by which i can have
> multiple apachemq services running on my Linux machine, not from the same
> installation files but instead from different set of installation software
> i.e. Not instances but rather different setup all together. Is this doable?
>
> As a starting point when i upgrade to 5.8.0 its asking me to setup
> .activemqrc configuration file and when i look into it its has references
> to
> 61616 port. If i need multiple services running on the sever and i pass
> ./activemq start or ./activemq stop wouldn't it start and stop only that
> specific service running at 61616 (only one service)?
>
> So to make my life easy for now i plan to implement this on 4.1.2 and if it
> works then surely work towards upgrading it.
>
> Is it possible to have for example /opt/Service1/bin/./activemq start
> and
> /opt/Service2/bin/.activemq start
> running under the same owner at different ports? Rather than what most of
> the posts are referring to by creating multiple instances using the same
> set
> of files like Instance1 and Instance2 as shown below?
>
> /opt/Apachemq/bin/Instance1/.activemq  start
> and
> /opt/Apachemq/bin/Instance2/.activemq start
>
> I hope i am doing a good job in explaining my isuse here......
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.
> nabble.com/How-do-I-Set-Up-Multiple-ActiveMQ-Services-on-
> one-Windows-Machine-tp4714245p4726193.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

RE: How do I Set Up Multiple ActiveMQ Services on one Windows Machine

Posted by adnan <ad...@yahoo.com>.
I am not referring to Apache (the web server). This is with reference with
JMS broker APACHEMQ. We are fine with upgrading it, but looks like after the
upgrade i will end up making lot more changes than what i can live with in
4.1.2.

Let me make myself clear here, i am looking for ways by which i can have
multiple apachemq services running on my Linux machine, not from the same
installation files but instead from different set of installation software
i.e. Not instances but rather different setup all together. Is this doable?

As a starting point when i upgrade to 5.8.0 its asking me to setup
.activemqrc configuration file and when i look into it its has references to
61616 port. If i need multiple services running on the sever and i pass
./activemq start or ./activemq stop wouldn't it start and stop only that
specific service running at 61616 (only one service)?

So to make my life easy for now i plan to implement this on 4.1.2 and if it
works then surely work towards upgrading it.

Is it possible to have for example /opt/Service1/bin/./activemq start 
and 
/opt/Service2/bin/.activemq start
running under the same owner at different ports? Rather than what most of
the posts are referring to by creating multiple instances using the same set
of files like Instance1 and Instance2 as shown below?

/opt/Apachemq/bin/Instance1/.activemq  start 
and 
/opt/Apachemq/bin/Instance2/.activemq start

I hope i am doing a good job in explaining my isuse here......



--
View this message in context: http://activemq.2283324.n4.nabble.com/How-do-I-Set-Up-Multiple-ActiveMQ-Services-on-one-Windows-Machine-tp4714245p4726193.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

RE: How do I Set Up Multiple ActiveMQ Services on one Windows Machine

Posted by Tim Bain <tb...@alumni.duke.edu>.
Are you in fact talking about running Apache (the web server) as your
message seems to state, not Apache (the open source foundation) ActiveMQ
(the JMS broker)? If so, you're on the wrong mailing list. If not, then
yes, you should definitely upgrade from 4.1.2 to something produced this
decade, even if it doesn't solve your problem.

Tim

On May 15, 2017 8:59 AM, "adnan" <ad...@yahoo.com> wrote:

> Thank you for your response.
>
> For the most part i am able to run multiple instances of apache on a single
> Linux machine. As rightly identified updated the XML files with different
> port and able to process XML files through the MQ.
>
> But when trying to stop a specific service its always stopping the first
> instance that was started and successfully stops the first instance, upon
> looking at the logs i could see its trying to stop the second instance but
> fails.
>
> My issue now is what else need to be modified or any other changes required
> that would ensure when i go about stopping a specific instance it only
> stops
> it instead of the instance that was first started? Any insight? We are
> using
> 4.1.2 but are open to upgrade if that helps. Validated the same in higher
> version, but the issue persists i.e. starting multiple instances and
> consuming from those MQ is fine, but when stopping it always stops the
> service that was first started.
>
> For now living with kill -9 PID. Need some help!
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.
> nabble.com/How-do-I-Set-Up-Multiple-ActiveMQ-Services-on-
> one-Windows-Machine-tp4714245p4726154.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

RE: How do I Set Up Multiple ActiveMQ Services on one Windows Machine

Posted by adnan <ad...@yahoo.com>.
Thank you for your response.

For the most part i am able to run multiple instances of apache on a single
Linux machine. As rightly identified updated the XML files with different
port and able to process XML files through the MQ.

But when trying to stop a specific service its always stopping the first
instance that was started and successfully stops the first instance, upon
looking at the logs i could see its trying to stop the second instance but
fails.

My issue now is what else need to be modified or any other changes required
that would ensure when i go about stopping a specific instance it only stops
it instead of the instance that was first started? Any insight? We are using
4.1.2 but are open to upgrade if that helps. Validated the same in higher
version, but the issue persists i.e. starting multiple instances and
consuming from those MQ is fine, but when stopping it always stops the
service that was first started.

For now living with kill -9 PID. Need some help!



--
View this message in context: http://activemq.2283324.n4.nabble.com/How-do-I-Set-Up-Multiple-ActiveMQ-Services-on-one-Windows-Machine-tp4714245p4726154.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

RE: How do I Set Up Multiple ActiveMQ Services on one Windows Machine

Posted by bbuzzard <Bi...@bnsflogistics.com>.
I forgot to mention that you will need to make sure that your jetty port setting in the "jetty.xml" file are unique per instance ( e.g. instance one 8161 and instance two 8162 ).  If you want to isolate the instances then you should consider making the ports for the TransportConnectors and NetworkBridges in the "activemq.xml" file unique too.

From: Billy Buzzard
Sent: Friday, May 12, 2017 11:13 AM
To: 'adnan [via ActiveMQ]' <ml...@n4.nabble.com>
Subject: RE: How do I Set Up Multiple ActiveMQ Services on one Windows Machine

Yes I was able to get it working.  From the console, execute "activemq create <path and name to new instance>".  So if you want to create a "test" instance in the "/opt" folder on a Linux machine, you would execute "activemq create /opt/test".  The "/opt/test/bin" folder will contain a script that has the same name as the instance, "test", that is used to launch the instance.  Configuration information is stored in the "/opt/test/conf" folder.


From: adnan [via ActiveMQ] [mailto:ml+s2283324n4725891h0@n4.nabble.com]
Sent: Wednesday, May 10, 2017 10:04 AM
To: Billy Buzzard <bi...@bnsflogistics.com>>
Subject: Re: How do I Set Up Multiple ActiveMQ Services on one Windows Machine

Any luck with this? Were you able to get this to work on a Windows machine? I am trying to do the same in a Linux machine.

If possible could you outline the steps you had taken to fix this?
________________________________
If you reply to this email, your message will be added to the discussion below:
http://activemq.2283324.n4.nabble.com/How-do-I-Set-Up-Multiple-ActiveMQ-Services-on-one-Windows-Machine-tp4714245p4725891.html
To unsubscribe from How do I Set Up Multiple ActiveMQ Services on one Windows Machine, click here<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4714245&code=QmlsbHkuQnV6emFyZEBibnNmbG9naXN0aWNzLmNvbXw0NzE0MjQ1fC05MjA3NTk2MzE=>.
NAML<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>




--
View this message in context: http://activemq.2283324.n4.nabble.com/How-do-I-Set-Up-Multiple-ActiveMQ-Services-on-one-Windows-Machine-tp4714245p4726067.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: How do I Set Up Multiple ActiveMQ Services on one Windows Machine

Posted by adnan <ad...@yahoo.com>.
Any luck with this? Were you able to get this to work on a Windows machine? I
am trying to do the same in a Linux machine.

If possible could you outline the steps you had taken to fix this?



--
View this message in context: http://activemq.2283324.n4.nabble.com/How-do-I-Set-Up-Multiple-ActiveMQ-Services-on-one-Windows-Machine-tp4714245p4725891.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.