Code Monkey home page Code Monkey logo

docker-couchbase's Introduction

Deploying Multiple Couchbase Server Containers on One Physical Machine

Run the following commands in terminal

docker run -d --name db1 couchbase
docker run -d --name db2 couchbase
docker run -d --name db3 -p 8091-8094:8091-8094 -p 11210:11210 couchbase

Check the Docker logs to verify that the containers have started:

docker logs db1
docker logs db2
docker logs db3

If the containers have started, all the above commands should return the following output:

Starting Couchbase Server -- Web UI available at http://<ip>:8091
Note: If Couchbase Server is running locally on the machine without containers, the port mappings above under the -p option may fail. Ensure that you stop your local instance of Couchbase Server before running the above command

Run docker inspect to discover the local IP addresses for each container. You will need the IP addresses for db1 and db2 to set up the 3 node Couchbase Server cluster. The initial cluster setup will automatically pick up the IP address for db3.

docker inspect --format '{{ .NetworkSettings.IPAddress }}' db1
docker inspect --format '{{ .NetworkSettings.IPAddress }}' db2

From the browser, access the Web Console using http://localhost:8091. You are now connected to container named db3. If the container is up and running, you will see the Couchbase Server Setup Screen.

Walk through the Setup wizard and accept the default values, you may switch off the Analytics Service if you're facing shortage of RAM

Next, we need to add the db1 and db2 containers to the cluster.

On the Web Console, go to the Server Nodes tab and click Add Server and specify the IP address you captured for db1.

Click Add Server again and specify the IP address you captured for db2

Click Rebalance.

This is all that is needed for a multi-node Couchbase Server cluster deployment using a single physical machine.

Setting up data

Create a bucket in the couchbase with name cachestore by navigating to buckets menu and then clicking on ADD BUCKET located at the top of the screen. Now go to the query menu and run the following query

INSERT INTO `cachestore` (KEY, VALUE) VALUES ("key1", "somevalue1")

docker-couchbase's People

Contributors

patravishek avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.