6 Replies Latest reply on Aug 23, 2012 3:59 PM by akostadinov

    S3_PING Configuration

    benashmead

      Hi,

       

      Is it possible to configure a clustered JBoss AS7 setup to use S3_PING for host discovery? Documentation seems to be thin on the ground, and I can't quite figure out how to specify things like the access key or bucket name.

       

      I've set the default transport stack to 'tcp' in my domain.xml:

       

       

      <subsystem xmlns="urn:jboss:domain:jgroups:1.0" default-stack="tcp">

       

       

      And I'm assuming that I need to change the discovery protocol type from 'MPING' to 'S3_PING' also, i.e.

       

      <stack name="tcp">

                          <transport type="TCP" socket-binding="jgroups-tcp" diagnostics-socket-binding="jgroups-diagnostics"/>

                          <protocol type="S3_PING"/>

       

      But then I get lost. Where do I specify the S3 bucket name, my credentials, etc?


        • 1. Re: S3_PING Configuration
          tsarnowski

          Hi,

           

          JBoss uses the JGroups library for cluster discovery. Have a look at JGroups' documentation. I don't know if JBoss uses JGroups 2 or 3 but I think there aren't that much differences for the configuration:

          http://jgroups.org/manual-3.x/html/protlist.html#d0e4561

          • 2. Re: S3_PING Configuration
            benashmead

            Yup, those are the configuration details I'm looking to enter - the question is, where do they go?

             

            If I add them as parameters to the S3_PING section of domain.xml, then JBoss throws errors on startup, saying that they're unrecognised arguments.

            • 3. Re: S3_PING Configuration
              kazaag

              Inside the protocol element you can include several property element.

               

              The property element must have a name attribute which match the protocole perperty you need to set.  The value of the property is the content of the property element.

               

              <protocol name="S3_PING">

                   <property name="access_key">

                        thekeyvalue

                   </property>

                   ...

              </protocol>

              • 4. Re: S3_PING Configuration
                benashmead

                Brilliant, that seems to work perfectly - thank you very much

                 

                Which moves me on to my next problem..

                 

                This seems to work fine for the first node in the cluster - I see a 'web' folder getting created in the S3 bucket, and there's an identifier file being uploaded. The second node fails, however - looks like it's timing out, for some reason:

                 

                [Server:jboss2-server] 04:31:44,217 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.jgroups.channel.web: org.jboss.msc.service.StartException in service jboss.jgroups.channel.web: java.net.ConnectException: Connection timed out

                 

                Any ideas why one would work, but the other wouldn't? I would think that the configuration is the same across both nodes, as all the S3 details are in domain.xml, and the managed domain setup seems to be working without issue.

                • 5. Re: S3_PING Configuration
                  benashmead

                  Never mind, figured it out by poking through the S3 logs. The node that was working had an elastic IP assigned, and the one that was failing didn't. Associated an elastic IP with both instances, everything's working as expected.

                  1 of 1 people found this helpful
                  • 6. Re: S3_PING Configuration
                    akostadinov

                    but elastic IPs somehow defeat the point in having dicovery protocol.. you may try using a NAT instance if your instances are running inside a VPC and that way you can add more cluster nodes without adding more elastic IPs.