3 Replies Latest reply: Feb 9, 2016 1:01 AM by Himanshu Mundeepi RSS

    Can someone provide a working JDBC_PING configuration?

    Eric B Newbie

      Hi,

       

      I've been struggling for 2 days to get JBoss AS6 cluster working using JDBC_PING, but everytime I start up JB, I get a dreaded error message:

       

      12:51:31,676 INFO  [JGroupsTransport] Unable to use any JGroups configuration mechanisms provided in properties {channelLookup=org.jboss.ha.ispn.DefaultCacheContainerFactory$ChannelFactoryChannelLookup, stack=tcp, channelFactory=org.jboss.ha.framework.server.JChannelFactory@3891a1, channelId=DefaultPartition-HAPartition}.  Using default JGroups configuration!

       

      From what I understand, the only change required is to a stock JBoss "all" configuration is the server/all/deploy/cluster/jgroups-channelfactory.sar/META-INF/jgroups-channelfactory-stacks.xml file, and to launch JBoss using -Djboss.default.jgroups.stack=tcp.

       

       

      Every combination I have tried keeps coming back with that same error message.

       

      If anyone has a working JDBC_PING configuration, can you please share the working configuration?  I would greatly appreciate it.


      Thanks!


      Eric

        • 1. Re: Can someone provide a working JDBC_PING configuration?
          Vítor Corrêa Newbie

          Hello Eric,

           

          Can you tell-me if when you're not using JDBC_PING on your tcp stack it works fine? it doesn't print this INFO message on your log?

          I had a similar trouble. In my case infinispan ( who instantiate the JChannel ) wasn't abble to handdle my stack.

          • 2. Re: Can someone provide a working JDBC_PING configuration?
            Radoslav Husar Master

            Hi Eric

             

            So AS6 is using the 2.6.x generation of JGroups, did you follow the documentation and set-up every required property?

             

            http://www.jgroups.org/manual/html_single/index.html#d0e4841

             

            Remember, you can either use datasource_jndi_name (and not worry) or specify each connection_* property separately.

             

            Let me know how that goes,

            Rado

            • 3. Re: Can someone provide a working JDBC_PING configuration?
              Himanshu Mundeepi Newbie

              <config xmlns="urn:org:jgroups" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                      xsi:schemaLocation="urn:org:jgroups file:schema/JGroups-3.4.xsd">

               

                      <!-- Note that the buffer sizes here are very small, you'll definitely want

                              higher values in production. But the Linux defaults are also very small,

                              and using higher values here without changing the system settings would only

                              result in startup warnings. -->

               

                      <TCP bind_addr="localhost" bind_port="7802" port_range="2"

                              recv_buf_size="20000000" send_buf_size="640000" loopback="false"

                              max_bundle_size="64k" bundler_type="old" enable_diagnostics="true"

                              thread_naming_pattern="cl" timer_type="new" timer.min_threads="1"

                              timer.max_threads="2" timer.keep_alive_time="3000"

                              timer.queue_max_size="1000" timer.wheel_size="200" timer.tick_time="50"

                              thread_pool.enabled="true" thread_pool.min_threads="1"

                              thread_pool.max_threads="2" thread_pool.keep_alive_time="5000"

                              thread_pool.queue_enabled="true" thread_pool.queue_max_size="100000"

                              thread_pool.rejection_policy="discard" oob_thread_pool.enabled="true"

                              oob_thread_pool.min_threads="1" oob_thread_pool.max_threads="2"

                              oob_thread_pool.keep_alive_time="5000" oob_thread_pool.queue_enabled="true"

                              oob_thread_pool.queue_max_size="100" oob_thread_pool.rejection_policy="discard" />

               

                      <!-- <MPING bind_addr="${jgroups.bind_addr:127.0.0.1}" break_on_coord_rsp="true"

                              mcast_addr="${jgroups.mping.mcast_addr:228.2.4.6}" mcast_port="${jgroups.mping.mcast_port:43366}"

                              ip_ttl="${jgroups.udp.ip_ttl:2}" num_initial_members="3" timeout="2000"/> -->

               

                      <!-- <TCPPING initial_hosts="localhost[7802]" port_range="2" timeout="3000"

                              num_initial_members="2" /> -->

               

                      <JDBC_PING connection_url="jdbc:mysql://localhost:3306/database_name"

                              connection_username="user" connection_password="password"

                              connection_driver="com.mysql.jdbc.Driver"

                              initialize_sql="CREATE TABLE IF NOT EXISTS JGROUPSPING_ABC (

                                     own_addr varchar(200) NOT NULL,

                                                  cluster_name varchar(200) NOT NULL,

                                                  ping_data varbinary(5000) DEFAULT NULL,

                                                  PRIMARY KEY (own_addr, cluster_name)

                                     )ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin"

               

                              insert_single_sql="INSERT INTO JGROUPSPING_ABC (own_addr, cluster_name, ping_data) values (?, ?, ?)"

                              delete_single_sql="DELETE FROM JGROUPSPING_ABC WHERE own_addr=? AND cluster_name=?"

                              select_all_pingdata_sql="SELECT ping_data FROM JGROUPSPING_ABC WHERE cluster_name=?" />

               

                      <MERGE2 max_interval="30000" min_interval="10000" />

                      <FD_SOCK />

                      <FD_ALL timeout="15000" />

                      <VERIFY_SUSPECT timeout="5000" />

                      <!-- Commented when upgraded to 3.1.0.Alpha (remove eventually) <pbcast.NAKACK

                              exponential_backoff="0" use_mcast_xmit="true" retransmit_timeout="300,600,1200"

                              discard_delivered_msgs="true"/> -->

               

                      <pbcast.NAKACK2 xmit_interval="1000"

                              xmit_table_num_rows="100" xmit_table_msgs_per_row="10000"

                              xmit_table_max_compaction_time="10000" max_msg_batch_size="100" />

               

                      <!-- Commented when upgraded to 3.1.0.Alpha (remove eventually) <UNICAST

                              timeout="300,600,1200"/> -->

               

                      <UNICAST2 stable_interval="5000" xmit_interval="500"

                              max_bytes="1m" xmit_table_num_rows="20" xmit_table_msgs_per_row="10000"

                              xmit_table_max_compaction_time="10000" max_msg_batch_size="100"

                              conn_expiry_timeout="0" />

               

                      <pbcast.STABLE stability_delay="500" desired_avg_gossip="5000"

                              max_bytes="1m" />

               

                      <pbcast.GMS print_local_addr="false" join_timeout="3000"

                              view_bundling="true" />

                      <UFC max_credits="200k" min_threshold="0.20" />

                      <MFC max_credits="200k" min_threshold="0.20" />

                      <FRAG2 frag_size="8000" />

                      <RSVP timeout="60000" resend_interval="500" ack_on_delivery="true" />

              </config>

               

               

              1. Create database and user in mysql.

               

                        $ mysql -u root -p

               

                             > CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';

                             > CREATE DATABASE database_name;

                             > GRANT ALL PRIVILEGES ON 'database_name' TO 'user'@'localhost';

                             > commit;

                             > FLUSH PRIVILEGES;

                             > commit;

                             > exit

               

              2. Make changes in database name field, connection_username & connection_password in Jgroups.xml file specified above.

               

              3. Now it will run smoothly.

               

              Please respond if find any difficulty.