How to connect JBoss EAP 7 to JBoss EAP 6 through CLI or vice versa?

Solution Verified - Updated

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.x
    • 7.x

Issue

  • I'm migrating my JBoss EAP 6.x to JBoss EAP 7.x and need to run my CLI scripts in both environments and the below error occurs:
Failed to connect to the controller: Server at xxxx.yyyy.zzz:1234 does not support http-remoting

Resolution

Connect to JBoss EAP 7.x through CLI from JBoss EAP 6.x in Standalone Mode

In standalone mode, JBoss EAP 7.x doesn't have the native-interface configured by default, only the http-interface. To access CLI on JBoss EAP 7.x from the previous version of JBoss EAP 6.x, you will need to create the native-interface for doing this connection:

Run CLI to create a socket-binding for native-interface:

/socket-binding-group=standard-sockets/socket-binding=management-native:add(interface=management,port=${jboss.management.native.port:9999})

Run CLI to create the native-interface:

/core-service=management/management-interface=native-interface:add(security-realm=ManagementRealm,socket-binding=management-native)

The result in standalone.xml file is:

......
<management-interfaces>
            <native-interface security-realm="ManagementRealm">
                <socket-binding native="management-native"/>
            </native-interface>
            <http-interface security-realm="ManagementRealm" http-upgrade-enabled="true">
                <socket-binding http="management-http"/>
            </http-interface>
</management-interfaces>
.....
   <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
        <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>	
       <socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9999}"/>
.....

To connect from JBoss EAP 6.x to JBoss EAP 7.x, use the command below:

$JBOSS_HOME/bin/jboss-cli.sh -c --controller=$IP_ADDRESS:$PORT

Connect to JBoss EAP 6.x through CLI from JBoss EAP 7.x in Standalone Mode

If your JBoss EAP 6.x runs with default port for native-interface 9999, you can use this command to connect from JBoss EAP 7.x to JBoss EAP 6.x through CLI:

$JBOSS_HOME/bin/jboss-cli.sh -c --controller=$IP_ADDRESS:9999

But if your JBoss EAP 6.x runs in different port, you will need to use this command to connect from JBoss EAP 7.x to JBoss EAP 6.x through CLI:

$JBOSS_HOME/bin/jboss-cli.sh -c --controller=remoting://$IP_ADDRESS:$PORT

Connect to JBoss EAP 6.x through CLI from JBoss EAP 7.x in Domain mode

If your JBoss EAP 6.x runs with default port for native-interface 9999, you can use this command to connect from JBoss EAP 7.x to JBoss EAP 6.x through CLI:

$JBOSS_HOME/bin/jboss-cli.sh -c --controller=$IP_ADDRESS:9999

But if your JBoss EAP 6.x runs in different port, you will need to use this command to connect from JBoss EAP 7.x to JBoss EAP 6.x through CLI:

$JBOSS_HOME/bin/jboss-cli.sh -c --controller=remoting://$IP_ADDRESS:$PORT

Connect to JBoss EAP 7.x through CLI from JBoss EAP 6.x in Domain mode

For any port configured in JBoss EAP 7.x for native-interface, this command can be used:

$JBOSS_HOME/bin/jboss-cli.sh -c --controller=$IP_ADDRESS:$PORT

Root Cause

JBoss EAP 7.x uses the protocol http-remoting by default, for CLI connection on the default port 9990, and when using port 9999, JBoss EAP 7.x changes automatically to protocol remoting.
When it changes the default CLI port to another different port like 9999 or 9990, the JBoss EAP 7.x tries to connect using his default protocol http-remoting, but this protocol is only supported in JBoss EAP 7.x. Thus, when trying to connect to JBoss EAP 6.x the below message appears:

    Server at xxxx.yyyy.zzz:1234 does not support http-remoting

To fix this issue, the protocol needs to be explicit in the CLI command.

Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.