You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Justin Bertram <jb...@apache.org> on 2019/05/10 17:59:53 UTC

Re: HA Cluster from Standalone Artemis

What kind of "high availability" do you want? High availability (i.e. HA)
in ActiveMQ Artemis is provided by a pair of brokers - one live and one
backup. If all your brokers are configured as live and you have no backup
brokers then you won't technically have HA functionality. If you have two
brokers configured as live and they're trying to access the same journal
then only one of those brokers will be active since locks prevent the
journal from being used by two brokers simultaneously.

Also, Artemis supports JGroups which has pluggable discovery mechanisms
that work in various clouds without the use of multicast.  Have you tried
using any of those?


Justin

On Tue, Apr 16, 2019 at 6:14 AM Felipe Fraga <fe...@gmail.com> wrote:

> Hello all,
>
> I now have ActiveMQ Artemis 2.6.4 deployed as docker container in an
> elastic cloud environment.
>
> Nodes can be scaled up or down at any time and actual IP's cannot be known
> during configuration time, so I can't create a cluster-connection using
> static cluster members.
>
> I also have an outside load balancer that is able to forward requests to
> these containers according to a certain algorithm.
>
> Now, problem is, I have a special requirement that I am not allowed for
> this containers to use multicast requests to discover another nodes in the
> cluster. Effectively, each node must run as standalone.
>
> I have used shared-storage ha-policy configuration, but nodes must still
> announce themselves to others as the documentation states. And with all
> nodes configured as live servers, one node just waits to get a lock on the
> journal shared directory.
>
> So, Is there a possible scenario to achieve an HA Cluster using ActiveMQ
> Artemis instances configured as standalone servers, using just a
> shared-storage and my external load balancer?
>
> Thanks in advance for the help.
>
> Regards,
>
> Felipe
>

Re: HA Cluster from Standalone Artemis

Posted by Justin Bertram <jb...@apache.org>.
> So, it looks like what I would like to do is setup two live servers
sharing the same journal directory. Maybe it is not possible.

As you suspect, it is not possible for two live servers to share the same
journal. A live and a backup can share the same journal folder, but both
brokers should *not* be active concurrently.

> Now, when both brokers are configured as master, the last one to start
becomes the slave, gives the backup announced log and waits for live lock.

That's the expected behavior.

> But I guess I don't want slaves...

If you configure multiple brokers to share the same journal directory the
you *will* have slaves. If you somehow modify the locking semantics of the
filesystem to allow 2 live brokers to share the same journal then you'll
end up with corrupted data and likely crashed brokers.


Justin

On Wed, May 15, 2019 at 1:07 AM Felipe Fraga <fe...@gmail.com> wrote:

