{"id":2280,"date":"2017-01-03T23:59:10","date_gmt":"2017-01-03T23:59:10","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=2280"},"modified":"2023-02-15T13:08:43","modified_gmt":"2023-02-15T21:08:43","slug":"couchbase-xdcr-docker-swarm-machine-compose","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/couchbase-xdcr-docker-swarm-machine-compose\/","title":{"rendered":"Couchbase XDCR using Docker Swarm, Machine and Compose"},"content":{"rendered":"<p><a href=\"https:\/\/developer.couchbase.com\/documentation\/server\/current\/xdcr\/xdcr-intro.html\">Cross Datacenter Replication (XDCR) in Couchbase<\/a> provides an easy way to replicate data from one cluster to another. The clusters are typically set in\u00a0geographically<br \/>\ndiverse data centers.\u00a0This enables for disaster recovery or to bring data closer to users for faster data access. This blog will show:<\/p>\n<ul>\n<li>Setup two\u00a0data centers using Docker Swarm<\/li>\n<li>Run\u00a0Couchbase containers on each node of Docker Swarm<\/li>\n<li>Setup a Couchbase cluster on each Docker Swarm cluster<\/li>\n<li>Configure one-way XDCR between two Couchbase clusters<\/li>\n<\/ul>\n<p>For the purpose of this blog,\u00a0the two data centers will be setup on a local\u00a0machine using Docker Machine.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2796\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/01\/swarm-xdcr-couchbase-overview-1024x468.png\" alt=\" swarm-xdcr-couchbase-overview\" width=\"1024\" height=\"468\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/01\/swarm-xdcr-couchbase-overview-1024x468.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/01\/swarm-xdcr-couchbase-overview-1024x468-300x137.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/01\/swarm-xdcr-couchbase-overview-1024x468-768x351.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/01\/swarm-xdcr-couchbase-overview-1024x468-20x9.png 20w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><br \/>\nComplete code used in this blog is available at:\u00a0<a href=\"https:\/\/github.com\/arun-gupta\/couchbase-xdcr-docker\">github.com\/arun-gupta\/couchbase-xdcr-docker<\/a>.<\/p>\n<h2>Create Consul Discovery Service<\/h2>\n<p>Each node in Docker Swarm needs to be registered with a <a href=\"https:\/\/docs.docker.com\/swarm\/discovery\/\">discovery service<\/a>. This blog will use Consul\u00a0for that purpose. And even Consul will be running on a Docker Machine. Typically, you&#8217;ll run<br \/>\na cluster of Consul but for simplicity a single instance is started in our case. Create a Docker Machine and start Consul using <a href=\"https:\/\/github.com\/arun-gupta\/couchbase-xdcr-docker\/blob\/master\/start-consul.sh\">this script<\/a>:<\/p>\n<pre class=\"lang:default decode:true\"># Docker Machine for Consul\r\ndocker-machine \r\n   create \r\n   -d virtualbox \r\n   consul-machine\r\n\r\n# Start Consul\r\ndocker $(docker-machine config consul-machine) run -d --restart=always \r\n         -p \"8500:8500\" \r\n         -h \"consul\" \r\n         progrium\/consul -server -bootstrap<\/pre>\n<h2>Create\u00a0Docker Swarm cluster<\/h2>\n<p>Docker Swarm\u00a0allows multiple\u00a0Docker hosts to be viewed as a single unit. This allows your multi-container applications to easily run on multiple hosts.\u00a0Docker Swarm serves the same\u00a0<a href=\"https:\/\/docs.docker.com\/engine\/reference\/api\/docker_remote_api\/\">Remote API<\/a> as served by a single host. This\u00a0allows your existing tools to target a single host or a cluster of hosts. Both the Docker Swarm clusters will be registered with a single discovery service. This is achieved by using the\u00a0following value for<br \/>\n<code>--swarm-discovery<\/code>:<\/p>\n<pre class=\"lang:default decode:true\">consul:\/\/$(docker-machine ip consul-machine):8500\/v1\/kv\/<\/pre>\n<p>Create\u00a0a Docker Swarm cluster using Docker Machine using <a href=\"https:\/\/github.com\/arun-gupta\/couchbase-xdcr-docker\/blob\/master\/create-docker-swarm-cluster.sh\">this script<\/a>:<\/p>\n<pre class=\"lang:default decode:true\"># Docker Swarm master\r\ndocker-machine \r\n  create \r\n  -d virtualbox \r\n  --swarm \r\n  --swarm-master \r\n  --swarm-discovery=\"consul:\/\/$(docker-machine ip consul-machine):8500\/v1\/kv\/cluster$1\" \r\n  --engine-opt=\"cluster-store=consul:\/\/$(docker-machine ip consul-machine):8500\/v1\/kv\/cluster$1\" \r\n  --engine-opt=\"cluster-advertise=eth1:2376\" \r\n  swarm-master-$1\r\n\r\n# Docker Swarm node-01\r\ndocker-machine \r\n  create \r\n  -d virtualbox \r\n  --swarm \r\n  --swarm-discovery=\"consul:\/\/$(docker-machine ip consul-machine):8500\/v1\/kv\/cluster$1\" \r\n  --engine-opt=\"cluster-store=consul:\/\/$(docker-machine ip consul-machine):8500\/v1\/kv\/cluster$1\" \r\n  --engine-opt=\"cluster-advertise=eth1:2376\" \r\n  swarm-node-$1-01\r\n\r\n# Docker Swarm node-02\r\ndocker-machine \r\n  create \r\n  -d virtualbox \r\n  --swarm \r\n  --swarm-discovery=\"consul:\/\/$(docker-machine ip consul-machine):8500\/v1\/kv\/cluster$1\" \r\n  --engine-opt=\"cluster-store=consul:\/\/$(docker-machine ip consul-machine):8500\/v1\/kv\/cluster$1\" \r\n  --engine-opt=\"cluster-advertise=eth1:2376\" \r\n  swarm-node-$1-02\r\n\r\n# Configure to use Docker Swarm cluster\r\neval \"$(docker-machine env --swarm swarm-master-$1)\"<\/pre>\n<p>The script needs to be invoked as:<\/p>\n<pre class=\"lang:default decode:true\">.\/create-docker-swarm-cluster.sh A\r\n.\/create-docker-swarm-cluster.sh B<\/pre>\n<p>This will create two Docker Swarm clusters with one &#8220;master&#8221; and two &#8220;worker&#8221; as shown below:<\/p>\n<pre class=\"lang:default decode:true\">NAME              ACTIVE   DRIVER       STATE     URL                         SWARM                     DOCKER    ERRORS\r\nconsul-machine    -        virtualbox   Running   tcp:\/\/192.168.99.101:2376                             v1.11.1   \r\ndefault           *        virtualbox   Running   tcp:\/\/192.168.99.100:2376                             v1.11.1   \r\nswarm-master-A    -        virtualbox   Running   tcp:\/\/192.168.99.102:2376   swarm-master-A (master)   v1.11.1   \r\nswarm-master-B    -        virtualbox   Running   tcp:\/\/192.168.99.105:2376   swarm-master-B (master)   v1.11.1   \r\nswarm-node-A-01   -        virtualbox   Running   tcp:\/\/192.168.99.103:2376   swarm-master-A            v1.11.1   \r\nswarm-node-A-02   -        virtualbox   Running   tcp:\/\/192.168.99.104:2376   swarm-master-A            v1.11.1   \r\nswarm-node-B-01   -        virtualbox   Running   tcp:\/\/192.168.99.106:2376   swarm-master-B            v1.11.1   \r\nswarm-node-B-02   -        virtualbox   Running   tcp:\/\/192.168.99.107:2376   swarm-master-B            v1.11.1<\/pre>\n<p>Consul is running on Docker Machine with IP address\u00a0<code>192.168.99.101.\u00a0<\/code>And so Consul UI is accessible at https:\/\/192.168.99.101:8500:<\/p>\n<h2><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-14000\" src=\"\/wp-content\/original-assets\/may-2016\/couchbase-xdcr-using-docker-swarm-machine-and-compose\/swarm-xdcr-couchbase-1024x543.png\" alt=\"swarm-xdcr-couchbase\" width=\"604\" height=\"320\" \/><\/h2>\n<p>It shows two\u00a0Docker Swarm clusters that have been registered. Exact list of nodes for each cluster can also be seen. Nodes in <code>clusterA<\/code> are shown: <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-13998\" src=\"\/wp-content\/original-assets\/may-2016\/couchbase-xdcr-using-docker-swarm-machine-and-compose\/swarm-xdcr-consul-clustera-1024x466.png\" alt=\"swarm-xdcr-consul-clusterA\" width=\"604\" height=\"275\" \/><\/p>\n<p>Nodes in <code>clusterB<\/code> are shown:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-13999\" src=\"\/wp-content\/original-assets\/may-2016\/couchbase-xdcr-using-docker-swarm-machine-and-compose\/swarm-xdcr-consul-clusterb-1024x459.png\" alt=\"swarm-xdcr-consul-clusterB\" width=\"604\" height=\"271\" \/><\/p>\n<h2>Run Couchbase containers<\/h2>\n<p>Run Couchbase\u00a0container on each node of Docker Swarm cluster using\u00a0this <a href=\"https:\/\/github.com\/arun-gupta\/couchbase-xdcr-docker\/blob\/master\/docker-compose.yml\">Compose file<\/a>.<\/p>\n<pre class=\"lang:default decode:true\">version: \"2\"\r\nservices:\r\n  db:\r\n    image: arungupta\/couchbase\r\n    network_mode: \"host\"\r\n    ports:\r\n      - 8091:8091\r\n      - 8092:8092\r\n      - 8093:8093\r\n      - 11210:11210<\/pre>\n<p>Configure Docker CLI for the first cluster and run 3 containers:<\/p>\n<pre class=\"lang:default decode:true\">eval \"$(docker-machine env --swarm swarm-master-A)\"\r\ndocker-compose scale db=3<\/pre>\n<p>Check the running containers:<\/p>\n<pre class=\"lang:default decode:true\">&gt; docker ps\r\nCONTAINER ID        IMAGE                 COMMAND                  CREATED             STATUS              PORTS               NAMES\r\n3ec0f15aaee0        arungupta\/couchbase   \"\/entrypoint.sh \/opt\/\"   3 hours ago         Up 3 hours                              swarm-master-A\/couchbasexdcrdocker_db_3\r\n07af2ac53539        arungupta\/couchbase   \"\/entrypoint.sh \/opt\/\"   3 hours ago         Up 3 hours                              swarm-node-A-02\/couchbasexdcrdocker_db_2\r\nc94878f543fd        arungupta\/couchbase   \"\/entrypoint.sh \/opt\/\"   3 hours ago         Up 3 hours                              swarm-node-A-01\/couchbasexdcrdocker_db_1<\/pre>\n<p>Configure Docker CLI for the second cluster and run 3 containers:<\/p>\n<pre class=\"lang:default decode:true\">eval \"$(docker-machine env --swarm swarm-master-B)\"\r\ndocker-compose scale db=3<\/pre>\n<p>Check\u00a0the running\u00a0containers:<\/p>\n<pre class=\"lang:default decode:true\">&gt; eval \"$(docker-machine env --swarm swarm-master-B)\"\r\n&gt; docker ps\r\nCONTAINER ID        IMAGE                 COMMAND                  CREATED             STATUS              PORTS               NAMES\r\n3e3a45480939        arungupta\/couchbase   \"\/entrypoint.sh \/opt\/\"   3 hours ago         Up 3 hours                              swarm-master-B\/couchbasexdcrdocker_db_3\r\n1f31f23e337d        arungupta\/couchbase   \"\/entrypoint.sh \/opt\/\"   3 hours ago         Up 3 hours                              swarm-node-B-01\/couchbasexdcrdocker_db_1\r\n1feab04c494c        arungupta\/couchbase   \"\/entrypoint.sh \/opt\/\"   3 hours ago         Up 3 hours                              swarm-node-B-02\/couchbasexdcrdocker_db_2<\/pre>\n<h2>Create\/Rebalance Couchbase cluster<\/h2>\n<p><a href=\"https:\/\/www.couchbase.com\/blog\/scaling-rebalancing-couchbase-cluster-cli\/\">Scaling and Rebalancing Couchbase Cluster using CLI<\/a>\u00a0explains how to create a cluster of Couchbase nodes and\u00a0rebalance an\u00a0existing cluster using <a href=\"https:\/\/developer.couchbase.com\/documentation\/server\/4.1\/cli\/cli-intro.html\">Couchbase CLI<\/a>.<br \/>\nCreate Couchbase cluster on each Swarm cluster using <a href=\"https:\/\/github.com\/arun-gupta\/couchbase-xdcr-docker\/blob\/master\/create-couchbase-cluster.sh\">this script<\/a>.<\/p>\n<pre class=\"lang:default decode:true\">export COUCHBASE_CLI=\/Users\/arungupta\/tools\/Couchbase-Server-4.0.app\/Contents\/Resources\/couchbase-core\/bin\/couchbase-cli\r\nfor node in 01 02\r\ndo\r\n    $COUCHBASE_CLI \r\n        server-add \r\n        --cluster=$(docker-machine ip swarm-master-$1):8091 \r\n        --user Administrator \r\n        --password password \r\n        --server-add=$(docker-machine ip swarm-node-$1-$node) \r\n        --server-add-username=Administrator \r\n        --server-add-password=password\r\ndone\r\n\r\n$COUCHBASE_CLI \r\n setting-cluster \r\n --cluster=$(docker-machine ip swarm-master-$1):8091 \r\n --user Administrator \r\n --password password \r\n --cluster-name=cluster$1<\/pre>\n<p>The script needs to be invoked as:<\/p>\n<pre class=\"lang:default decode:true\">.\/create-couchbase-cluster.sh A<\/pre>\n<p>And now rebalance this cluster using this script:<\/p>\n<pre class=\"lang:default decode:true\">export COUCHBASE_CLI=\/Users\/arungupta\/tools\/Couchbase-Server-4.0.app\/Contents\/Resources\/couchbase-core\/bin\/couchbase-cli\r\n$COUCHBASE_CLI \r\nrebalance \r\n--cluster=$(docker-machine ip swarm-master-$1):8091 \r\n--user Administrator \r\n--password password \r\n--server-add-username=Administrator \r\n--server-add-password=password<\/pre>\n<p>This script is invoked as:<\/p>\n<pre class=\"lang:default decode:true\">.\/rebalance-couchbase-cluster.sh A<\/pre>\n<p><a href=\"https:\/\/developer.couchbase.com\/documentation\/server\/current\/admin\/ui-intro.html\">Couchbase Web Console<\/a>\u00a0for any node in the cluster will show the\u00a0output:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-14001\" src=\"\/wp-content\/original-assets\/may-2016\/couchbase-xdcr-using-docker-swarm-machine-and-compose\/swarm-xdcr-couchbase-clustera-1024x435.png\" alt=\"swarm-xdcr-couchbase-clusterA\" width=\"604\" height=\"257\" \/><\/p>\n<p>Invoke this script\u00a0to create the second Couchbase\u00a0cluster as:<\/p>\n<pre class=\"lang:default decode:true\">.\/create-couchbase-cluster.sh B<\/pre>\n<p>Rebalance this cluster as:<\/p>\n<pre class=\"lang:default decode:true\">.\/rebalance-couchbase-cluster.sh B<\/pre>\n<p>Couchbase Web Console\u00a0for any node in the second cluster will show the\u00a0output: <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-14003\" src=\"\/wp-content\/original-assets\/may-2016\/couchbase-xdcr-using-docker-swarm-machine-and-compose\/swarm-xdcr-couchbase-clusterb-1024x430.png\" alt=\"swarm-xdcr-couchbase-clusterB\" width=\"604\" height=\"254\" \/><\/p>\n<h2>Setup XDCR<\/h2>\n<p>Cross datacenter replication can be setup to be uni-directional, bi-directional or multi-directional. Uni-directional allows data to replicated\u00a0from source cluster to destination cluster, bi-directional allows replication both ways, multi-directional<br \/>\nallows to configure in any direction. We&#8217;ll create a simple uni-directional replication using <a href=\"https:\/\/github.com\/arun-gupta\/couchbase-xdcr-docker\/blob\/master\/setup-xdcr.sh\">this script<\/a>:<\/p>\n<pre class=\"lang:default decode:true\">export COUCHBASE_CLI=\/Users\/arungupta\/tools\/Couchbase-Server-4.0.app\/Contents\/Resources\/couchbase-core\/bin\/couchbase-cli\r\n$COUCHBASE_CLI \r\n xdcr-setup \r\n --cluster=$(docker-machine ip swarm-master-$1):8091 \r\n --user Administrator \r\n --password password \r\n --create \r\n --xdcr-cluster-name=cluster$1 \r\n --xdcr-hostname=$(docker-machine ip swarm-master-$2):8091 \r\n --xdcr-username=Administrator \r\n --xdcr-password=password \r\n --xdcr-demand-encryption=0\r\n\r\n$COUCHBASE_CLI \r\n xdcr-replicate \r\n --cluster $(docker-machine ip swarm-master-$1):8091 \r\n --xdcr-cluster-name=cluster$1 \r\n --user Administrator \r\n --password password \r\n --create \r\n --xdcr-from-bucket=travel-sample \r\n --xdcr-to-bucket=travel-sample<\/pre>\n<p>This script is invoked as:<\/p>\n<pre class=\"lang:default decode:true\">.\/setup-xdcr.sh A B<\/pre>\n<p>A bi-directional replication can be easily created by\u00a0executing the commands again but reversing the source and destination cluster. Couchbase Web Console for the source cluster will show:<br \/>\n<a href=\"\/wp-content\/original-assets\/may-2016\/couchbase-xdcr-using-docker-swarm-machine-and-compose\/swarm-xdcr-couchbase-clustera-xdcr-1024x441.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-14002\" src=\"\/wp-content\/original-assets\/may-2016\/couchbase-xdcr-using-docker-swarm-machine-and-compose\/swarm-xdcr-couchbase-clustera-xdcr-1024x441.png\" alt=\"swarm-xdcr-couchbase-clusterA-xdcr\" width=\"604\" height=\"260\" \/><\/a><\/p>\n<p>Couchbase Web Console for the destination cluster will show:<br \/>\n<a href=\"\/wp-content\/original-assets\/may-2016\/couchbase-xdcr-using-docker-swarm-machine-and-compose\/swarm-xdcr-couchbase-clusterb-xdcr-1024x413.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-14004\" src=\"\/wp-content\/original-assets\/may-2016\/couchbase-xdcr-using-docker-swarm-machine-and-compose\/swarm-xdcr-couchbase-clusterb-xdcr-1024x413.png\" alt=\"swarm-xdcr-couchbase-clusterB-xdcr\" width=\"604\" height=\"244\" \/><\/a><\/p>\n<p>Enjoy!<\/p>\n<p>This blog shows how you can simplify your complex deployments using Docker Machine, Docker Swarm, and <a href=\"https:\/\/www.couchbase.com\/blog\/couchbase-using-docker-compose\/\">Docker Compose<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Cross Datacenter Replication (XDCR) in Couchbase provides an easy way to replicate data from one cluster to another. The clusters are typically set in\u00a0geographically diverse data centers.\u00a0This enables for disaster recovery or to bring data closer to users for faster [&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-2280","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 v26.0 (Yoast SEO v26.0) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Couchbase XDCR using Docker Swarm, Machine and Compose - 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\/couchbase-xdcr-docker-swarm-machine-compose\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Couchbase XDCR using Docker Swarm, Machine and Compose\" \/>\n<meta property=\"og:description\" content=\"Cross Datacenter Replication (XDCR) in Couchbase provides an easy way to replicate data from one cluster to another. The clusters are typically set in\u00a0geographically diverse data centers.\u00a0This enables for disaster recovery or to bring data closer to users for faster [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/couchbase-xdcr-docker-swarm-machine-compose\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2017-01-03T23:59:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-02-15T21:08:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/01\/swarm-xdcr-couchbase-overview-1024x468.png\" \/>\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=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-xdcr-docker-swarm-machine-compose\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-xdcr-docker-swarm-machine-compose\/\"},\"author\":{\"name\":\"Arun Gupta, VP, Developer Advocacy, Couchbase\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/39d8caed0f536489b6aa6e8d31ee631f\"},\"headline\":\"Couchbase XDCR using Docker Swarm, Machine and Compose\",\"datePublished\":\"2017-01-03T23:59:10+00:00\",\"dateModified\":\"2023-02-15T21:08:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-xdcr-docker-swarm-machine-compose\/\"},\"wordCount\":595,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-xdcr-docker-swarm-machine-compose\/#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\/couchbase-xdcr-docker-swarm-machine-compose\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-xdcr-docker-swarm-machine-compose\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/couchbase-xdcr-docker-swarm-machine-compose\/\",\"name\":\"Couchbase XDCR using Docker Swarm, Machine and Compose - The Couchbase Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-xdcr-docker-swarm-machine-compose\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-xdcr-docker-swarm-machine-compose\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"datePublished\":\"2017-01-03T23:59:10+00:00\",\"dateModified\":\"2023-02-15T21:08:43+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-xdcr-docker-swarm-machine-compose\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/couchbase-xdcr-docker-swarm-machine-compose\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-xdcr-docker-swarm-machine-compose\/#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\/couchbase-xdcr-docker-swarm-machine-compose\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Couchbase XDCR using Docker Swarm, Machine and Compose\"}]},{\"@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":"Couchbase XDCR using Docker Swarm, Machine and Compose - 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\/couchbase-xdcr-docker-swarm-machine-compose\/","og_locale":"en_US","og_type":"article","og_title":"Couchbase XDCR using Docker Swarm, Machine and Compose","og_description":"Cross Datacenter Replication (XDCR) in Couchbase provides an easy way to replicate data from one cluster to another. The clusters are typically set in\u00a0geographically diverse data centers.\u00a0This enables for disaster recovery or to bring data closer to users for faster [&hellip;]","og_url":"https:\/\/www.couchbase.com\/blog\/couchbase-xdcr-docker-swarm-machine-compose\/","og_site_name":"The Couchbase Blog","article_published_time":"2017-01-03T23:59:10+00:00","article_modified_time":"2023-02-15T21:08:43+00:00","og_image":[{"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/01\/swarm-xdcr-couchbase-overview-1024x468.png","type":"","width":"","height":""}],"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":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/couchbase-xdcr-docker-swarm-machine-compose\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/couchbase-xdcr-docker-swarm-machine-compose\/"},"author":{"name":"Arun Gupta, VP, Developer Advocacy, Couchbase","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/39d8caed0f536489b6aa6e8d31ee631f"},"headline":"Couchbase XDCR using Docker Swarm, Machine and Compose","datePublished":"2017-01-03T23:59:10+00:00","dateModified":"2023-02-15T21:08:43+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/couchbase-xdcr-docker-swarm-machine-compose\/"},"wordCount":595,"commentCount":1,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/couchbase-xdcr-docker-swarm-machine-compose\/#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\/couchbase-xdcr-docker-swarm-machine-compose\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/couchbase-xdcr-docker-swarm-machine-compose\/","url":"https:\/\/www.couchbase.com\/blog\/couchbase-xdcr-docker-swarm-machine-compose\/","name":"Couchbase XDCR using Docker Swarm, Machine and Compose - The Couchbase Blog","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/couchbase-xdcr-docker-swarm-machine-compose\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/couchbase-xdcr-docker-swarm-machine-compose\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","datePublished":"2017-01-03T23:59:10+00:00","dateModified":"2023-02-15T21:08:43+00:00","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/couchbase-xdcr-docker-swarm-machine-compose\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/couchbase-xdcr-docker-swarm-machine-compose\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/couchbase-xdcr-docker-swarm-machine-compose\/#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\/couchbase-xdcr-docker-swarm-machine-compose\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Couchbase XDCR using Docker Swarm, Machine and Compose"}]},{"@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\/2280","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=2280"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/2280\/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=2280"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/categories?post=2280"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/tags?post=2280"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=2280"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}