1 2 Previous Next 22 Replies Latest reply on Sep 13, 2018 4:53 PM by oswaldo.santos Go to original post
      • 15. Re: WF11 Standalone-Full-HA Clustering on AWS Beanstalk
        pferraro

        ${env.EC2HOSTNAME} simply returns the value of the EC2HOSTNAME environment variable as evaluated by the WF standalone host controller.  The value is clearly not what you want, but without reading the documentation, I don't know how the external address is exposed.

        • 16. Re: WF11 Standalone-Full-HA Clustering on AWS Beanstalk
          alessandromoscatelli

          I don't think we understood each other.

           

          I am the one setting that environment variable, using :

           

          # EC2 METADATA

          export EC2HOSTNAME="$(curl http://169.254.169.254/latest/meta-data/local-hostname)"

           

          At the beginning of standalone.conf

           

          And that's exactly what I want.

          It's already working because my WF standalone servers are already in cluster.

           

          ${env.EC2HOSTNAME} is the hostname of the server running docker, so it's the EXTERNAL address (hostname to be accurate).

           

          JDBC_PING then resolves that external address and writes the external ip on the database.

           

          The ISSUE/POINT/PROBLEM is that for some reason I DO NOT know, activemq is NOT using the external address (hostname or ip, it doesn't really matter) written inside the ping_data but it's trying to resolve directly the hostname.

           

          I don't know if I wasn't clear.

           

          Summary :

           

          We have an internal hostname (docker container name, that can be resolved ONLY on that specific server), an external hostname (the ec2 server running docker server, this can be resolved without problem by everybody inside the beanstalk architecture) and an external ip address.

           

          JGroups is correctly using the external hostname specified in the TCP protocol, writes the external ip address in the PING_DATA, cluster is created and it's working (sessions are replicated etc etc), but ACTIVEMQ is trying to use directly the internalhostname that is also written in the PING_DATA but it refuses to use the external ip or external hostname known to JGroups.

          • 17. Re: WF11 Standalone-Full-HA Clustering on AWS Beanstalk
            alessandromoscatelli

            Is this a problem of integration between ActiveMQ Wildfly Module and JGroups Wildfly Module ?
            Should I open a JIRA ?

             

            Thank you for you answers

            • 18. Re: WF11 Standalone-Full-HA Clustering on AWS Beanstalk
              pferraro

              OK - I understand your setup now.  ActiveMQ doesn't store connectivity information via JDBC_PING - this is only used to store internal membership information for JGroups itself.  ActiveMQ merely uses JGroups as a transport over which broadcast/discovery is performed.  ActiveMQ itself needs to be configured to broadcast the correct "external address" - which has nothing to do with JGroups (it would be a problem with any broadcast endpoint implementation), but rather with your ActiveMQ configuration.  Can you post your full messaging-activemq subsystem configuration?

              • 19. Re: WF11 Standalone-Full-HA Clustering on AWS Beanstalk
                pferraro

                On second thought, I don't need to see the config - this should just be a matter of properly configuring the socket-binding associated with the connector being broadcast.  The definition of this socket-binding should include a <client-mapping/> that defines the desired "destination-address".  See: wildfly-core/jboss-as-config_1_2.xsd at master · wildfly/wildfly-core · GitHub

                 

                e.g.

                Given:

                <broadcast-group ... connectors="http-connector"/>
                

                And:

                <http-connector ... socket-binding="http"/>
                

                Then use:

                <socket-binding name="http" port="${jboss.http.port:8080}">
                    <client-mapping destination-address="${env.EC2HOSTNAME}"/>
                </socket-binding>
                
                • 20. Re: WF11 Standalone-Full-HA Clustering on AWS Beanstalk
                  alessandromoscatelli

                  Thank you very much.

                  That's the solution.

                   

                  Now I can say you can have a full wildfly cluster deployed in beanstalk, that's really good, but this wasn't easy.

                   

                  You have my gratitude.

                  • 21. Re: WF11 Standalone-Full-HA Clustering on AWS Beanstalk
                    yprajapa

                    Paul, it is great way to solve. I thought of using interface as another way to solve, will that be recommended approach or not?

                     

                        <interfaces>

                            <interface name="external">

                                <inet-address value="${jboss.bind.address.external:127.0.0.1}"/>

                            </interface>

                    .......................

                    .......................

                        </interfaces>

                     

                    Here "${jboss.bind.address.external}" is equivalent to "${env.EC2HOSTNAME}"

                     

                    And then socket binding:

                     

                    <socket-binding name="http" interface="external" port="${jboss.http.port:8080}"/>

                     

                    Also, curious if both "interface" and "client-mappings" specified, is that going to cause some issue?

                    • 22. Re: WF11 Standalone-Full-HA Clustering on AWS Beanstalk
                      oswaldo.santos

                      Hello Paul,

                       

                      I'm trying to enable Amazon ElastiCache to store our WF session in memcached or redis.

                      I never configured this before, I'm confused about the configuration and how I can configure this on WF.

                      Can you help me?

                      And after We try to use this with Auto-scaling.

                      Thank you.

                       

                      1 2 Previous Next