> Hello again,
>
> I am experiencing with the configuration and I see now I still had some
> misconceptions. I see now that:
>
> - ha-policy is all about live and backup groups
> - cluster-connections is all about linking those groups together
>
> So, it looks like what I would like to do is setup two live servers sharing
> the same journal directory. Maybe it is not possible. Let me state my
> configuration so far:
>
> 1. Setup 2 broker instances with different ports on my localhost;
> 2. Configured the data (journal, large-messages, bindings, paging) of both
> brokers to the same filesystem directory;
> 3. Configured static cluster connections for the 2 brokers. Seems ok. I can
> see the "backup announced" log and the slave waiting for failover.
> 4. Started messing with ha-policy configuration using shared-store:
>
> <ha-policy>
>    <shared-store>
>       <master />
>    </shared-store>
> </ha-policy>
>
> Now, when both brokers are configured as master, the last one to start
> becomes the slave, gives the backup announced log and waits for live lock.
> Seems ok.
>
> But I guess I don't want slaves, so I tried to configure both as live-only:
>
> <ha-policy>
>    <live-only />
> </ha-policy>
>
> This doesn't work, as expected, because after the first broker starts it
> sets a lock and the second one has to wait to acquire a lock.
>
> Finally, I tried to configure the ha-policy to shared-state and colocated
> (live and backup on the same JVM):
>
> <ha-policy>
>    <shared-store>
>       <colocated />
>    </shared-store>
> </ha-policy>
>
> And now both brokers start. I get the log:
>
> AMQ221007: Server is now live
>
> but I don't get the log:
>
> AMQ221035: Live Server Obtained live lock
>
> So I figured that filesystem locks are only in place between live and
> backup servers. Since both are running on the same JVM, filesystem locks
> aren't necessary and this leaves me with 2 live/backup groups on the same
> cluster.
>
> This configuration seems to work in simple tests, but I now don't really
> know if it's ok to leave both brokers processes pointing to the same
> journal directory on the filesystem. Is it?
>
> Thanks once more,
>
> Felipe
>
>
> On Tue, May 14, 2019 at 11:39 PM Felipe Fraga <fe...@gmail.com>
> wrote:
>
> > Thanks again for the reply.
> >
> > So, after your explanation, I think I understood it better and will
> > definitely try that.
> >
> > Question now in my mind is: with the cluster connections, discovery and
> > broadcast groups configured, the session state will be shared between all
> > the nodes, correct? That being said, although the Artemis hostname (I
> don't
> > know the nodes IP addresses at configuration time) configured in my
> client
> > will not always point to the same node, it will work, because it won't
> > matter in which node the request lands.
> >
> > Am I correct?
> >
> > Thanks,
> >
> > Felipe
> >
> >
> > On Tue, May 14, 2019 at 1:42 PM Justin Bertram <jb...@apache.org>
> > wrote:
> >
> >> > I guess what I would really want is to have 2 live servers sharing the
> >> same
> >> > storage on the filesystem and if my load balancer tries a server that
> is
> >> > killed for some reason it then sends the same requests to the other
> >> server
> >> > and it works transparently, but I recognise that is not the Artemis
> >> > architecture.
> >>
> >> Fair enough, but there are a lot of instances where this would break
> since
> >> JMS connections are stateful unlike, for example, HTTP connections which
> >> are stateless. You can't simply flop requests back and forth or send
> >> requests meant for one broker to the other in the case where the
> original
> >> failed, at least not unless you've configured the broker for HA.  If you
> >> configure the 2 brokers to use shared-store HA then I think you can
> >> essentially get the functionality you're looking for.
> >>
> >>
> >> Justin
> >>
> >> On Tue, May 14, 2019 at 6:09 AM Felipe Fraga <fe...@gmail.com>
> >> wrote:
> >>
> >> > Hello and thanks for your reply,
> >> >
> >> > I guess what I would really want is to have 2 live servers sharing the
> >> same
> >> > storage on the filesystem and if my load balancer tries a server that
> is
> >> > killed for some reason it then sends the same requests to the other
> >> server
> >> > and it works transparently, but I recognise that is not the Artemis
> >> > architecture.
> >> >
> >> > I had a quick look on the JGroups configuration at the Artemis
> >> > configuration at the time, but I will try to understand it better to
> >> see if
> >> > I can configure the cluster in my scenario using it. Maybe using
> >> something
> >> > with FILE_PING.
> >> >
> >> > Thanks again.
> >> >
> >> > Felipe
> >> >
> >> >
> >> > On Fri, May 10, 2019 at 3:00 PM Justin Bertram <jb...@apache.org>
> >> > wrote:
> >> >
> >> > > What kind of "high availability" do you want? High availability
> (i.e.
> >> HA)
> >> > > in ActiveMQ Artemis is provided by a pair of brokers - one live and
> >> one
> >> > > backup. If all your brokers are configured as live and you have no
> >> backup
> >> > > brokers then you won't technically have HA functionality. If you
> have
> >> two
> >> > > brokers configured as live and they're trying to access the same
> >> journal
> >> > > then only one of those brokers will be active since locks prevent
> the
> >> > > journal from being used by two brokers simultaneously.
> >> > >
> >> > > Also, Artemis supports JGroups which has pluggable discovery
> >> mechanisms
> >> > > that work in various clouds without the use of multicast.  Have you
> >> tried
> >> > > using any of those?
> >> > >
> >> > >
> >> > > Justin
> >> > >
> >> > > On Tue, Apr 16, 2019 at 6:14 AM Felipe Fraga <felipefraga@gmail.com
> >
> >> > > wrote:
> >> > >
> >> > > > Hello all,
> >> > > >
> >> > > > I now have ActiveMQ Artemis 2.6.4 deployed as docker container in
> an
> >> > > > elastic cloud environment.
> >> > > >
> >> > > > Nodes can be scaled up or down at any time and actual IP's cannot
> be
> >> > > known
> >> > > > during configuration time, so I can't create a cluster-connection
> >> using
> >> > > > static cluster members.
> >> > > >
> >> > > > I also have an outside load balancer that is able to forward
> >> requests
> >> > to
> >> > > > these containers according to a certain algorithm.
> >> > > >
> >> > > > Now, problem is, I have a special requirement that I am not
> allowed
> >> for
> >> > > > this containers to use multicast requests to discover another
> nodes
> >> in
> >> > > the
> >> > > > cluster. Effectively, each node must run as standalone.
> >> > > >
> >> > > > I have used shared-storage ha-policy configuration, but nodes must
> >> > still
> >> > > > announce themselves to others as the documentation states. And
> with
> >> all
> >> > > > nodes configured as live servers, one node just waits to get a
> lock
> >> on
> >> > > the
> >> > > > journal shared directory.
> >> > > >
> >> > > > So, Is there a possible scenario to achieve an HA Cluster using
> >> > ActiveMQ
> >> > > > Artemis instances configured as standalone servers, using just a
> >> > > > shared-storage and my external load balancer?
> >> > > >
> >> > > > Thanks in advance for the help.
> >> > > >
> >> > > > Regards,
> >> > > >
> >> > > > Felipe
> >> > > >
> >> > >
> >> >
> >>
> >
>

