7 Replies Latest reply on Feb 27, 2017 3:02 PM by meetoblivion

    JGroups JDBC_PING not working

    meetoblivion

      Hi,

       

      I'm trying to get JDBC_PING working on a Wildfly 10.1 instance.  This is how I configured my subsystem:

       

              <subsystem xmlns="urn:jboss:domain:jgroups:4.0">

                  <channels default="ee">

                      <channel name="ee" stack="tcp"/>

                  </channels>

                  <stacks>

                      <stack name="udp">

      ... default

                      </stack>

                      <stack name="tcp">

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

                          <!--<protocol type="MPING" socket-binding="jgroups-mping"/>-->

                          <!--<protocol type="MERGE3"/>-->

                          <!--<protocol type="FD_SOCK" socket-binding="jgroups-tcp-fd"/>-->

                          <!--<protocol type="FD"/>-->

                          <!--<protocol type="VERIFY_SUSPECT"/>-->

                          <!--<protocol type="pbcast.NAKACK2"/>-->

                          <!--<protocol type="UNICAST3"/>-->

                          <!--<protocol type="pbcast.STABLE"/>-->

                          <!--<protocol type="pbcast.GMS"/>-->

                          <!--<protocol type="MFC"/>-->

                          <!--<protocol type="FRAG2"/>-->

                          <protocol type="JDBC_PING">

                              <property name="datasource_jndi_name">java:jboss/datasources/KeycloakDS</property>

                          </protocol>

                      </stack>

                  </stacks>

              </subsystem>

       

       

       

      I'm basically trying to run Keycloak w/ JDBC Ping enabled.  I've switched it to use tcp.  The problem is that I never see the port binding come up.

       

          <interfaces>

              <interface name="management">

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

              </interface>

              <interface name="public">

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

              </interface>

              <interface name="private">

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

              </interface>

              <interface name="unsecure">

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

              </interface>

          </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-https" interface="management" port="${jboss.management.https.port:9993}"/>

              <socket-binding name="ajp" port="${jboss.ajp.port:8009}"/>

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

              <socket-binding name="https" port="${jboss.https.port:8443}"/>

              <socket-binding name="jgroups-mping" interface="private" port="0" multicast-address="${jboss.default.multicast.address:230.0.0.4}" multicast-port="45700"/>

              <socket-binding name="jgroups-tcp" interface="private" port="7600"/>

              <socket-binding name="jgroups-tcp-fd" interface="private" port="57600"/>

              <socket-binding name="jgroups-udp" interface="private" port="55200" multicast-address="${jboss.default.multicast.address:230.0.0.4}" multicast-port="45688"/>

              <socket-binding name="jgroups-udp-fd" interface="private" port="54200"/>

              <socket-binding name="modcluster" port="0" multicast-address="224.0.1.105" multicast-port="23364"/>

              <socket-binding name="txn-recovery-environment" port="4712"/>

              <socket-binding name="txn-status-manager" port="4713"/>

       

      So I was wondering, is there something else I have to do to get tcp working?  I'm expecting to see the table created and the port be in use (7600).  There is nothing else listening on that port.

        • 1. Re: JGroups JDBC_PING not working
          belaban

          Why did you comment all the other protocols? You should take the "tcp" stack and only replace MPING with JDBC_PING.

          Once you do that, are there any errors when Wildfly starts up?

          • 2. Re: JGroups JDBC_PING not working
            meetoblivion

            Hi Bela, thanks for the response.

             

            I thought about that being the issue, so I actually went back to a plain OOTB standalone-ha.xml.  I switched that to use the TCP stack.  While I see the log messages about JGroups subsystem starting, I'm never actually seeing the TCP port (7600) starting.  Is that expected?

            • 3. Re: JGroups JDBC_PING not working
              pferraro

              In WildFly, JGroups channels are connected lazily, so you won't see any TCP connections until you deploy a distributed application.

              • 4. Re: JGroups JDBC_PING not working
                meetoblivion

                Hmm that would explain it, however as far as I know keycloak is distributable.  I retried with the keycloak distribution and these settings

                 

                                <subsystem xmlns="urn:jboss:domain:jgroups:4.0">

                            <channels default="ee">

                                <channel name="ee" stack="tcp"/>

                            </channels>

                            <stacks>

                                <stack name="tcp">

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

                                    <protocol type="MERGE3"/>

                                    <protocol type="FD_SOCK" socket-binding="jgroups-tcp-fd"/>

                                    <protocol type="FD"/>

                                    <protocol type="VERIFY_SUSPECT"/>

                                    <protocol type="pbcast.NAKACK2"/>

                                    <protocol type="UNICAST3"/>

                                    <protocol type="pbcast.STABLE"/>

                                    <protocol type="pbcast.GMS"/>

                                    <protocol type="MFC"/>

                                    <protocol type="FRAG2"/>

                                    <protocol type="JDBC_PING">

                                        <property name="datasource_jndi_name">java:jboss/datasources/KeycloakDS</property>

                                    </protocol>

                                </stack>

                            </stacks>

                        </subsystem>

                 

                And I'm still not seeing the port come up.

                • 5. Re: JGroups JDBC_PING not working
                  emag

                  Hi, why don't you try normal TCPPING instead of JDBC_PING for clarification?

                   

                  I tried the following settings and it works though the Keycloak 2 nodes are on the same machine. I tested it Keyclaok 2.5.4.Final.

                   

                  ---

                  <stack name="tcp">

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

                    <protocol type="TCPPING">

                      <property name="initial_hosts">127.0.0.1[7600],127.0.0.1[7700]</property>                                                                                                                  

                    </protocol>

                    <protocol type="MERGE3"/>

                    <protocol type="FD_SOCK" socket-binding="jgroups-tcp-fd"/>

                    <protocol type="FD"/>

                    <protocol type="VERIFY_SUSPECT"/>

                    <protocol type="pbcast.NAKACK2"/>

                    <protocol type="UNICAST3"/>

                    <protocol type="pbcast.STABLE"/>

                    <protocol type="pbcast.GMS"/>

                    <protocol type="MFC"/>

                    <protocol type="FRAG2"/>

                  </stack>

                  ---

                   

                  And I noticed your jgroups protocol stack order is not valid. JDBC_PING should be the top element. your settings perhaps occurs protocol settings error.

                  • 6. Re: JGroups JDBC_PING not working
                    emag

                    I tested the following settings with 2 Keycloak nodes on the same machine(using PostgreSQL), and it works.

                     

                    ---

                    <stack name="tcp">

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

                      <protocol type="JDBC_PING">                                                                                                                                                                   

                        <property name="datasource_jndi_name">java:jboss/datasources/KeycloakDS</property>

                      </protocol>

                      <protocol type="MERGE3"/>

                      <protocol type="FD_SOCK" socket-binding="jgroups-tcp-fd"/>

                      <protocol type="FD"/>

                      <protocol type="VERIFY_SUSPECT"/>

                      <protocol type="pbcast.NAKACK2"/>

                      <protocol type="UNICAST3"/>

                      <protocol type="pbcast.STABLE"/>

                      <protocol type="pbcast.GMS"/>

                      <protocol type="MFC"/>

                      <protocol type="FRAG2"/>

                    </stack>

                    ---

                    • 7. Re: JGroups JDBC_PING not working
                      meetoblivion

                      The order of JDBC_PING was the root of my issue.  After Thanks!