This image can be used to run couchbase in swam mode with master and slave
4.2K
You can run the master by setting the environment variable to TYPE=MASTER. Once the master server is up, you an spin up workers by setting
TYPE=WORKER ( set the type of the node)
PERSIST_MASTER=persist-master.persist ( persist-master is the master hostname and '.persist' refers to the network name)
AUTO_REBALANCE=false ( setting the flag to true will automatically join and rebalance the cluster)
The workers will automatically join the cluster when they are initiated.
FROM ubuntu:14.04
MAINTAINER KNOWESIS Team [email protected]
LABEL system="PERSIST" LABEL version="2.7.0"
RUN apt-get update &&
apt-get install -yq runit wget python-httplib2 chrpath
lsof lshw sysstat net-tools numactl &&
apt-get autoremove && apt-get clean &&
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
ARG CB_VERSION=4.5.0 ARG CB_RELEASE_URL=http://packages.couchbase.com/releases ARG CB_PACKAGE=couchbase-server-community_4.5.0-ubuntu14.04_amd64.deb ARG CB_SHA256=7682b2c90717ba790b729341e32ce5a43f7eacb5279f48f47aae165c0ec3a633
ENV PATH=$PATH:/opt/couchbase/bin:/opt/couchbase/bin/tools:/opt/couchbase/bin/install
RUN groupadd -g 1000 couchbase && useradd couchbase -u 1000 -g couchbase -M
RUN wget -N $CB_RELEASE_URL/$CB_VERSION/$CB_PACKAGE &&
echo "$CB_SHA256 $CB_PACKAGE" | sha256sum -c - &&
dpkg -i ./$CB_PACKAGE && rm -f ./$CB_PACKAGE
COPY scripts/run /etc/service/couchbase-server/run
COPY scripts/dummy.sh /usr/local/bin/
RUN ln -s dummy.sh /usr/local/bin/iptables-save &&
ln -s dummy.sh /usr/local/bin/lvdisplay &&
ln -s dummy.sh /usr/local/bin/vgdisplay &&
ln -s dummy.sh /usr/local/bin/pvdisplay
RUN chrpath -r '$ORIGIN/../lib' /opt/couchbase/bin/curl
COPY scripts/entrypoint.sh / COPY configure-node.sh /opt/couchbase
#ENTRYPOINT ["/entrypoint.sh"] #CMD ["couchbase-server"] CMD ["/opt/couchbase/configure-node.sh"]
EXPOSE 8091 8092 8093 8094 11207 11210 11211 18091 18092 18093 18094 VOLUME /opt/couchbase/var
configure-node.sh
#!/bin/bash
set -x set -m
/entrypoint.sh couchbase-server &
sleep 15
curl -v -X POST http://127.0.0.1:8091/pools/default -d memoryQuota=300 -d indexMemoryQuota=300
#curl -v http://127.0.0.1:8091/node/controller/setupServices -d services=kv%2Cn1ql%2Cindex
curl -v http://127.0.0.1:8091/settings/web -d port=8091 -d username=Administrator -d password=changeit
curl -i -u Administrator:password -X POST http://127.0.0.1:8091/settings/indexes -d 'storageMode=memory_optimized'
#curl -v -u Administrator:password -X POST http://127.0.0.1:8091/sampleBuckets/install -d '["travel-sample"]'
echo "Type: $TYPE"
if [ "$TYPE" = "WORKER" ]; then echo "Sleeping ..." sleep 15
#IP=hostname -s
IP=hostname -I | cut -d ' ' -f1
echo "IP: " $IP
echo "Auto Rebalance: $AUTO_REBALANCE" if [ "$AUTO_REBALANCE" = "true" ]; then couchbase-cli rebalance --cluster=$PERSIST_MASTER:8091 --user=Administrator --password=changeit --server-add=$IP --server-add-username=Administrator --server-add-password=changeit else couchbase-cli server-add --cluster=$PERSIST_MASTER:8091 --user=Administrator --password=changeit --server-add=$IP --server-add-username=Administrator --server-add-password=changeit fi; fi;
fg 1
Content type
Image
Digest
sha256:c9f4154e8…
Size
330.5 MB
Last updated
over 3 years ago
docker pull knowesis/persist:7.1.1-k8