Re: HA Cluster from Standalone Artemis

Posted by Felipe Fraga <fe...@gmail.com>.
Hello again,

I am experiencing with the configuration and I see now I still had some
misconceptions. I see now that:

- ha-policy is all about live and backup groups
- cluster-connections is all about linking those groups together

So, it looks like what I would like to do is setup two live servers sharing
the same journal directory. Maybe it is not possible. Let me state my
configuration so far:

1. Setup 2 broker instances with different ports on my localhost;
2. Configured the data (journal, large-messages, bindings, paging) of both
brokers to the same filesystem directory;
3. Configured static cluster connections for the 2 brokers. Seems ok. I can
see the "backup announced" log and the slave waiting for failover.
4. Started messing with ha-policy configuration using shared-store:

<ha-policy>
   <shared-store>
      <master />
   </shared-store>
</ha-policy>

Now, when both brokers are configured as master, the last one to start
becomes the slave, gives the backup announced log and waits for live lock.
Seems ok.

But I guess I don't want slaves, so I tried to configure both as live-only:

<ha-policy>
   <live-only />
</ha-policy>

This doesn't work, as expected, because after the first broker starts it
sets a lock and the second one has to wait to acquire a lock.

Finally, I tried to configure the ha-policy to shared-state and colocated
(live and backup on the same JVM):

<ha-policy>
   <shared-store>
      <colocated />
   </shared-store>
</ha-policy>

And now both brokers start. I get the log:

AMQ221007: Server is now live

but I don't get the log:

AMQ221035: Live Server Obtained live lock

So I figured that filesystem locks are only in place between live and
backup servers. Since both are running on the same JVM, filesystem locks
aren't necessary and this leaves me with 2 live/backup groups on the same
cluster.

This configuration seems to work in simple tests, but I now don't really
know if it's ok to leave both brokers processes pointing to the same
journal directory on the filesystem. Is it?

Thanks once more,

Felipe


On Tue, May 14, 2019 at 11:39 PM Felipe Fraga <fe...@gmail.com> wrote:

