{"id":2383,"date":"2017-01-06T08:32:58","date_gmt":"2017-01-06T08:32:57","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=2383"},"modified":"2023-05-19T04:05:27","modified_gmt":"2023-05-19T11:05:27","slug":"docker-service-swarm-mode-couchbase-cluster","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/docker-service-swarm-mode-couchbase-cluster\/","title":{"rendered":"Docker Service and Swarm Mode to Create Couchbase Cluster"},"content":{"rendered":"<p>Docker 1.12 introduced <a href=\"https:\/\/www.couchbase.com\/blog\/docker-services-stack-distributed-application-bundle\/\">Services<\/a>.\u00a0A replicated, distributed and load balanced service can be easily created using <code>docker service create<\/code> command. A &#8220;desired state&#8221; of the application, such as run 3 containers of Couchbase, is provided and the self-healing Docker engine ensures that that many containers are running in the cluster. If a container goes down, another container is started.<br \/>\nIf a node goes down, containers on that node are started on a different node. This blog will show how to setup a Couchbase cluster using Docker Services. Many thanks to <a href=\"https:\/\/twitter.com\/marcosnils\">@marcosnils<\/a>, another fellow <a href=\"https:\/\/www.docker.com\/community\/docker-captains\">Docker Captain<\/a>,<br \/>\nto help me debug the networking!<\/p>\n<h2>Couchbase Cluster<\/h2>\n<p>A cluster of Couchbase Servers is typically deployed on commodity servers. Couchbase Server has a peer-to-peer topology where all the nodes are equal and communicate to each other on demand. There is no concept of master nodes, slave nodes, config nodes,<br \/>\nname nodes, head nodes, etc, and all the software loaded on each node is identical. It allows the nodes to be added or removed without considering their \u201ctype\u201d. This model works particularly well with cloud infrastructure in general.<\/p>\n<div>A typical Couchbase cluster creation process looks like:<\/div>\n<div>\n<ul>\n<li>Start Couchbase: Start n Couchbase servers<\/li>\n<li>Create cluster: Pick any server, and add all other servers to it to create the cluster<\/li>\n<li>Rebalance cluster: Rebalance the cluster so that data is distributed across the cluster<\/li>\n<\/ul>\n<\/div>\n<div>In order to automate using Docker Services, the cluster creation is split into a \u201cmaster\u201d and \u201cworker\u201d service.<\/div>\n<div><a href=\"\/wp-content\/original-assets\/september-2016\/docker-service-and-swarm-mode-to-create-couchbase-cluster\/docker-service-couchbase-cluster-1024x521.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-14254\" src=\"\/wp-content\/original-assets\/september-2016\/docker-service-and-swarm-mode-to-create-couchbase-cluster\/docker-service-couchbase-cluster-1024x521.png\" alt=\"docker-service-couchbase-cluster\" width=\"604\" height=\"307\" \/><\/a><\/div>\n<div><\/div>\n<div>The master service\u00a0has only one replica. This provides a single reference point to start the cluster creation. This service also exposes port 8091. It\u00a0allows the\u00a0<a href=\"https:\/\/developer.couchbase.com\/documentation\/server\/current\/admin\/ui-intro.html\">Couchbase Web Console<\/a>\u00a0to<br \/>\nbe accessible from outside the cluster.<\/div>\n<div><\/div>\n<div>The worker service\u00a0uses the exact same image as master service. This keeps the cluster homogenous which allows to scale the cluster easily.<\/div>\n<div><\/div>\n<div>Let&#8217;s get started!<\/div>\n<div><\/div>\n<h2>Setup Swarm Mode on Ubuntu<\/h2>\n<ol>\n<li>Launch an Ubuntu instance on Amazon. This blog used <code>mx4.large<\/code>\u00a0size for the AMI.<\/li>\n<li>Install Docker:\n<pre class=\"lang:default decode:true\">curl -sSL https:\/\/get.docker.com\/ | sh<\/pre>\n<\/li>\n<li><a href=\"https:\/\/docs.docker.com\/engine\/swarm\/\">Docker Swarm mode<\/a> is an optional feature and need to be\u00a0explicitly enabled. Initialize Swarm mode:\n<pre class=\"lang:default decode:true\">docker swarm init<\/pre>\n<\/li>\n<\/ol>\n<h2>Create Couchbase &#8220;master&#8221; Service<\/h2>\n<ol>\n<li>Create an overlay network:\n<pre class=\"lang:default decode:true\">docker network create -d overlay couchbase<\/pre>\n<p>This is\u00a0required so that multiple Couchbase Docker containers in the cluster can talk to each\u00a0other.<\/li>\n<li>Create a &#8220;master&#8221; service:\n<pre class=\"lang:default decode:true\">docker service create --name couchbase-master -p 8091:8091 --replicas 1 --network couchbase -e TYPE=MASTER arungupta\/couchbase:swarm<\/pre>\n<div>This image is created using the Dockerfile\u00a0<a href=\"https:\/\/github.com\/arun-gupta\/docker-images\/blob\/master\/couchbase\/Dockerfile\">here<\/a>. This Dockerfile uses a\u00a0<a href=\"https:\/\/github.com\/arun-gupta\/docker-images\/blob\/master\/couchbase\/configure-node.sh\">configuration script<\/a>\u00a0to<br \/>\nconfigure the base Couchbase Docker image. First, it uses\u00a0<a href=\"https:\/\/developer.couchbase.com\/documentation\/server\/current\/rest-api\/rest-endpoints-all.html\">Couchbase REST API<\/a>\u00a0to setup memory quota, setup index, data and<br \/>\nquery services, security credentials, and loads a sample data bucket. Then, it invokes the appropriate\u00a0<a href=\"https:\/\/developer.couchbase.com\/documentation\/server\/current\/cli\/cbcli-intro.html\">Couchbase CLI<\/a>\u00a0commands to add the<br \/>\nCouchbase node to the cluster or add the node and rebalance the cluster. This is based upon three environment variables:<\/div>\n<div>\n<ul>\n<li><code>TYPE<\/code>: Defines whether the joining pod is worker or master<\/li>\n<li><code>COUCHBASE_MASTER<\/code>: Name of the master service<\/li>\n<li><code>AUTO_REBALANCE<\/code>: Defines whether the cluster needs to be rebalanced<\/li>\n<\/ul>\n<\/div>\n<div>For this first configuration file, the\u00a0TYPE\u00a0environment variable is set to\u00a0MASTER\u00a0and so no additional configuration is done on the Couchbase image.<\/div>\n<p>This service also uses the previously created overlay network named <code>couchbase<\/code>. It exposes the port 8091 that makes the <a href=\"https:\/\/developer.couchbase.com\/documentation\/server\/current\/admin\/ui-intro.html\">Couchbase Web Console<\/a> accessible outside the cluster. This service contains only one replica of the container.<\/li>\n<li>Check status of the Docker service:\n<pre class=\"lang:default decode:true\">ubuntu@ip-172-31-26-234:~$ docker service ls\r\nID            NAME              REPLICAS  IMAGE                      COMMAND\r\ncecl1rl5ecyr  couchbase-master  1\/1       arungupta\/couchbase:swarm<\/pre>\n<p>It shows that the service is running. The &#8220;desired&#8221; and &#8220;expected&#8221; number of replicas are 1, and thus are matching.<\/li>\n<li>Check the tasks in the service:\n<pre class=\"lang:default decode:true\">ubuntu@ip-172-31-26-234:~$ docker service ps couchbase-master\r\nID                         NAME                IMAGE                      NODE              DESIRED STATE  CURRENT STATE           ERROR\r\n2xuw1h0jvantsgj9f8zuj03k8  couchbase-master.1  arungupta\/couchbase:swarm  ip-172-31-26-234  Running        Running 30 seconds ago<\/pre>\n<p>This shows that the container is running.<\/li>\n<li>Access\u00a0Couchbase Web Console using public IP address and it should look like:<br \/>\n<a href=\"\/wp-content\/original-assets\/september-2016\/docker-service-and-swarm-mode-to-create-couchbase-cluster\/docker-service-couchbase-login-1024x474.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-14256\" src=\"\/wp-content\/original-assets\/september-2016\/docker-service-and-swarm-mode-to-create-couchbase-cluster\/docker-service-couchbase-login-1024x474.png\" alt=\"docker-service-couchbase-login\" width=\"604\" height=\"280\" \/> <\/a><br \/>\nThe image used in the configuration file is configured with the\u00a0<code>Administrator<\/code>\u00a0username and\u00a0<code>password<\/code>\u00a0password. Enter the credentials to see the console:<br \/>\n<a href=\"\/wp-content\/original-assets\/september-2016\/docker-service-and-swarm-mode-to-create-couchbase-cluster\/docker-service-couchbase-web-console-1024x641.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-14255\" src=\"\/wp-content\/original-assets\/september-2016\/docker-service-and-swarm-mode-to-create-couchbase-cluster\/docker-service-couchbase-web-console-1024x641.png\" alt=\"docker-service-couchbase-web-console\" width=\"604\" height=\"378\" \/> <\/a><\/li>\n<li>Click on Server Nodes to see how many Couchbase nodes are part of the cluster. As expected, it shows only one node:<br \/>\n<a href=\"\/wp-content\/original-assets\/september-2016\/docker-service-and-swarm-mode-to-create-couchbase-cluster\/docker-service-couchbase-one-active-server-1024x319.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-14257\" src=\"\/wp-content\/original-assets\/september-2016\/docker-service-and-swarm-mode-to-create-couchbase-cluster\/docker-service-couchbase-one-active-server-1024x319.png\" alt=\"docker-service-couchbase-one-active-server\" width=\"604\" height=\"188\" \/><\/a><\/li>\n<\/ol>\n<h2>Create Couchbase &#8220;worker&#8221; Service<\/h2>\n<ol>\n<li>Create &#8220;worker&#8221; service:\n<pre class=\"lang:default decode:true\">docker service create --name couchbase-worker --replicas 1 -e TYPE=WORKER -e COUCHBASE_MASTER=couchbase-master.couchbase --network couchbase arungupta\/couchbase:swarm<\/pre>\n<p>This RC also creates a single replica of Couchbase using the same <code>arungupta\/couchbase:swarm<\/code> image. The key differences here are:<\/p>\n<ul>\n<li><code>TYPE<\/code> environment variable is set to <code>WORKER<\/code>. This adds a worker Couchbase node to be added to the cluster.<\/li>\n<li><code>COUCHBASE_MASTER<\/code> environment variable is passed the name of the master service, \u00a0<code>couchbase-master.couchbase<\/code>\u00a0in our case. This uses the service discovery mechanism built into Docker\u00a0for the worker and<br \/>\nthe master to communicate.<\/li>\n<\/ul>\n<\/li>\n<li>Check service:\n<pre class=\"lang:default decode:true\">ubuntu@ip-172-31-26-234:~$ docker service ls\r\nID            NAME              REPLICAS  IMAGE                      COMMAND\r\naw22g79o3u8z  couchbase-worker  1\/1       arungupta\/couchbase:swarm  \r\ncecl1rl5ecyr  couchbase-master  1\/1       arungupta\/couchbase:swarm<\/pre>\n<\/li>\n<li>Checking the Couchbase Web Console shows the updated output:<br \/>\n<a href=\"\/wp-content\/original-assets\/september-2016\/docker-service-and-swarm-mode-to-create-couchbase-cluster\/docker-service-couchbase-one-pending-server-1024x316.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-14258\" src=\"\/wp-content\/original-assets\/september-2016\/docker-service-and-swarm-mode-to-create-couchbase-cluster\/docker-service-couchbase-one-pending-server-1024x316.png\" alt=\"docker-service-couchbase-one-pending-server\" width=\"604\" height=\"186\" \/><\/a><br \/>\nIt shows that one server\u00a0is pending to be rebalanced.During the worker service creation, <code>AUTO_REBALANCE<\/code> environment variable could have been\u00a0set to <code>true<\/code> or <code>false<\/code>\u00a0to<br \/>\nenable <a href=\"https:\/\/developer.couchbase.com\/documentation\/server\/current\/clustersetup\/rebalance.html\">rebalance<\/a>.\u00a0This ensures that the node is only added to the cluster but the cluster itself is not rebalanced. Rebalancing the cluster\u00a0requires\u00a0to<br \/>\nre-distribute the data across multiple nodes of the cluster. The recommended way is\u00a0to add multiple nodes, and then manually rebalance the cluster using the Web Console.<\/li>\n<\/ol>\n<h2>Add\u00a0Couchbase Nodes by\u00a0Scaling Docker Service<\/h2>\n<ol>\n<li>Scale the service:\u00a0<code><code><code> <\/code><\/code><br \/>\n<\/code><\/p>\n<pre class=\"lang:default decode:true\">docker service scale couchbase-worker=2<\/pre>\n<\/li>\n<li>Check the service:\n<pre class=\"lang:default decode:true\">ubuntu@ip-172-31-20-209:~$ docker service ls\r\nID            NAME              REPLICAS  IMAGE                      COMMAND\r\n1k650zjrwz00  couchbase-master  1\/1       arungupta\/couchbase:swarm  \r\n5o1i4eckr9d3  couchbase-worker  2\/2       arungupta\/couchbase:swarm<\/pre>\n<p>This shows that 2 replicas of worker are running.<\/li>\n<li>Check the\u00a0Couchbase Web\u00a0Console:<br \/>\n<a href=\"\/wp-content\/original-assets\/september-2016\/docker-service-and-swarm-mode-to-create-couchbase-cluster\/docker-service-couchbase-two-pending-servers-1024x366.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-14259\" src=\"\/wp-content\/original-assets\/september-2016\/docker-service-and-swarm-mode-to-create-couchbase-cluster\/docker-service-couchbase-two-pending-servers-1024x366.png\" alt=\"docker-service-couchbase-two-pending-servers\" width=\"604\" height=\"216\" \/><\/a><br \/>\nAs expected, two servers are now added\u00a0in the cluster and pending rebalance.<\/li>\n<li>Optionally, you can rebalance the cluster by clicking on the <code>Rebalance<\/code> button. and it will show like:<br \/>\n<a href=\"\/wp-content\/original-assets\/september-2016\/docker-service-and-swarm-mode-to-create-couchbase-cluster\/docker-service-couchbase-rebalancing-1024x431.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-14260\" src=\"\/wp-content\/original-assets\/september-2016\/docker-service-and-swarm-mode-to-create-couchbase-cluster\/docker-service-couchbase-rebalancing-1024x431.png\" alt=\"docker-service-couchbase-rebalancing\" width=\"604\" height=\"254\" \/><\/a><br \/>\nAfter the rebalancing is\u00a0complete, the Couchbase Web Console is updated to as as shown:<br \/>\n<a href=\"\/wp-content\/original-assets\/september-2016\/docker-service-and-swarm-mode-to-create-couchbase-cluster\/docker-service-couchbase-rebalanced-1024x402.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-14261\" src=\"\/wp-content\/original-assets\/september-2016\/docker-service-and-swarm-mode-to-create-couchbase-cluster\/docker-service-couchbase-rebalanced-1024x402.png\" alt=\"docker-service-couchbase-rebalanced\" width=\"604\" height=\"237\" \/><\/a><\/li>\n<li>See all the running containers\u00a0using <code>docker ps<\/code>:\n<pre class=\"lang:default decode:true\">ubuntu@ip-172-31-26-234:~$ docker ps\r\nCONTAINER ID        IMAGE                       COMMAND                  CREATED             STATUS              PORTS                                                        NAMES\r\na0d927f4a407        arungupta\/couchbase:swarm   \"\/entrypoint.sh \/opt\/\"   21 seconds ago      Up 20 seconds       8091-8094\/tcp, 11207\/tcp, 11210-11211\/tcp, 18091-18093\/tcp   couchbase-worker.2.4ufdw5rbdcu87whgm94yfv9yk\r\n22bde7f6471c        arungupta\/couchbase:swarm   \"\/entrypoint.sh \/opt\/\"   2 minutes ago       Up 2 minutes        8091-8094\/tcp, 11207\/tcp, 11210-11211\/tcp, 18091-18093\/tcp   couchbase-worker.1.f22c2gghu88bnbjl5ko1wlru5\r\nf97e8bc091c3        arungupta\/couchbase:swarm   \"\/entrypoint.sh \/opt\/\"   7 minutes ago       Up 7 minutes        8091-8094\/tcp, 11207\/tcp, 11210-11211\/tcp, 18091-18093\/tcp   couchbase-master.1.2xuw1h0jvantsgj9f8zuj03k8<\/pre>\n<\/li>\n<\/ol>\n<p>In addition to creating a cluster, Couchbase Server supports a range of <a href=\"https:\/\/developer.couchbase.com\/documentation\/server\/current\/ha-dr\/ha-dr-intro.html\">high availability and disaster recovery<\/a> (HA\/DR) strategies. Most HA\/DR strategies<br \/>\nrely on a multi-pronged approach of maximizing availability, increasing redundancy within and across data centers, and performing regular backups. Now that your Couchbase cluster is ready, you can run your first <a href=\"https:\/\/developer.couchbase.com\/documentation\/server\/current\/travel-app\/index.html\">sample application<\/a>.<br \/>\nLearn more about Couchbase and Containers:<\/p>\n<ul>\n<li><a href=\"https:\/\/www.couchbase.com\/containers\">Couchbase on Containers<\/a><\/li>\n<li>Follow us on <a href=\"https:\/\/twitter.com\/couchbasedev\">@couchbasedev<\/a> or <a href=\"https:\/\/twitter.com\/couchbase\">@couchbase<\/a><\/li>\n<li>Ask questions on <a href=\"https:\/\/www.couchbase.com\/forums\/\">Couchbase Forums<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Docker 1.12 introduced Services.\u00a0A replicated, distributed and load balanced service can be easily created using docker service create command. A &#8220;desired state&#8221; of the application, such as run 3 containers of Couchbase, is provided and the self-healing Docker engine ensures [&hellip;]<\/p>\n","protected":false},"author":58,"featured_media":13873,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1816],"tags":[],"ppma_author":[8933],"class_list":["post-2383","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-couchbase-server"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.9 (Yoast SEO v25.9) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Docker Service and Swarm Mode to Create Couchbase Cluster - The Couchbase Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.couchbase.com\/blog\/docker-service-swarm-mode-couchbase-cluster\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Docker Service and Swarm Mode to Create Couchbase Cluster\" \/>\n<meta property=\"og:description\" content=\"Docker 1.12 introduced Services.\u00a0A replicated, distributed and load balanced service can be easily created using docker service create command. A &#8220;desired state&#8221; of the application, such as run 3 containers of Couchbase, is provided and the self-healing Docker engine ensures [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/docker-service-swarm-mode-couchbase-cluster\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2017-01-06T08:32:57+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-05-19T11:05:27+00:00\" \/>\n<meta name=\"author\" content=\"Arun Gupta, VP, Developer Advocacy, Couchbase\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@arungupta\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Arun Gupta, VP, Developer Advocacy, Couchbase\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/docker-service-swarm-mode-couchbase-cluster\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/docker-service-swarm-mode-couchbase-cluster\/\"},\"author\":{\"name\":\"Arun Gupta, VP, Developer Advocacy, Couchbase\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/39d8caed0f536489b6aa6e8d31ee631f\"},\"headline\":\"Docker Service and Swarm Mode to Create Couchbase Cluster\",\"datePublished\":\"2017-01-06T08:32:57+00:00\",\"dateModified\":\"2023-05-19T11:05:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/docker-service-swarm-mode-couchbase-cluster\/\"},\"wordCount\":936,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/docker-service-swarm-mode-couchbase-cluster\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"articleSection\":[\"Couchbase Server\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/docker-service-swarm-mode-couchbase-cluster\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/docker-service-swarm-mode-couchbase-cluster\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/docker-service-swarm-mode-couchbase-cluster\/\",\"name\":\"Docker Service and Swarm Mode to Create Couchbase Cluster - The Couchbase Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/docker-service-swarm-mode-couchbase-cluster\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/docker-service-swarm-mode-couchbase-cluster\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"datePublished\":\"2017-01-06T08:32:57+00:00\",\"dateModified\":\"2023-05-19T11:05:27+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/docker-service-swarm-mode-couchbase-cluster\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/docker-service-swarm-mode-couchbase-cluster\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/docker-service-swarm-mode-couchbase-cluster\/#primaryimage\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"width\":1800,\"height\":630},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/docker-service-swarm-mode-couchbase-cluster\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Docker Service and Swarm Mode to Create Couchbase Cluster\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"name\":\"The Couchbase Blog\",\"description\":\"Couchbase, the NoSQL Database\",\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"width\":218,\"height\":34,\"caption\":\"The Couchbase Blog\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/39d8caed0f536489b6aa6e8d31ee631f\",\"name\":\"Arun Gupta, VP, Developer Advocacy, Couchbase\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/8900a75409c646948fe0bd80f6240337\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/f912e10b5f39748ee4f1a0b0da6f42747f0b3a94fe7acb511791468656f5e726?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/f912e10b5f39748ee4f1a0b0da6f42747f0b3a94fe7acb511791468656f5e726?s=96&d=mm&r=g\",\"caption\":\"Arun Gupta, VP, Developer Advocacy, Couchbase\"},\"description\":\"Arun Gupta is the vice president of developer advocacy at Couchbase. He has built and led developer communities for 10+ years at Sun, Oracle, and Red Hat. He has deep expertise in leading cross-functional teams to develop and execute strategy, planning and execution of content, marketing campaigns, and programs. Prior to that he led engineering teams at Sun and is a founding member of the Java EE team. Gupta has authored more than 2,000 blog posts on technology. He has extensive speaking experience in more than 40 countries on myriad topics and is a JavaOne Rock Star for three years in a row. Gupta also founded the Devoxx4Kids chapter in the US and continues to promote technology education among children. An author of several books on technology, an avid runner, a globe trotter, a Java Champion, a JUG leader, NetBeans Dream Team member, and a Docker Captain, he is easily accessible at @arungupta.\",\"sameAs\":[\"https:\/\/x.com\/arungupta\"],\"url\":\"https:\/\/www.couchbase.com\/blog\/author\/arun-gupta\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Docker Service and Swarm Mode to Create Couchbase Cluster - The Couchbase Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.couchbase.com\/blog\/docker-service-swarm-mode-couchbase-cluster\/","og_locale":"en_US","og_type":"article","og_title":"Docker Service and Swarm Mode to Create Couchbase Cluster","og_description":"Docker 1.12 introduced Services.\u00a0A replicated, distributed and load balanced service can be easily created using docker service create command. A &#8220;desired state&#8221; of the application, such as run 3 containers of Couchbase, is provided and the self-healing Docker engine ensures [&hellip;]","og_url":"https:\/\/www.couchbase.com\/blog\/docker-service-swarm-mode-couchbase-cluster\/","og_site_name":"The Couchbase Blog","article_published_time":"2017-01-06T08:32:57+00:00","article_modified_time":"2023-05-19T11:05:27+00:00","author":"Arun Gupta, VP, Developer Advocacy, Couchbase","twitter_card":"summary_large_image","twitter_creator":"@arungupta","twitter_misc":{"Written by":"Arun Gupta, VP, Developer Advocacy, Couchbase","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/docker-service-swarm-mode-couchbase-cluster\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/docker-service-swarm-mode-couchbase-cluster\/"},"author":{"name":"Arun Gupta, VP, Developer Advocacy, Couchbase","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/39d8caed0f536489b6aa6e8d31ee631f"},"headline":"Docker Service and Swarm Mode to Create Couchbase Cluster","datePublished":"2017-01-06T08:32:57+00:00","dateModified":"2023-05-19T11:05:27+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/docker-service-swarm-mode-couchbase-cluster\/"},"wordCount":936,"commentCount":1,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/docker-service-swarm-mode-couchbase-cluster\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","articleSection":["Couchbase Server"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/docker-service-swarm-mode-couchbase-cluster\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/docker-service-swarm-mode-couchbase-cluster\/","url":"https:\/\/www.couchbase.com\/blog\/docker-service-swarm-mode-couchbase-cluster\/","name":"Docker Service and Swarm Mode to Create Couchbase Cluster - The Couchbase Blog","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/docker-service-swarm-mode-couchbase-cluster\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/docker-service-swarm-mode-couchbase-cluster\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","datePublished":"2017-01-06T08:32:57+00:00","dateModified":"2023-05-19T11:05:27+00:00","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/docker-service-swarm-mode-couchbase-cluster\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/docker-service-swarm-mode-couchbase-cluster\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/docker-service-swarm-mode-couchbase-cluster\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","width":1800,"height":630},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/docker-service-swarm-mode-couchbase-cluster\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Docker Service and Swarm Mode to Create Couchbase Cluster"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/blog\/#website","url":"https:\/\/www.couchbase.com\/blog\/","name":"The Couchbase Blog","description":"Couchbase, the NoSQL Database","publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"The Couchbase Blog","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","width":218,"height":34,"caption":"The Couchbase Blog"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/39d8caed0f536489b6aa6e8d31ee631f","name":"Arun Gupta, VP, Developer Advocacy, Couchbase","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/8900a75409c646948fe0bd80f6240337","url":"https:\/\/secure.gravatar.com\/avatar\/f912e10b5f39748ee4f1a0b0da6f42747f0b3a94fe7acb511791468656f5e726?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f912e10b5f39748ee4f1a0b0da6f42747f0b3a94fe7acb511791468656f5e726?s=96&d=mm&r=g","caption":"Arun Gupta, VP, Developer Advocacy, Couchbase"},"description":"Arun Gupta is the vice president of developer advocacy at Couchbase. He has built and led developer communities for 10+ years at Sun, Oracle, and Red Hat. He has deep expertise in leading cross-functional teams to develop and execute strategy, planning and execution of content, marketing campaigns, and programs. Prior to that he led engineering teams at Sun and is a founding member of the Java EE team. Gupta has authored more than 2,000 blog posts on technology. He has extensive speaking experience in more than 40 countries on myriad topics and is a JavaOne Rock Star for three years in a row. Gupta also founded the Devoxx4Kids chapter in the US and continues to promote technology education among children. An author of several books on technology, an avid runner, a globe trotter, a Java Champion, a JUG leader, NetBeans Dream Team member, and a Docker Captain, he is easily accessible at @arungupta.","sameAs":["https:\/\/x.com\/arungupta"],"url":"https:\/\/www.couchbase.com\/blog\/author\/arun-gupta\/"}]}},"authors":[{"term_id":8933,"user_id":58,"is_guest":0,"slug":"arun-gupta","display_name":"Arun Gupta, VP, Developer Advocacy, Couchbase","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/f912e10b5f39748ee4f1a0b0da6f42747f0b3a94fe7acb511791468656f5e726?s=96&d=mm&r=g","author_category":"","last_name":"Gupta","first_name":"Arun","job_title":"","user_url":"","description":"Arun Gupta is the vice president of developer advocacy at Couchbase. He has built and led developer communities for 10+ years at Sun, Oracle, and Red Hat. He has deep expertise in leading cross-functional teams to develop and execute strategy, planning and execution of content, marketing campaigns, and programs. Prior to that he led engineering teams at Sun and is a founding member of the Java EE team.\r\n\r\nGupta has authored more than 2,000 blog posts on technology. He has extensive speaking experience in more than 40 countries on myriad topics and is a JavaOne Rock Star for three years in a row. Gupta also founded the Devoxx4Kids chapter in the US and continues to promote technology education among children. An author of several books on technology, an avid runner, a globe trotter, a Java Champion, a JUG leader, NetBeans Dream Team member, and a Docker Captain, he is easily accessible at @arungupta."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/2383","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/users\/58"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/comments?post=2383"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/2383\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media\/13873"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media?parent=2383"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/categories?post=2383"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/tags?post=2383"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=2383"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}