You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2020/06/03 03:55:54 UTC

[GitHub] [couchdb-docker] rkleine edited a comment on issue #8: [Feature Request] Provide Image with Clouseau / Fulltext Search

rkleine edited a comment on issue #8:
URL: https://github.com/apache/couchdb-docker/issues/8#issuecomment-637936896


   Hi, here is a simple docker-compose example using search plugin without any hack, just standard compose yaml.
   
   ```shell
   mkdir -p ./config/{couchdb,clouseau}
   ```
   
   **./config/clouseau/clouseau.ini**
   ```ini
   [clouseau]
   name=clouseau@127.0.0.1
   cookie=monster
   dir=/data
   max_indexes_open=500
   ```
   
   **./config/clouseau/log4j.properties**
   ```
   log4j.rootLogger=debug, CONSOLE
   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
   ```
   
   **./config/couchdb/local.ini**
   ```ini
   [couch_httpd_auth]
   secret = dev
   
   [admins]
   ; admin = admin
   admin = -pbkdf2-37aa363808ec5b83fc71cf2811479fbf1917f43d,2483e8ffe206819712f3bd1ba2308d41,10
   ```
   
   ```shell
   curl -sSL -o clouseau-2.17.0-dist.zip "https://github.com/cloudant-labs/clouseau/releases/download/2.17.0/clouseau-2.17.0-dist.zip
   ```
   Unizp clouseau-2.17.0-dist.zip in clouseau-2.17.0 
   
   **docker-compose.yml**
   This yaml expose 5984 to the host network, if you already using the 5984 change it on the yaml
   ```yaml
   version: '3.8'
   services:
     couchdb1:
       image: couchdb:3.1.0
       restart: always
       ports:
       - 5984:5984
       environment:
         - NODENAME=10.0.0.10
         - ERL_FLAGS=-setcookie monster
       volumes:
       - ./config/couchdb:/opt/couchdb/etc/local.d
       - ./data/couchdb/1:/opt/couchdb/data
       networks:
         couchdb-net:
           ipv4_address: 10.0.0.10
   
     clouseau1:
       image: openjdk:8
       command: >
         java -server
         -classpath '/app/*'
         -Xmx2G -Dsun.net.inetaddr.ttl=30
         -Dsun.net.inetaddr.negative.ttl=30
         -Dlog4j.configuration=file:/config/log4j.properties
         -XX:OnOutOfMemoryError="kill -9 %p"
         -XX:+UseConcMarkSweepGC
         -XX:+CMSParallelRemarkEnabled com.cloudant.clouseau.Main /config/clouseau.ini
       restart: always
       depends_on:
       - couchdb1
       volumes:
       - ./config/clouseau:/config
       - ./data/clouseau/1:/data
       - ./clouseau-2.17.0:/app
       network_mode: service:couchdb1
   
   networks:
     couchdb-net:
       name: couchdb-net
       driver: bridge
       ipam:
         config:
           - subnet: 10.0.0.0/24
   ```
   
   ```shell
   docker-compose up
   ```
   
   Check it http://127.0.0.1:5984
   
   The "trick" is the `network_mode: service:couchdb1` in the the service `clouseau1`. With this we are telling clouseau1 service to use the same network of `couchdb1` service. So the ports (4369/epmd) are mapped to the clouseau1 container. For simplicity I just deploy one node, but we more easily, join them and deploy a loadbalancer with nginx/haproxy.  


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org