> Thanks again for the reply.
>
> So, after your explanation, I think I understood it better and will
> definitely try that.
>
> Question now in my mind is: with the cluster connections, discovery and
> broadcast groups configured, the session state will be shared between all
> the nodes, correct? That being said, although the Artemis hostname (I don't
> know the nodes IP addresses at configuration time) configured in my client
> will not always point to the same node, it will work, because it won't
> matter in which node the request lands.
>
> Am I correct?
>
> Thanks,
>
> Felipe
>
>
> On Tue, May 14, 2019 at 1:42 PM Justin Bertram <jb...@apache.org>
> wrote:
>
>> > I guess what I would really want is to have 2 live servers sharing the
>> same
>> > storage on the filesystem and if my load balancer tries a server that is
>> > killed for some reason it then sends the same requests to the other
>> server
>> > and it works transparently, but I recognise that is not the Artemis
>> > architecture.
>>
>> Fair enough, but there are a lot of instances where this would break since
>> JMS connections are stateful unlike, for example, HTTP connections which
>> are stateless. You can't simply flop requests back and forth or send
>> requests meant for one broker to the other in the case where the original
>> failed, at least not unless you've configured the broker for HA.  If you
>> configure the 2 brokers to use shared-store HA then I think you can
>> essentially get the functionality you're looking for.
>>
>>
>> Justin
>>
>> On Tue, May 14, 2019 at 6:09 AM Felipe Fraga <fe...@gmail.com>
>> wrote:
>>
>> > Hello and thanks for your reply,
>> >
>> > I guess what I would really want is to have 2 live servers sharing the
>> same
>> > storage on the filesystem and if my load balancer tries a server that is
>> > killed for some reason it then sends the same requests to the other
>> server
>> > and it works transparently, but I recognise that is not the Artemis
>> > architecture.
>> >
>> > I had a quick look on the JGroups configuration at the Artemis
>> > configuration at the time, but I will try to understand it better to
>> see if
>> > I can configure the cluster in my scenario using it. Maybe using
>> something
>> > with FILE_PING.
>> >
>> > Thanks again.
>> >
>> > Felipe
>> >
>> >
>> > On Fri, May 10, 2019 at 3:00 PM Justin Bertram <jb...@apache.org>
>> > wrote:
>> >
>> > > What kind of "high availability" do you want? High availability (i.e.
>> HA)
>> > > in ActiveMQ Artemis is provided by a pair of brokers - one live and
>> one
>> > > backup. If all your brokers are configured as live and you have no
>> backup
>> > > brokers then you won't technically have HA functionality. If you have
>> two
>> > > brokers configured as live and they're trying to access the same
>> journal
>> > > then only one of those brokers will be active since locks prevent the
>> > > journal from being used by two brokers simultaneously.
>> > >
>> > > Also, Artemis supports JGroups which has pluggable discovery
>> mechanisms
>> > > that work in various clouds without the use of multicast.  Have you
>> tried
>> > > using any of those?
>> > >
>> > >
>> > > Justin
>> > >
>> > > On Tue, Apr 16, 2019 at 6:14 AM Felipe Fraga <fe...@gmail.com>
>> > > wrote:
>> > >
>> > > > Hello all,
>> > > >
>> > > > I now have ActiveMQ Artemis 2.6.4 deployed as docker container in an
>> > > > elastic cloud environment.
>> > > >
>> > > > Nodes can be scaled up or down at any time and actual IP's cannot be
>> > > known
>> > > > during configuration time, so I can't create a cluster-connection
>> using
>> > > > static cluster members.
>> > > >
>> > > > I also have an outside load balancer that is able to forward
>> requests
>> > to
>> > > > these containers according to a certain algorithm.
>> > > >
>> > > > Now, problem is, I have a special requirement that I am not allowed
>> for
>> > > > this containers to use multicast requests to discover another nodes
>> in
>> > > the
>> > > > cluster. Effectively, each node must run as standalone.
>> > > >
>> > > > I have used shared-storage ha-policy configuration, but nodes must
>> > still
>> > > > announce themselves to others as the documentation states. And with
>> all
>> > > > nodes configured as live servers, one node just waits to get a lock
>> on
>> > > the
>> > > > journal shared directory.
>> > > >
>> > > > So, Is there a possible scenario to achieve an HA Cluster using
>> > ActiveMQ
>> > > > Artemis instances configured as standalone servers, using just a
>> > > > shared-storage and my external load balancer?
>> > > >
>> > > > Thanks in advance for the help.
>> > > >
>> > > > Regards,
>> > > >
>> > > > Felipe
>> > > >
>> > >
>> >
>>
>

