activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felipe Fraga <felipefr...@gmail.com>
Subject Re: HA Cluster from Standalone Artemis
Date Wed, 15 May 2019 06:07:04 GMT
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 <felipefraga@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 <jbertram@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 <felipefraga@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 <jbertram@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
>> > > >
>> > >
>> >
>>
>

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