最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

high availability - activemq artemis 2.19.1 hafailover(two server-- one is live and other is backup) - Stack Overflow

programmeradmin9浏览0评论

USE CASE:-- 1.we have one app which run in two server DP1 AND DP2 2.both dp1 and dp2 using embedded EmbeddedActiveMQ.java api to run apache activemq artemis. 3.if i start dp1 1st then it is become live server and dp2 become backup and vice versa 4.now i shutdown dp1 then dp2 become live and as i start dp1 it behave as backup till dp2 not fail. 5.in this case of artemis after fail of dp1, dp2 is not behaving as live server. because after failover of dp1 , dp2 is not get activate .i am checking like this and always traped into loop never come out from the loop.

while (!jmsServer.getActiveMQServer().waitForActivation(30L,TimeUnit.SECONDS)) { Thread.sleep(100);

    }

6.API using for live and backup server

    if (isCurrentServerLive){
        ReplicatedPolicyConfiguration haPolicy = new ReplicatedPolicyConfiguration();
        haPolicy.setGroupName("bsm-back-up-group");
        haPolicy.setInitialReplicationSyncTimeout(120000);
        haPolicy.setCheckForLiveServer(true);  // Critical for failover detection
        haPolicy.setQuorumSize(1);  // Minimum nodes required
        configuration.setHAPolicyConfiguration(haPolicy);
     }else{
        ReplicaPolicyConfiguration haPolicy = new ReplicaPolicyConfiguration();
        haPolicy.setGroupName("bsm-back-up-group");
        haPolicy.setInitialReplicationSyncTimeout(120000);
        haPolicy.setRestartBackup(false);  // Don't restart when live exists
        haPolicy.setAllowFailBack(true);  // Allow primary to resume
        configuration.setHAPolicyConfiguration(haPolicy);;

      }

i need your suggestion to make it work . and thanks in advance for your help.

发布评论

评论列表(0)

  1. 暂无评论