Re: HA Cluster from Standalone Artemis

Posted by Justin Bertram <jb...@apache.org>.
> with the cluster connections, discovery and broadcast groups configured,
the session state will be shared between all the nodes, correct?

That's not correct. Clients maintain connections, sessions, etc. with an
individual node in the cluster. That cluster node does not replication this
state to the other nodes in the cluster.


Justin

On Tue, May 14, 2019 at 10:04 PM Felipe Fraga <fe...@gmail.com> wrote:

> Thanks again for the reply.
>
> So, after your explanation, I think I understood it better and will
> definitely try that.
>
> Question now in my mind is: with the cluster connections, discovery and
> broadcast groups configured, the session state will be shared between all
> the nodes, correct? That being said, although the Artemis hostname (I don't
> know the nodes IP addresses at configuration time) configured in my client
> will not always point to the same node, it will work, because it won't
> matter in which node the request lands.
>
> Am I correct?
>
> Thanks,
>
> Felipe
>
>
> On Tue, May 14, 2019 at 1:42 PM Justin Bertram <jb...@apache.org>
> wrote:
>
> > > I guess what I would really want is to have 2 live servers sharing the
> > same
> > > storage on the filesystem and if my load balancer tries a server that
> is
> > > killed for some reason it then sends the same requests to the other
> > server
> > > and it works transparently, but I recognise that is not the Artemis
> > > architecture.
> >
> > Fair enough, but there are a lot of instances where this would break
> since
> > JMS connections are stateful unlike, for example, HTTP connections which
> > are stateless. You can't simply flop requests back and forth or send
> > requests meant for one broker to the other in the case where the original
> > failed, at least not unless you've configured the broker for HA.  If you
> > configure the 2 brokers to use shared-store HA then I think you can
> > essentially get the functionality you're looking for.
> >
> >
> > Justin
> >
> > On Tue, May 14, 2019 at 6:09 AM Felipe Fraga <fe...@gmail.com>
> > wrote:
> >
> > > Hello and thanks for your reply,
> > >
> > > I guess what I would really want is to have 2 live servers sharing the
> > same
> > > storage on the filesystem and if my load balancer tries a server that
> is
> > > killed for some reason it then sends the same requests to the other
> > server
> > > and it works transparently, but I recognise that is not the Artemis
> > > architecture.
> > >
> > > I had a quick look on the JGroups configuration at the Artemis
> > > configuration at the time, but I will try to understand it better to
> see
> > if
> > > I can configure the cluster in my scenario using it. Maybe using
> > something
> > > with FILE_PING.
> > >
> > > Thanks again.
> > >
> > > Felipe
> > >
> > >
> > > On Fri, May 10, 2019 at 3:00 PM Justin Bertram <jb...@apache.org>
> > > wrote:
> > >
> > > > What kind of "high availability" do you want? High availability (i.e.
> > HA)
> > > > in ActiveMQ Artemis is provided by a pair of brokers - one live and
> one
> > > > backup. If all your brokers are configured as live and you have no
> > backup
> > > > brokers then you won't technically have HA functionality. If you have
> > two
> > > > brokers configured as live and they're trying to access the same
> > journal
> > > > then only one of those brokers will be active since locks prevent the
> > > > journal from being used by two brokers simultaneously.
> > > >
> > > > Also, Artemis supports JGroups which has pluggable discovery
> mechanisms
> > > > that work in various clouds without the use of multicast.  Have you
> > tried
> > > > using any of those?
> > > >
> > > >
> > > > Justin
> > > >
> > > > On Tue, Apr 16, 2019 at 6:14 AM Felipe Fraga <fe...@gmail.com>
> > > > wrote:
> > > >
> > > > > Hello all,
> > > > >
> > > > > I now have ActiveMQ Artemis 2.6.4 deployed as docker container in
> an
> > > > > elastic cloud environment.
> > > > >
> > > > > Nodes can be scaled up or down at any time and actual IP's cannot
> be
> > > > known
> > > > > during configuration time, so I can't create a cluster-connection
> > using
> > > > > static cluster members.
> > > > >
> > > > > I also have an outside load balancer that is able to forward
> requests
> > > to
> > > > > these containers according to a certain algorithm.
> > > > >
> > > > > Now, problem is, I have a special requirement that I am not allowed
> > for
> > > > > this containers to use multicast requests to discover another nodes
> > in
> > > > the
> > > > > cluster. Effectively, each node must run as standalone.
> > > > >
> > > > > I have used shared-storage ha-policy configuration, but nodes must
> > > still
> > > > > announce themselves to others as the documentation states. And with
> > all
> > > > > nodes configured as live servers, one node just waits to get a lock
> > on
> > > > the
> > > > > journal shared directory.
> > > > >
> > > > > So, Is there a possible scenario to achieve an HA Cluster using
> > > ActiveMQ
> > > > > Artemis instances configured as standalone servers, using just a
> > > > > shared-storage and my external load balancer?
> > > > >
> > > > > Thanks in advance for the help.
> > > > >
> > > > > Regards,
> > > > >
> > > > > Felipe
> > > > >
> > > >
> > >
> >
>

