-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker compose clouseau example #182
base: main
Are you sure you want to change the base?
Conversation
Nice! That’s a very welcome contribution. Will take a closer look later today. |
We might also want to put this into the CouchDB docs, @kocolosk . |
Yes that's a good idea @wohali. @rkleine, I'd like to pull a version of these instructions into the main README of the repo for greater visibility. I'm mulling over simplifying them by pointing to a pre-built Clouseau image instead of including all of the configuration files and instructions to assemble a working container from a vanilla OpenJDK image. Of course we don't have any official or semi-official image for Clouseau, so that complicates matters a bit. Will give it some thought. Just wanted to keep you posted. |
@kocolosk I'd only suggested a subdir because I assumed the files mentioned in here would go in there, separate to the README. We can def. put this in the README here as well as ensure they end up in the Docker official docs if you like, as well as the main CouchDB docs. |
Hi @kocolosk, Im using a local docker clouseau image. Maybe this save you some time ; ./etc/clouseau.ini
[clouseau]
name[email protected]
cookie=monster
dir=/var/lib/clouseau
max_indexes_open=500 # ./etc/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 # Dockerfile
FROM openjdk:8-alpine
RUN apk add --update unzip
RUN wget -q -O clouseau-2.17.0-dist.zip https://github.com/cloudant-labs/clouseau/releases/download/2.17.0/clouseau-2.17.0-dist.zip
RUN unzip clouseau-2.17.0-dist.zip
RUN rm -rf clouseau-2.17.0-dist.zip
RUN mkdir -p /opt/clouseau/etc
COPY etc /opt/clouseau/etc
CMD java -server \
-classpath '/clouseau-2.17.0/*' \
-Xmx2G -Dsun.net.inetaddr.ttl=30 \
-Dsun.net.inetaddr.negative.ttl=30 \
-Dlog4j.configuration=file:/opt/clouseau/etc/log4j.properties \
-XX:OnOutOfMemoryError="kill -9 %p" \
-XX:+UseConcMarkSweepGC \
-XX:+CMSParallelRemarkEnabled com.cloudant.clouseau.Main /opt/clouseau/etc/clouseau.ini # build
docker build --tag clouseau:2.17.0 --tag clouseau:latest . With # start couchdb
docker run --rm -p "5984:5984" --name couchdb -e COUCHDB_USER=admin -e COUCHDB_PASSWORD=admin -e NODENAME=127.0.0.1 -e ERL_FLAGS="-setcookie monster" couchdb:3.1.0
# start cluseau
docker run --rm --network=container:couchdb --name clouseau clouseau:2.17.0 Or with version: '3.8'
services:
couchdb1:
image: couchdb:3.1.0
restart: always
ports:
- 5984:5984
environment:
- COUCHDB_USER=admin
- COUCHDB_PASSWORD=admin
- NODENAME=127.0.0.1
- ERL_FLAGS=-setcookie monster
clouseau1:
image: clouseau:2.17.0
restart: always
depends_on:
- couchdb1
network_mode: service:couchdb1 docker-compose up # test
curl -sSL http://localhost:5984 | grep "search" |
@rkleine Would love to merge this. Can you unify this with the changes proposed in #186 - if needed? Alternately if you'd like to just put this directly in our documentation, I'd be happy to merge a PR in our repo there, https://github.com/apache/couchdb-documentation/pulls |
I tried to get it running the way @rkleine described. Definitely got much further than I did on my own :D
I'm not sure what's going on. It looks like it can indeed reach CouchDB is running fine in its container and I can successfully reach couch on localhost from within the
Any ideas? Update: Played around with https://hub.docker.com/r/kocolosk/couchdb-search which gives me the following errors: In the CouchDB container:
In the couchdb-search container:
|
This 100% worked with couchdb version 3.1.0, but if I bump to 3.3.2 I get this error:
I've removed the ERL_FLAGS=-setcookie monster and couchdb starts, but when I query the index I get this error:
|
Bring back the setcookie line. You need to set a cookie value other than "monster". |
Overview
Docker compose example with clouseau plugin
GitHub issue number
Fixed #8