1 Reply Latest reply on Mar 1, 2018 12:45 PM by eztup

    java.io.FileNotFoundException: Error loading metadata for index file: segments_2n|M|Course

    nadeempasha

      0down votefavorite

       

       

      I tried running infinispan in two machines and persisted the index data in one machine. When i try to run simultaneously in 2 machines with indexing and persisting(cache-store) into the database, i am getting the following exception,

      Caused by: java.io.FileNotFoundException: Error loading metadata for index file: segments_2j|M|Course

      at org.infinispan.lucene.impl.DirectoryImplementor.openInput(DirectoryImplementor.java:134)

      at org.infinispan.lucene.impl.DirectoryLuceneV4.openInput(DirectoryLuceneV4.java:101)

      at org.apache.lucene.store.Directory.openChecksumInput(Directory.java:113)

      at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:341)

      at org.apache.lucene.index.StandardDirectoryReader$1.doBody(StandardDirectoryReader.java:57)

      at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:923)

      at org.apache.lucene.index.StandardDirectoryReader.open(StandardDirectoryReader.java:53)

      at org.apache.lucene.index.DirectoryReader.open(DirectoryReader.java:67)

      at org.hibernate.search.indexes.impl.SharingBufferReaderProvider.readerFactory(SharingBufferReaderProvider.java:131)

      at org.hibernate.search.indexes.impl.SharingBufferReaderProvider$PerDirectoryLatestReader.<init>(SharingBufferReaderProvider.java:206)

      at org.hibernate.search.indexes.impl.SharingBufferReaderProvider.createReader(SharingBufferReaderProvider.java:108)

      ... 24 more

       

      My infinispan config file is,

       

      <?xml version="1.0" encoding="UTF-8"?>
      <infinispan
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="urn:infinispan:config:7.2 http://www.infinispan.org/schemas/infinispan-config-7.2.xsd
        urn:infinispan:config:store:jdbc:7.2 http://www.infinispan.org/schemas/infinispan-cachestore-jdbc-config-7.2.xsd"
         xmlns="urn:infinispan:config:7.2"
         xmlns:jdbc="urn:infinispan:config:store:jdbc:7.2">

       

         <!-- *************************** -->
        <!-- 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="default-jgroups-tcp" path="my-jgroupsTcp.xml"/>

         </jgroups>

       

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

       

         <transport stack="default-jgroups-tcp"/>

       

         <!-- 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="ASYNC" async-marshalling="true">

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

         <transaction mode="NONE" />

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

         <write-behind />

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

         <jdbc:connection-pool connection-url="jdbc:mysql://192.168.1.52:3306/hsearch"
         driver="com.mysql.jdbc.Driver" username="un"
         password="pwd"></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="MEDIUMBLOB"/>

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

         </jdbc:string-keyed-table>

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

         </persistence>

         <indexing index="ALL"/>

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

         </replicated-cache>

       

       

       

       

         <!-- **************************** -->
        <!-- Cache to store Lucene data -->
        <!-- **************************** -->
         <distributed-cache name="LuceneIndexesData" mode="ASYNC" async-marshalling="true">

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

         <transaction mode="NONE"/>

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

         <write-behind />

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

         <jdbc:connection-pool connection-url="jdbc:mysql://192.168.1.52:3306/hsearch"
         driver="com.mysql.jdbc.Driver" username="un"
         password="pwd"></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="MEDIUMBLOB"/>

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

         </jdbc:string-keyed-table>

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

         </persistence>

         <indexing index="ALL"/>

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

         </distributed-cache>

       

         <!-- ***************************** -->
        <!-- Cache to store Lucene locks -->
        <!-- ***************************** -->
         <replicated-cache name="LuceneIndexesLocking" mode="ASYNC" async-marshalling="true">

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

         <transaction mode="NONE"/>

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

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

         <indexing index="ALL"/>

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

         </replicated-cache>

         </cache-container>

       

      </infinispan>