Search code examples
jbosswildflyjboss-eap-7

How to failover DC when primary DC is down


I am using JBoss EAP 7 and testing DC failover according to this guide: https://access.redhat.com/solutions/1247783

Everything runs quite well until I stopped the DomainController and tried to connect the JBoss CLI to the Host1, I failed to make cli connection with host1 with the following error:

/opt/jboss-eap-7.0/bin/jboss-cli.sh --connect --controller=192.168.56.127:39999
Failed to connect to the controller: The controller is not available at 192.168.56.127:39999: java.net.ConnectException: WFLYPRT0053: Could not connect to http-remoting://192.168.56.127:39999. The connection failed: WFLYPRT0053: Could not connect to http-remoting://192.168.56.127:39999. The connection failed: Connection refused.

netstat -tpln shows port 39999 is active.

I think the host1 is not configured as DC, that's might be the reason why cli connection with it got error response, I think there might be some errors in host-slave.xml in host1, here is some abstract:

<domain-controller>
    <remote security-realm="ManagementRealm">
        <discovery-options>
            <static-discovery name="primary" protocol="${jboss.domain.master.protocol:remote}" host="192.168.56.11" port="${jboss.domain.master.port:9999}"/>
        </discovery-options>
    </remote>
</domain-controller>

I used the following shell to start host1:

/opt/jboss-eap-7.0/bin/domain.sh --backup \
-Djboss.domain.base.dir=/opt/mytest/m3/domain/ \
--host-config=host-slave.xml  \
-Djboss.bind.address.management=192.168.56.127 \
-Djboss.domain.master.address=192.168.56.11 \
-Djboss.management.native.port=39999

Can anyone show me some guide?

Best regards

Lan


Solution

    • This happens because, unless configured, the jboss-cli client tries to guess which protocol to use based on port number. Since JBoss EAP 7 uses http-remoting instead of remoting (used by JBoss EAP 6), when you use a non default native port the client guesses that it might be a JBoss EAP 7.

    Can you try to add a controller in your jboss-cli.xml file:

    <controllers> 
    <controller name="example"> 
    <protocol>remoting</protocol> 
    <host>host.example.com</host> 
    <port>39999</port> </controller> 
    </controllers>
    

    and pass the named controller in the --controller parameter to the jboss-cli.(sh|bat) script:

    ./jboss-cli.sh --connect --controller=example
    

    Alternatively, you can also pass the the protocol together with the controller location to avoid editing the jboss-cli.xml file:

    ./jboss-cli.sh --connect --controller=remoting://host.example.com:39999
    
    • JBoss EAP 7 is serving HTTP requests at 8080. Make sure that no other version/instance of server is up and running