You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by galoi <g....@tykelab.it> on 2019/06/24 13:35:43 UTC

H/A replication master slave

I'm using artemis ActiveMQ Artemis 2.9.0, and i configured two nodes master
and slave in replication HA. View Below:
<ha-policy>
	<replication>
		<master>
			<check-for-live-server>true</check-for-live-server>
		</master>
	</replication>
</ha-policy>
	
<ha-policy>
	<replication>
		<slave>
			<allow-failback>true</allow-failback>
	         </slave>
	</replication>
</ha-policy>
	  
When i stop the node master the slave to take the control. 
So far its ok, but when a stop too the slave, i have double point of
failover.
If the only node to start is the slave, i lose all information in the queue.
How can i resolve it?

Thanks in advance for the help!

Kind regards,
Gianfranco Aloi 



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: H/A replication master slave

Posted by Justin Bertram <jb...@apache.org>.
> So does that mean that -- after shutting down master and then slave --
it's not enough to start the slave again and that the master server must be
then started as well?

That's not what I'm saying.

I'm saying that if the master and slave both go down then *administrative
intervention* is required to ensure the most up-to-date data is used. The
administrator will have to determine which broker went down last and then
start that broker first. If the the last broker to go down was the slave
then it will need to be reconfigured to be a master before it is restarted
so that it will actually fully activate.


Justin

On Tue, Jun 25, 2019 at 12:36 AM Bummer <je...@centrum.cz> wrote:

> So does that mean that -- after shutting down master and then slave -- it's
> not enough to start the slave again and that the master server must be then
> started as well? Because, obviously, starting the master first isn't an
> option as it might have older data than its slave, right?
>
>
>
> --
> Sent from:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
>

Re: H/A replication master slave

Posted by Bummer <je...@centrum.cz>.
So does that mean that -- after shutting down master and then slave -- it's
not enough to start the slave again and that the master server must be then
started as well? Because, obviously, starting the master first isn't an
option as it might have older data than its slave, right?



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: H/A replication master slave

Posted by Justin Bertram <jb...@apache.org>.
From what I can tell everything is working as designed. As the
documentation [1] states:

    In the replication case, the backup just keeps waiting for a live
server to pair with. Note that in replication the backup server does not
know whether any data it might have is up to date, so it really cannot
decide to activate automatically. To activate a replicating backup server
using the data it has, the administrator must change its configuration to
make it a live server by changing <slave> to <master>.

One thing that's not specifically called out in the documentation is that
if the slave has existing data when it starts then it will copy that data
into a new directory prefixed with "oldreplica." This is discussed briefly
in reference to the "max-saved-replicated-journals-size" parameter. To be
clear, your data shouldn't be lost. If you find you want that data back
simply move it back to the proper data directory.


Justin

[1]
http://activemq.apache.org/components/artemis/documentation/latest/ha.html

On Mon, Jun 24, 2019 at 8:50 AM galoi <g....@tykelab.it> wrote:

> Hi, below my test:
> 1) start master and slave;
> 2) send two messages, stored on master;
> 3) stop master;
> 4) slave is live and it has 2 messages;
> 5) stop slave;
> 6) restart slave but i haven't previous messages;
>
> Thanks in advance for the help!
>
> Kind regards,
> Gianfranco Aloi
>
>
>
> --
> Sent from:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
>

Re: H/A replication master slave

Posted by galoi <g....@tykelab.it>.
Hi, below my test:
1) start master and slave;
2) send two messages, stored on master;
3) stop master;
4) slave is live and it has 2 messages;
5) stop slave;
6) restart slave but i haven't previous messages;

Thanks in advance for the help!

Kind regards,
Gianfranco Aloi 



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: H/A replication master slave

Posted by Justin Bertram <jb...@apache.org>.
I don't really understand what you mean by, "If the only node to start is
the slave, i lose all information in the queue." Can you elaborate on this?
How are you losing information?


Justin

On Mon, Jun 24, 2019 at 8:37 AM galoi <g....@tykelab.it> wrote:

> I'm using artemis ActiveMQ Artemis 2.9.0, and i configured two nodes master
> and slave in replication HA. View Below:
> <ha-policy>
>         <replication>
>                 <master>
>                         <check-for-live-server>true</check-for-live-server>
>                 </master>
>         </replication>
> </ha-policy>
>
> <ha-policy>
>         <replication>
>                 <slave>
>                         <allow-failback>true</allow-failback>
>                  </slave>
>         </replication>
> </ha-policy>
>
> When i stop the node master the slave to take the control.
> So far its ok, but when a stop too the slave, i have double point of
> failover.
> If the only node to start is the slave, i lose all information in the
> queue.
> How can i resolve it?
>
> Thanks in advance for the help!
>
> Kind regards,
> Gianfranco Aloi
>
>
>
> --
> Sent from:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
>