Re: HA Cluster from Standalone Artemis

Posted by Felipe Fraga <fe...@gmail.com>.
Thanks again for the reply.

So, after your explanation, I think I understood it better and will
definitely try that.

Question now in my mind is: with the cluster connections, discovery and
broadcast groups configured, the session state will be shared between all
the nodes, correct? That being said, although the Artemis hostname (I don't
know the nodes IP addresses at configuration time) configured in my client
will not always point to the same node, it will work, because it won't
matter in which node the request lands.

Am I correct?

Thanks,

Felipe


On Tue, May 14, 2019 at 1:42 PM Justin Bertram <jb...@apache.org> wrote:

> > I guess what I would really want is to have 2 live servers sharing the
> same
> > storage on the filesystem and if my load balancer tries a server that is
> > killed for some reason it then sends the same requests to the other
> server
> > and it works transparently, but I recognise that is not the Artemis
> > architecture.
>
> Fair enough, but there are a lot of instances where this would break since
> JMS connections are stateful unlike, for example, HTTP connections which
> are stateless. You can't simply flop requests back and forth or send
> requests meant for one broker to the other in the case where the original
> failed, at least not unless you've configured the broker for HA.  If you
> configure the 2 brokers to use shared-store HA then I think you can
> essentially get the functionality you're looking for.
>
>
> Justin
>
> On Tue, May 14, 2019 at 6:09 AM Felipe Fraga <fe...@gmail.com>
> wrote:
>
> > Hello and thanks for your reply,
> >
> > I guess what I would really want is to have 2 live servers sharing the
> same
> > storage on the filesystem and if my load balancer tries a server that is
> > killed for some reason it then sends the same requests to the other
> server
> > and it works transparently, but I recognise that is not the Artemis
> > architecture.
> >
> > I had a quick look on the JGroups configuration at the Artemis
> > configuration at the time, but I will try to understand it better to see
> if
> > I can configure the cluster in my scenario using it. Maybe using
> something
> > with FILE_PING.
> >
> > Thanks again.
> >
> > Felipe
> >
> >
> > On Fri, May 10, 2019 at 3:00 PM Justin Bertram <jb...@apache.org>
> > wrote:
> >
> > > What kind of "high availability" do you want? High availability (i.e.
> HA)
> > > in ActiveMQ Artemis is provided by a pair of brokers - one live and one
> > > backup. If all your brokers are configured as live and you have no
> backup
> > > brokers then you won't technically have HA functionality. If you have
> two
> > > brokers configured as live and they're trying to access the same
> journal
> > > then only one of those brokers will be active since locks prevent the
> > > journal from being used by two brokers simultaneously.
> > >
> > > Also, Artemis supports JGroups which has pluggable discovery mechanisms
> > > that work in various clouds without the use of multicast.  Have you
> tried
> > > using any of those?
> > >
> > >
> > > Justin
> > >
> > > On Tue, Apr 16, 2019 at 6:14 AM Felipe Fraga <fe...@gmail.com>
> > > wrote:
> > >
> > > > Hello all,
> > > >
> > > > I now have ActiveMQ Artemis 2.6.4 deployed as docker container in an
> > > > elastic cloud environment.
> > > >
> > > > Nodes can be scaled up or down at any time and actual IP's cannot be
> > > known
> > > > during configuration time, so I can't create a cluster-connection
> using
> > > > static cluster members.
> > > >
> > > > I also have an outside load balancer that is able to forward requests
> > to
> > > > these containers according to a certain algorithm.
> > > >
> > > > Now, problem is, I have a special requirement that I am not allowed
> for
> > > > this containers to use multicast requests to discover another nodes
> in
> > > the
> > > > cluster. Effectively, each node must run as standalone.
> > > >
> > > > I have used shared-storage ha-policy configuration, but nodes must
> > still
> > > > announce themselves to others as the documentation states. And with
> all
> > > > nodes configured as live servers, one node just waits to get a lock
> on
> > > the
> > > > journal shared directory.
> > > >
> > > > So, Is there a possible scenario to achieve an HA Cluster using
> > ActiveMQ
> > > > Artemis instances configured as standalone servers, using just a
> > > > shared-storage and my external load balancer?
> > > >
> > > > Thanks in advance for the help.
> > > >
> > > > Regards,
> > > >
> > > > Felipe
> > > >
> > >
> >
>

