Installation Couchdb Lucene - kwantu/platformconfiguration GitHub Wiki

back to installation...

Clouseau

  1. Install Clouseau 2.21.0
https://github.com/cloudant-labs/clouseau/releases/tag/2.21.0 
  1. Add additional jar files for logging purposes not shipped
log4j-1.2.14.jar
slf4j-log4j12-1.7.32.jar

Add log4j.properties  for logging configuration

log4j.rootLogger=CONSOLE, FILE
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} %c [%p] %m%n
log4j.appender.FILE =org.apache.log4j.FileAppender
log4j.appender.FILE.File=/opt/clouseau/log.out
log4j.appender.FILE.Threshold=warn
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
  1. Add a executable file clouseau under etc/
#!/bin/sh
/usr/bin/java -server \
     -Xmx2G \
     -Dsun.net.inetaddr.ttl=30 \
     -Dsun.net.inetaddr.negative.ttl=30 \
     -Dlog4j.configuration=file:/opt/clouseau/log4j.properties \
     -XX:OnOutOfMemoryError="kill -9 %p" \
     -XX:+UseConcMarkSweepGC \
     -XX:+CMSParallelRemarkEnabled \
     -classpath '/opt/clouseau/*' \
     com.cloudant.clouseau.Main \
     /opt/clouseau/clouseau.ini
  1. Indexes community bucket (_design/search)
userRole
assignee
activityRoleUser
title
sdo (Verify where it is used now)
list
 
Indexes at cache bucket (_design/search)
cache

This is now obsolete

Couchdb-lucene (rnewson)

This is the installation for the rnewson implementation of lucene for Couchdb.

There are some guidelines here

Please make sure that java is installed on the server. You can find the instructions here

Build couchdb-lucene application from sources

  1. Checkout the repository by git clone https://github.com/rnewson/couchdb-lucene.git ( Some breakage likely on master for a while. Use 1.1.0 release (https://github.com/rnewson/couchdb-lucene/releases/tag/v1.1.0) if you want stable.)
  2. Enter into the application root directory by the command : cd couchdb-lucene
  3. Run the command: mvn install
  4. Run the command: mvn
  5. Enter into the target folder you will find a tar and a zip folder.
  6. Unzip or Untar the folder and put it in /opt
  7. Rename the folder couchdb-lucene--dist.* to couchdb-lucene

Install from the kwantu installation environment.

  1. The kwantu environment is on our server kwantu4.kwantu.net.
  2. The folder is /willem/home/installation/couchdb-lucene
  3. Copy the file couchdb-lucene.tar.gz to the database server where couchdb is running
  4. Extract the contents of couchdb-lucene.tar.gz to the /opt/couchdb-lucene

Specify the configuration details

  1. Copy the startup script start-couchdb-lucene.sh to /opt
  2. Create the data directory where the index data will be stored: /usr/local/data/couchdb-lucene
  3. Update the configuration file in /opt/couchdb-lucene/conf/couchdb-lucene.ini replacing the ip address of the server running lucene and set the lucene user password

nnn.nnn.nnn.nnn is the server Ip address that lucene binds to.

[lucene]
# The output directory for Lucene indexes.
#dir=indexes
dir=/usr/local/data/couchdb-lucene/indexes

# The local host name that couchdb-lucene binds to
host=nnn.nnn.nnn.nnn

# The port that couchdb-lucene binds to.
port=5985

# Timeout for requests in milliseconds.
timeout=1200000

# Timeout for changes requests.
changes_timeout=600000

# Default limit for search results
limit=50

# Allow leading wildcard?
allowLeadingWildcard=true

# couchdb server mappings
[local]
url = http://{luceneUser}:{luceneUserPasswd}@nnn.nnn.nnn.nnn:8003/
  1. Create an administrator user called lucene with the password identified above in couchdb using the rest or fauxton interfaces
  2. Update the nginx settings so that /local/ redirects requests to the port specified on the database server.

Create the startup script

The following startup script can be created to start the lucene indexing service. /opt/start-couchdb-lucene.sh

cd /opt/couchdb-lucene
/opt/couchdb-lucene/bin/run &

When started up successfully it will show the following in the console:

[root@localhost opt]# 2019-02-02 14:43:42,696 INFO [Config] Index output goes to: /usr/local/data/couchdb-lucene/indexes
2019-02-02 14:43:42,776 INFO [Main] Accepting connections with ServerConnector@20398b7c{HTTP/1.1,[http/1.1]}{10.131.229.208:5985}

Update the nginx so that it points to the couchdb-lucene instance and port.

Remember to set the nginx redirect where nnn.nnn.nnn.nnn is the server Ip address that lucene binds to

upstream lucene5985 {
    server nnn.nnn.nnn.nnn:5985;
}
...
        location /local {
                proxy_set_header        ns_server-ui yes;
                proxy_pass              http://lucene5985;
                include /etc/nginx/proxy_default.conf;
        }
⚠️ **GitHub.com Fallback** ⚠️