Troubleshooting the Document Indexer

From KnowledgeTree Community

Jump to: navigation, search

KnowledgeTree uses a Java-based document indexing service that stores metadata in a Lucene based search library.

When the document indexer is not running, metadata of documents cannot be placed in the search library, thereby excluding it from search results.

The following are recommended troubleshooting checks.


Contents

Check that Java Runtime Environment (JRE) is Installed

The Java Runtime Environment is required to run the indexing service. To check that Java is installed, open a terminal, and enter:

java -version.


It should give you a response like:

java version "1.6.0_10"
Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
Java HotSpot(TM) Server VM (build 11.0-b15, mixed mode)


For most Linux distros, java should be available from the repository, and is usually called sun-java5-jre or sun-java6-jre. Otherwise, it can be download from: http://www.java.com/en/download/manual.jsp

Update January 2010: On debian (and possible all debian-based distributions like Ubuntu, etc.) a java setting has changed that makes the lucene server register IPv6 addresses only. Knowledgetree cannot connect to the indexer any more. Find the bug report here: [1]. The solution is to run this as root: 'echo 0 > /proc/sys/net/ipv6/bindv6only' (but this will only last until the next reboot).

Check that Path to indices location is correct

Open <your_knowledgetree_installation>/bin/luceneserver/KnowledgeTreeIndexer.properties

It has four lines:

server.port=8875
server.paranoid=true
server.accept=127.0.0.1,192.168.1.1
indexer.directory=../../../var/indexes


Check that indexer.directory points to the correct location. If you are using a source only install, modify the value of indexer.directory by removing the first ../

indexer.directory=../../var/indexes


This should also be modified if you decided to place the indices anywhere else


Starting Indexing Service

Open a terminal and go to <your_knowledgetree_installation>/bin/luceneserver/

Eg. cd /var/www/knowledgetree/bin/luceneserver


Then enter:

java -jar ktlucene.jar&


The apostraphe (&) at the end ensures that the indexing service runs as a background.

If it says:

1    [main] INFO  com.knowledgetree  - Indexing Server starting up...
36   [main] INFO  com.knowledgetree  - Loading properties file: KnowledgeTreeIndexer.properties
68   [main] INFO  com.knowledgetree  - Using index directory: ../../var/indexes
128  [main] INFO  com.knowledgetree  - Starting: Tue Nov 11 12:39:01 SAST 2008
128  [main] INFO  com.knowledgetree  - Client IPs: 127.0.0.1,192.168.1.1,192.168.1.91
128  [main] INFO  com.knowledgetree  - Max query result: 100
128  [main] INFO  com.knowledgetree  - Result fragments: 3
128  [main] INFO  com.knowledgetree  - Result fragment seperator: ...
128  [main] INFO  com.knowledgetree  - Result fragment size: 40
434  [main] INFO  com.knowledgetree  - Server in paranoid mode!
440  [main] INFO  com.knowledgetree  -     Accepting connections from: 127.0.0.1
441  [main] INFO  com.knowledgetree  -     Accepting connections from: 192.168.1.1
441  [main] INFO  com.knowledgetree  -     Accepting connections from: 192.168.1.91
458  [main] INFO  com.knowledgetree  - Starting web server on port: 8875


then the indexing service has been successfully started, and is running. Another way to check that the service is running, is by entering:

ps -aux | grep lucene

or

netstat -an | grep 8875


Indexing Service Error Message

If you encounter the following message:

0    [main] INFO  com.knowledgetree  - Indexing Server starting up...
6    [main] INFO  com.knowledgetree  - Loading properties file: KnowledgeTreeIndexer.properties
7    [main] INFO  com.knowledgetree  - Using index directory: ../../../var/indexes
Exception in thread "main" java.lang.Exception: Invalid index directory specified: ../../../var/indexes
    at com.knowledgetree.lucene.core.IndexerManager.<init>(IndexerManager.java:173)

    at com.knowledgetree.lucene.core.IndexerManager.get(IndexerManager.java:104)
    at com.knowledgetree.lucene.KTLuceneServer.main(KTLuceneServer.java:28)


It means the path to the indexing location is incorrect. Open KnowledgeTreeIndexer.properties as described above, modify indexer.directory, and try again.


Permission Denied Message

If you encounter the following message:

3016 [XML-RPC-0] ERROR com.knowledgetree  - /opt/lampp/htdocs/knowledgetree_oss/var/tmp/ktindexerMcyn6B (Permission denied)
3512 [XML-RPC-0] ERROR com.knowledgetree  - /opt/lampp/htdocs/knowledgetree_oss/var/tmp/ktindexerOZPIVM (Permission denied)


Either the <your_knowledgetree_installation>/var/indexes folder is not writeable, or you need to run the service as the 'web/apache' user. The 'web/apache user' is either 'www-data' or 'nobody'.


Ubuntu Users: To start the service as that user, ensure that you are in the <your_knowledgetree_installation>/bin/luceneserver/ directory, then do the following:

sudo su www-data
{may ask for your password}
java -jar ktlucene.jar&
exit


Cron Job

Starting the indexer is only the first step. The next step is to ensure that periodic updates get run to feed data into the indexer.


For more information on this, see Scheduler

Personal tools