Re: HA Cluster from Standalone Artemis

Posted by Justin Bertram <jb...@apache.org>.
> I guess what I would really want is to have 2 live servers sharing the
same
> storage on the filesystem and if my load balancer tries a server that is
> killed for some reason it then sends the same requests to the other server
> and it works transparently, but I recognise that is not the Artemis
> architecture.

Fair enough, but there are a lot of instances where this would break since
JMS connections are stateful unlike, for example, HTTP connections which
are stateless. You can't simply flop requests back and forth or send
requests meant for one broker to the other in the case where the original
failed, at least not unless you've configured the broker for HA.  If you
configure the 2 brokers to use shared-store HA then I think you can
essentially get the functionality you're looking for.


Justin

On Tue, May 14, 2019 at 6:09 AM Felipe Fraga <fe...@gmail.com> wrote:

> Hello and thanks for your reply,
>
> I guess what I would really want is to have 2 live servers sharing the same
> storage on the filesystem and if my load balancer tries a server that is
> killed for some reason it then sends the same requests to the other server
> and it works transparently, but I recognise that is not the Artemis
> architecture.
>
> I had a quick look on the JGroups configuration at the Artemis
> configuration at the time, but I will try to understand it better to see if
> I can configure the cluster in my scenario using it. Maybe using something
> with FILE_PING.
>
> Thanks again.
>
> Felipe
>
>
> On Fri, May 10, 2019 at 3:00 PM Justin Bertram <jb...@apache.org>
> wrote:
>
> > What kind of "high availability" do you want? High availability (i.e. HA)
> > in ActiveMQ Artemis is provided by a pair of brokers - one live and one
> > backup. If all your brokers are configured as live and you have no backup
> > brokers then you won't technically have HA functionality. If you have two
> > brokers configured as live and they're trying to access the same journal
> > then only one of those brokers will be active since locks prevent the
> > journal from being used by two brokers simultaneously.
> >
> > Also, Artemis supports JGroups which has pluggable discovery mechanisms
> > that work in various clouds without the use of multicast.  Have you tried
> > using any of those?
> >
> >
> > Justin
> >
> > On Tue, Apr 16, 2019 at 6:14 AM Felipe Fraga <fe...@gmail.com>
> > wrote:
> >
> > > Hello all,
> > >
> > > I now have ActiveMQ Artemis 2.6.4 deployed as docker container in an
> > > elastic cloud environment.
> > >
> > > Nodes can be scaled up or down at any time and actual IP's cannot be
> > known
> > > during configuration time, so I can't create a cluster-connection using
> > > static cluster members.
> > >
> > > I also have an outside load balancer that is able to forward requests
> to
> > > these containers according to a certain algorithm.
> > >
> > > Now, problem is, I have a special requirement that I am not allowed for
> > > this containers to use multicast requests to discover another nodes in
> > the
> > > cluster. Effectively, each node must run as standalone.
> > >
> > > I have used shared-storage ha-policy configuration, but nodes must
> still
> > > announce themselves to others as the documentation states. And with all
> > > nodes configured as live servers, one node just waits to get a lock on
> > the
> > > journal shared directory.
> > >
> > > So, Is there a possible scenario to achieve an HA Cluster using
> ActiveMQ
> > > Artemis instances configured as standalone servers, using just a
> > > shared-storage and my external load balancer?
> > >
> > > Thanks in advance for the help.
> > >
> > > Regards,
> > >
> > > Felipe
> > >
> >
>

