1 Reply Latest reply on Mar 23, 2018 5:23 PM by James Perkins

    Ho w to get HibernateSearch Infinispan JGroups ERROR logs using log4j.xml ?

    raju manikala Newbie

      Hi Team,

      I'm using WildFly-9.0.0 and in my application. I have created an entity and saved into the DB through hibernate entity manger with lucene indexing. When i search back the result am unable to find the search result back.We have used the infinispan Master-slave concept to do indexing. when I search any created object, I will get search result. Now I''m using two machines Master, Slave under AWS ELB, this time I did not get search result. Here I attached files which are I'm using in WAR file.

      <!-- Hibernate-Search-Infinispan-Config- -->

      <?xml version="1.0" encoding="UTF-8"?>

      <infinispan

          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

          xsi:schemaLocation="urn:infinispan:config:7.0 http://www.infinispan.org/schemas/infinispan-config-7.0.xsd

                              urn:infinispan:config:store:jdbc:7.0 http://www.infinispan.org/schemas/infinispan-cachestore-jdbc-config-7.0.xsd"

          xmlns="urn:infinispan:config:7.0"

          xmlns:jdbc="urn:infinispan:config:store:jdbc:7.0">

          <!-- *************************** -->

          <!-- System-wide global settings -->

          <!-- *************************** -->

          <jgroups>

              <!-- Note that the JGroups transport uses sensible defaults if no configuration

                  property is defined. See the JGroupsTransport javadocs for more flags.

                  jgroups-udp.xml is the default stack bundled in the Infinispan core jar: integration

                  and tuning are tested by Infinispan. -->

            <stack-file name="proform-jgroups" path="proform-infinispan-jgroups.xml" />

          </jgroups>

          <cache-container name="HibernateSearch" default-cache="default" statistics="false" shutdown-hook="DONT_REGISTER">

              <transport stack="proform-jgroups" cluster="ProFormInfinispanCluster"/>

              <!-- Duplicate domains are allowed so that multiple deployments with default configuration

                  of Hibernate Search applications work - if possible it would be better to use JNDI to share

                  the CacheManager across applications -->

              <jmx duplicate-domains="true" />

               <!-- *************************************** -->

               <!--  Cache to store Lucene's file metadata  -->

               <!-- *************************************** -->

               <replicated-cache name="LuceneIndexesMetadata" mode="SYNC" remote-timeout="25000">

                  <transaction mode="NONE"/>

                  <state-transfer enabled="true" timeout="480000" await-initial-transfer="true" />

                  <indexing index="NONE" />

                  <locking striping="false" acquire-timeout="10000" concurrency-level="500" write-skew="false" />

                  <eviction max-entries="-1" strategy="NONE"/>

                  <expiration max-idle="-1"/>

                  <persistence passivation="false">

                      <jdbc:string-keyed-jdbc-store preload="true" fetch-state="true" read-only="false" purge="false">

                          <property name="key2StringMapper">org.infinispan.lucene.LuceneKey2StringMapper</property>

                          <jdbc:connection-pool connection-url="jdbc:mysql://localhost:3306/hibernate_search" driver="com.mysql.jdbc.Driver" password="xxxx" username="user"></jdbc:connection-pool>

                          <jdbc:string-keyed-table drop-on-exit="false" create-on-start="true" prefix="ISPN_STRING_TABLE">

                              <jdbc:id-column name="ID" type="VARCHAR(255)"/>

                              <jdbc:data-column name="DATA" type="BLOB"/>

                              <jdbc:timestamp-column name="TIMESTAMP" type="BIGINT"/>

                          </jdbc:string-keyed-table>

                      </jdbc:string-keyed-jdbc-store>

                  </persistence>

               </replicated-cache>

               <!-- **************************** -->

               <!--  Cache to store Lucene data  -->

               <!-- **************************** -->

               <distributed-cache name="LuceneIndexesData" mode="SYNC" remote-timeout="25000">

                  <transaction mode="NONE"/>

                  <state-transfer enabled="true" timeout="480000" await-initial-transfer="true" />

                  <indexing index="NONE" />

                  <locking striping="false" acquire-timeout="10000" concurrency-level="500" write-skew="false" />

                  <eviction max-entries="-1" strategy="NONE"/>

                  <expiration max-idle="-1"/>

                  <persistence passivation="false">

                      <jdbc:string-keyed-jdbc-store preload="true" fetch-state="true" read-only="false" purge="false">

                          <property name="key2StringMapper">org.infinispan.lucene.LuceneKey2StringMapper</property>

                          <jdbc:connection-pool connection-url="jdbc:mysql://localhost:3306/hibernate_search" driver="com.mysql.jdbc.Driver" password="xxxx" username="user"></jdbc:connection-pool>

                          <jdbc:string-keyed-table drop-on-exit="false" create-on-start="true" prefix="ISPN_STRING_TABLE">

                              <jdbc:id-column name="ID" type="VARCHAR(255)"/>

                              <jdbc:data-column name="DATA" type="BLOB"/>

                              <jdbc:timestamp-column name="TIMESTAMP" type="BIGINT"/>

                          </jdbc:string-keyed-table>

                      </jdbc:string-keyed-jdbc-store>

                  </persistence>

               </distributed-cache>

               <!-- ***************************** -->

               <!--  Cache to store Lucene locks  -->

               <!-- ***************************** -->

              <replicated-cache name="LuceneIndexesLocking" mode="SYNC" remote-timeout="25000">

                  <transaction mode="NONE"/>

                  <state-transfer enabled="true" timeout="480000" await-initial-transfer="true" />

                  <indexing index="NONE" />

                  <locking striping="false" acquire-timeout="10000" concurrency-level="500" write-skew="false" />

                  <eviction max-entries="-1" strategy="NONE"/>

                  <expiration max-idle="-1"/>

                  <persistence passivation="false">

                      <jdbc:string-keyed-jdbc-store preload="true" fetch-state="true" read-only="false" purge="false">

                          <property name="key2StringMapper">org.infinispan.lucene.LuceneKey2StringMapper</property>

                          <jdbc:connection-pool connection-url="jdbc:mysql://localhost:3306/hibernate_search" driver="com.mysql.jdbc.Driver" password="xxxx" username="user"></jdbc:connection-pool>

                          <jdbc:string-keyed-table drop-on-exit="false" create-on-start="true" prefix="ISPN_STRING_TABLE">

                              <jdbc:id-column name="ID" type="VARCHAR(255)"/>

                              <jdbc:data-column name="DATA" type="BLOB"/>

                              <jdbc:timestamp-column name="TIMESTAMP" type="BIGINT"/>

                          </jdbc:string-keyed-table>

                      </jdbc:string-keyed-jdbc-store>

                  </persistence>

              </replicated-cache>

          </cache-container>

      </infinispan>

      <!--infinispan-jgroups  -->

      <config xmlns="urn:org:jgroups"

              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

              xsi:schemaLocation="urn:org:jgroups http://www.jgroups.org/schema/JGroups-3.6.xsd">

         <TCP bind_addr="${jgroups.bind_addr:127.0.0.1}"

              bind_port="${jgroups.tcp.port:7801}"

              enable_diagnostics="false"

              thread_naming_pattern="pl"

              send_buf_size="640k"

              sock_conn_timeout="300"

              thread_pool.min_threads="${jgroups.thread_pool.min_threads:2}"

              thread_pool.max_threads="${jgroups.thread_pool.max_threads:30}"

              thread_pool.keep_alive_time="60000"

              thread_pool.queue_enabled="false"

              internal_thread_pool.min_threads="${jgroups.internal_thread_pool.min_threads:5}"

              internal_thread_pool.max_threads="${jgroups.internal_thread_pool.max_threads:20}"

              internal_thread_pool.keep_alive_time="60000"

              internal_thread_pool.queue_enabled="true"

              internal_thread_pool.queue_max_size="500"

              oob_thread_pool.min_threads="${jgroups.oob_thread_pool.min_threads:20}"

              oob_thread_pool.max_threads="${jgroups.oob_thread_pool.max_threads:200}"

              oob_thread_pool.keep_alive_time="60000"

              oob_thread_pool.queue_enabled="false"

         />

          <S3_PING location="s3bucket" access_key="ACCESSKEY"

               secret_access_key="SECRETKEY" />

         <MERGE3 min_interval="10000"

                 max_interval="30000"

         />

         <FD_SOCK />

         <FD_ALL timeout="60000"

                 interval="15000"

                 timeout_check_interval="5000"

         />

         <VERIFY_SUSPECT timeout="5000" />

         <pbcast.NAKACK2 use_mcast_xmit="false"

                         xmit_interval="1000"

                         xmit_table_num_rows="50"

                         xmit_table_msgs_per_row="1024"

                         xmit_table_max_compaction_time="30000"

                         max_msg_batch_size="100"

                         resend_last_seqno="true"

         />

         <UNICAST3 xmit_interval="500"

                   xmit_table_num_rows="50"

                   xmit_table_msgs_per_row="1024"

                   xmit_table_max_compaction_time="30000"

                   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="15000"

         />

         <MFC max_credits="2m"

              min_threshold="0.40"

         />

         <FRAG2 />

      </config>

      <!-- jgroups  -->

      <!--

              TCP based stack, with flush, flow control and message bundling. This is usually used when IP

              multicasting cannot be used in a network, e.g. because it is disabled (routers discard multicast).

              Note that TCP.bind_addr and TCPPING.initial_hosts should be set, possibly via system properties, e.g.

              -Djgroups.bind_addr=192.168.5.2 and -Djgroups.tcpping.initial_hosts=192.168.5.2[7800]"

      -->

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

              xmlns="urn:org:jgroups"

              xsi:schemaLocation="urn:org:jgroups http://www.jgroups.org/schema/jgroups.xsd">

          <TCP bind_port="7800"/>

          <S3_PING location="s3bucket" access_key="ACCESSKEY"

               secret_access_key="SECRETKEY" />

          <!--  <TCPPING initial_hosts="${jgroups.tcpping.initial_hosts:localhost[7800]}"

                   port_range="1"/> -->

          <MERGE3/>

          <FD_SOCK/>

          <FD/>

          <VERIFY_SUSPECT/>

          <pbcast.NAKACK2 use_mcast_xmit="false"/>

          <UNICAST3/>

          <pbcast.STABLE/>

          <pbcast.GMS/>

          <MFC/>

          <FRAG2/>

          <pbcast.STATE_TRANSFER/>

          <pbcast.FLUSH timeout="0"/>

      </config>

      <!-- jboss-deployment-structure  -->

      <?xml version="1.0" encoding="UTF-8"?>

      <jboss-deployment-structure>

          <deployment>

              <!-- Exclusions allow you to prevent the server from automatically adding

                  some dependencies -->

              <exclusions>

                  <module name="org.apache.log4j" />

              </exclusions>

          </deployment>

      </jboss-deployment-structure>

      <!-- log4j.xml  -->

      <logger name ="org.jgroups">

              <level value="debug"/>

      </logger>

      <logger name ="org.infinispan">

              <level value="debug"/>

      </logger>

      <logger name ="org.hibernate">

              <level value="error"/>

      </logger>

      <root>

      <priority value="trace" />

      <appender-ref ref="fileAppender" />

      </root>

      Do I need to include any things in my configuration files?
      Thanks in advance.



        • 1. Re: Ho w to get HibernateSearch Infinispan JGroups ERROR logs using log4j.xml ?
          James Perkins Master

          Modules will never use the log configuration from your deployment. They always use what's defined in the logging subsystem for their configuration. You could just use the logging subsystem to configure logging which gives you the added benefit of allowing runtime changes.

           

          If you're just looking to turn on debug logging for Hibernate, Infinispan and JGroups the following CLI commands will enabled that (note too you could use the web console to define the loggers too):

          /subsystem=logging/logger=org.jgroups:add(level=DEBUG)
          /subsystem=logging/logger=org.infinispan:add(level=DEBUG)
          /subsystem=logging/logger=org.hibernate:add(level=DEBUG)
          

           

          Given the default configuration these debug messages would end up in the server.log.

           

          --

          James R. Perkins