Re: HA Cluster from Standalone Artemis

Posted by Felipe Fraga <fe...@gmail.com>.
Hello and thanks for your reply,

I guess what I would really want is to have 2 live servers sharing the same
storage on the filesystem and if my load balancer tries a server that is
killed for some reason it then sends the same requests to the other server
and it works transparently, but I recognise that is not the Artemis
architecture.

I had a quick look on the JGroups configuration at the Artemis
configuration at the time, but I will try to understand it better to see if
I can configure the cluster in my scenario using it. Maybe using something
with FILE_PING.

Thanks again.

Felipe


On Fri, May 10, 2019 at 3:00 PM Justin Bertram <jb...@apache.org> wrote:

> What kind of "high availability" do you want? High availability (i.e. HA)
> in ActiveMQ Artemis is provided by a pair of brokers - one live and one
> backup. If all your brokers are configured as live and you have no backup
> brokers then you won't technically have HA functionality. If you have two
> brokers configured as live and they're trying to access the same journal
> then only one of those brokers will be active since locks prevent the
> journal from being used by two brokers simultaneously.
>
> Also, Artemis supports JGroups which has pluggable discovery mechanisms
> that work in various clouds without the use of multicast.  Have you tried
> using any of those?
>
>
> Justin
>
> On Tue, Apr 16, 2019 at 6:14 AM Felipe Fraga <fe...@gmail.com>
> wrote:
>
> > Hello all,
> >
> > I now have ActiveMQ Artemis 2.6.4 deployed as docker container in an
> > elastic cloud environment.
> >
> > Nodes can be scaled up or down at any time and actual IP's cannot be
> known
> > during configuration time, so I can't create a cluster-connection using
> > static cluster members.
> >
> > I also have an outside load balancer that is able to forward requests to
> > these containers according to a certain algorithm.
> >
> > Now, problem is, I have a special requirement that I am not allowed for
> > this containers to use multicast requests to discover another nodes in
> the
> > cluster. Effectively, each node must run as standalone.
> >
> > I have used shared-storage ha-policy configuration, but nodes must still
> > announce themselves to others as the documentation states. And with all
> > nodes configured as live servers, one node just waits to get a lock on
> the
> > journal shared directory.
> >
> > So, Is there a possible scenario to achieve an HA Cluster using ActiveMQ
> > Artemis instances configured as standalone servers, using just a
> > shared-storage and my external load balancer?
> >
> > Thanks in advance for the help.
> >
> > Regards,
> >
> > Felipe
> >
>