{"id":4068,"date":"2017-10-02T04:27:43","date_gmt":"2017-10-02T11:27:43","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=4068"},"modified":"2019-06-26T00:27:39","modified_gmt":"2019-06-26T07:27:39","slug":"infrastructure-code-couchbase-distributed-cluster-best-practices-part-1-introduction-theory","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/infrastructure-code-couchbase-distributed-cluster-best-practices-part-1-introduction-theory\/","title":{"rendered":"Infrastructure as code: Couchbase distributed cluster best practices \u2013 Part 1 introduction and theory \u00a0"},"content":{"rendered":"<p><em>Arkadiusz Borucki works as<\/em><strong>\u00a0<\/strong><em>a<\/em><strong>\u00a0<\/strong><em>Site Reliability Engineer at Amadeus, focused on NoSQL databases and automation. In his day-to-day work, he uses Couchbase, MongoDB, Oracle, Python, and Ansible. He\u2019s a self-proclaimed big data enthusiast, interested in data store technologies, distributed systems, analytics, and automation. He speaks at several conferences and user groups in the United States and Europe. You can find him on Twitter at <\/em><em>@_Aras_B<\/em><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-4067\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/10\/pasted-image-0-1.png\" alt=\"pasted image 0 1\" width=\"283\" height=\"421\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/10\/pasted-image-0-1.png 319w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/10\/pasted-image-0-1-201x300.png 201w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/10\/pasted-image-0-1-300x447.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/10\/pasted-image-0-1-13x20.png 13w\" sizes=\"auto, (max-width: 283px) 100vw, 283px\" \/><\/p>\n<p><strong>Motivation: Why use Infrastructure as Code<\/strong><\/p>\n<p>Many IT teams still rely on manual configuration to manage infrastructure \u2013 old procedures and outdated shell scripts are still in use.<\/p>\n<p>Sometimes members of one team use different procedures and scripts to the\u00a0same database farm. Those people may leave the company without sharing knowledge or tips.\u00a0This approach results\u00a0in problems, errors, slow deployments, and inconsistent environments.<\/p>\n<p>Server\u00a0farms are getting bigger and bigger\u00a0and data size is growing from gigabytes to tera or petabytes. Single machines are\u00a0no\u00a0longer\u00a0able to handle this amount of data. Therefore, we have to scale our database horizontally, use more machines, and distribute data across them.<\/p>\n<p>When we have two, five, or ten \u201cold school\u201d clusters set up based on procedures and scripts, that would be sufficient. The problems arise\u00a0when the farm is rapidly growing.<\/p>\n<ul>\n<li><em>What to do when your deployment has hundreds of servers?<\/em><em>\u00a0<\/em><\/li>\n<li><em>How to make sure <\/em><em>the <\/em><em>environment is consistent?<\/em><\/li>\n<li><em>How to control what is installed on <\/em><em>the<\/em><em>\u00a0machines?<\/em><\/li>\n<li><em>How to track all <\/em><em>the <\/em><em>changes?<\/em><\/li>\n<\/ul>\n<p>Information about infrastructure setup must be centralized.\u00a0Infrastructure should be treated like software \u2013\u00a0<strong>as code <\/strong>that can be managed with the same tools and processes used by software developers. For example, use code to describe the infrastructure. Create a <strong>model <\/strong>of your Couchbase deployment \u2013\u00a0as a code with <strong>version control<\/strong>\u00a0on it. You will not only be able to\u00a0track who has done what, you can also roll back to an earlier configuration.\u00a0Couchbase deployment will be consistent because the\u00a0same settings will be applied to every machine. To prevent future problems and outages your Couchbase farm should be consistent, configuration should be centralized and divided between production and non production\u00a0environments.<\/p>\n<p>You can test new setups and settings in test or development branch before you apply those changes on production!<\/p>\n<p><strong>Codify everything<\/strong><\/p>\n<p><strong>Use code <\/strong>to describe the infrastructure. Use <strong>Ansible <\/strong>for physical or virtual server management (patching, upgrades, configuration management, network management, new clusters deployments, orchestration).<\/p>\n<p><strong>Version everything<\/strong><\/p>\n<p>Use <strong>Git<\/strong>\u00a0to\u00a0manage infrastructure as a code repository. <strong>Git<\/strong>\u00a0is an open-source distributed version control system. Use an appropriate <strong>branching<\/strong>\u00a0model according to your business needs (production branch and test branch).<\/p>\n<p><strong>Manage your Couchbase deployment with Git<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"982\" height=\"468\" class=\"wp-image-4066\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/10\/pasted-image-0.png\" alt=\"pasted image 0\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/10\/pasted-image-0.png 982w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/10\/pasted-image-0-300x143.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/10\/pasted-image-0-768x366.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/10\/pasted-image-0-20x10.png 20w\" sizes=\"auto, (max-width: 982px) 100vw, 982px\" \/><\/p>\n<p><strong>One repository<\/strong><\/p>\n<p>Use one Git infrastructure as a code repository per organization or company. In one Git repository you can have a few branches (production, development, test, staging, etc.).<\/p>\n<p><strong>A<\/strong><strong>nsible: How to operate distributed <\/strong><strong>Couchbase<\/strong><strong>\u00a0cluster<\/strong><\/p>\n<p>Manual operations on a database farm are time and resource consuming. More manual operations bring more human mistakes, more overhead,\u00a0and inconsistency.<\/p>\n<p>Can you imagine a farm with 400 servers? How much time it takes\u00a0to log into every machine and change settings? What if you skip one or two machines? What if you apply different settings on a few machines by mistake?<\/p>\n<p><strong>Ansible<\/strong>\u00a0is a perfect tool for configuration management and orchestration of your infrastructure. By using Ansible you can go with<strong>\u00a0<\/strong><strong>Infrastructure As Code<\/strong><em>\u00a0<\/em><em>(keep Couchbase server\u2019s definition in Git repository, track changes, and use all the advantages that come with Git version control).<\/em><\/p>\n<p>Use Ansible <strong>git module<\/strong>\u00a0to deploy changes from Git repository on your distributed database farm. Ansible git module grabs code from the specified git url and pushes it in the destination directory.<\/p>\n<ul>\n<li>Ansible is agentless and uses a push approach (SSH).<\/li>\n<li>Ansible is based on YAML files.<\/li>\n<li>It is a good alternative to Puppet.<\/li>\n<li>Ansible reduces manual steps on servers.<\/li>\n<li><em>Ansible helps <\/em><em>95% reduction<\/em><em>\u00a0in operational overhead<\/em><\/li>\n<\/ul>\n<p><strong>Automation<\/strong><\/p>\n<ul>\n<li>Reduce overhead and human mistakes, speed up processes, provide consistency \u2013\u00a0use Ansible for your Couchbase farm automation.<\/li>\n<\/ul>\n<p><strong>Orchestration<\/strong><\/p>\n<ul>\n<li>Let\u2019s put logic on automation\u00a0and let\u2019s eliminate repetitive steps. Ansible can be also used as an orchestrator!<\/li>\n<\/ul>\n<p><strong>Automation<\/strong>\u00a0is concerned with a single task \u2013 starting Couchbase service, configuring a cluster, stopping Couchbase process.<\/p>\n<p><strong>Orchestration<\/strong>\u00a0is concerned with automating the execution of a workflow of a process.<\/p>\n<p># Example git checkout from Ansible Playbook<\/p>\n<pre class=\"lang:default decode:true \">---\r\n\r\n- name:\u00a0\"git checkout\"\r\n- git:\r\n\u00a0 \u00a0repo: 'https:\/\/server\/path\/to\/repo.git'\r\n\u00a0 \u00a0dest: \/opt\/couchbase\r\n\u00a0 \u00a0version: staging<\/pre>\n<p>Use the version option to specify a particular branch, tag, or commit id.\u00a0Once you pull code from the Git repository you can apply it on your Couchbase deployment. You can apply it on all servers or just on part of farm. You can also specify a list of hosts in the Ansible inventory file and run it like this:<\/p>\n<p># Example run Ansible Playbook for cluster \u201ccouchstg\u201d<\/p>\n<pre class=\"lang:default decode:true \">ansible-playbook -i .\/inventory\/hosts.inv\u00a0-l 'couchstg' .\/couchbase_upgradel.yml --ask-vault-pass\r\n\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><strong>Git<\/strong><strong>: What can we keep in Git?<\/strong><\/p>\n<p><em>Server configuration <\/em><em>repositories<\/em><em>:<\/em><\/p>\n<ul>\n<li>The default filesystems layout<\/li>\n<li>List of required linux packages<\/li>\n<li>Kernel parameters<\/li>\n<li>Required users and groups<\/li>\n<li>Cron scripts<\/li>\n<li>Security settings<\/li>\n<\/ul>\n<h2><em>Couchbase\/Ansible repositories:<\/em><\/h2>\n<ul>\n<li>Couchbase cluster definition<\/li>\n<li>Couchbase Ansible playbooks<\/li>\n<li>Couchbase roles<\/li>\n<li>Couchbase hosts inventory files<\/li>\n<li>RBAC config<\/li>\n<li>XDCR config<\/li>\n<\/ul>\n<p><strong>A<\/strong><strong>nsible: What should be automated?<\/strong><\/p>\n<ul>\n<li>Cluster deployment<\/li>\n<li>Upgrades<\/li>\n<li>Scaling<\/li>\n<li>Resilience<\/li>\n<li>Monitoring<\/li>\n<li>Alerting<\/li>\n<li>Security settings<\/li>\n<li>Backup and restore<\/li>\n<li>\n<h2>Couchbase cluster rebalance<\/h2>\n<\/li>\n<li>Couchbase failover<\/li>\n<li>Couchbase bucket creation<\/li>\n<li>Linux kernel and security patching<\/li>\n<li>Any manual activity from the Couchbase GUI or shell<\/li>\n<\/ul>\n<p>Manual cluster installations and manual nodes management should not be supported. Automate as much as possible and always push code changes to Git. Couchbase provides <strong>REST API<\/strong>\u00a0endpoints. From the Ansible playbook you can use HTTP methods \u2013\u00a0GET, POST, PUT, DELETE.<\/p>\n<p><em>Couchbase REST API allows you to make any change on a Couchbase farm without a single click in GUI. <\/em><\/p>\n<p>Ansible playbook can also run Couchbase CLI commands:<\/p>\n<p># Example auto failover (CLI commands) from Ansible Playbook<\/p>\n<pre class=\"lang:default decode:true\">- name: auto failover\r\n\r\n\u00a0 command:\u00a0\/opt\/couchbase\/bin\/couchbase-cli setting-autofailover\u00a0-c \u00a0 localhost --enable-auto-failover={{ autofailover }} --auto-failover-timeout= {{ timeout }} -u {{ admin }} -p {{ passwd }}\r\n\r\n<\/pre>\n<p>or \u00a0 # Example rebalance from Ansible Playbook<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true \">- name: rebalance cluster\r\n\r\n\u00a0 command:\u00a0\/opt\/couchbase\/bin\/couchbase-cli rebalance\u00a0-c localhost \u00a0-u \u00a0{{ admin }} -p {{ passwd }}\r\n\r\n<\/pre>\n<p># Example Install couchbase server from Ansible Playbook<\/p>\n<pre class=\"lang:default decode:true \">- name: \"Install couchbase database\"\r\n\r\n\u00a0\u00a0package: name=couchbase-server state=present\r\n\r\n\u00a0 notify:\r\n\r\n\u00a0 \u00a0 - wait for database start\r\n\r\n\u00a0 tags: installation\r\n\r\n- name: \"Add couchbase database to linux runlevel\"\r\n\r\n\u00a0 service: name=couchbase-server state=started enabled=yes\r\n\r\n\u00a0 tags: installation\r\n\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><strong>Co<\/strong><strong>uchbase: REST API<\/strong><\/p>\n<p>The Couchbase <strong>REST API<\/strong>\u00a0enables you to manage a Couchbase server deployment as well as perform operations such as storing design documents and querying for results directly from Ansible playbook.<\/p>\n<p>You can easily make Couchbase REST API calls from your Ansible code. You can also create custom Ansible roles for Couchbase!<\/p>\n<p>Couchbase offers\u00a0the following <strong>REST API<\/strong><strong>s<\/strong><strong>:<\/strong><\/p>\n<ul>\n<li><strong>Cluster API<\/strong>\u00a0\u2013\u00a0The Cluster REST API manages cluster operations<\/li>\n<li><strong>Server nodes API<\/strong>\u00a0\u2013\u00a0The Server nodes REST API manages nodes in a cluster<\/li>\n<li><strong>Server groups API<\/strong>\u00a0\u2013\u00a0The server groups REST API refers to the Rack Zone Awareness feature, which enables logical groupings of servers on a cluster where each server group physically belongs to a rack or availability zone<\/li>\n<li><strong>Buckets API <\/strong>\u2013\u00a0The Buckets REST API creates, deletes, flushes, and retrieves information about buckets and bucket operations<\/li>\n<li><strong>Views API<\/strong>\u00a0\u2013\u00a0The Views REST API is used to index and query JSON documents.<\/li>\n<li><strong>XDCR API <\/strong>\u2013\u00a0The XDCR REST API is used to manage Cross Datacenter Replication (XDCR) operations<\/li>\n<li><strong>Logs API <\/strong>\u2013\u00a0The Logs REST API provides the REST API endpoints for retrieving log and diagnostic information as well as how an SDK can add entries into a log<\/li>\n<li><strong>User API <\/strong>\u2013\u00a0A read-only user is created with the \/settings\/readOnlyUser URI endpoint \u2013 only one read-only user can be created<\/li>\n<\/ul>\n<p># example Ansible empties the contents of the specified bucket via REST API:<\/p>\n<pre class=\"lang:default decode:true \">- name: \"flush couchbase bucket \u00a0{{ bucket }}\"\r\n\r\n\u00a0 uri:\r\n\r\n\u00a0 \u00a0 url: https:\/\/{{ host }}:{{port}}\/pools\/default\/buckets\/\r\n\r\n{{ bucket }}\/controller\/doFlush\r\n\r\n\u00a0 \u00a0 method: POST\r\n\r\n\u00a0 \u00a0 user: root\r\n\r\n\u00a0 \u00a0 password: \"{{ passwd }}\"\r\n\r\n\u00a0 delegate_to: localhost\r\n\r\n<\/pre>\n<p><em>Summary<\/em><\/p>\n<p>In a modern world, when data is growing faster than ever and we need more and more machines to be able to keep and maintain our data, centralized management and automation with orchestration are very important. Consistency, overhead reduction, human error reduction, and faster processes are good reasons to start using infrastructure as code together with automation, orchestration, tools, and techniques related to this.<\/p>\n<p>The Couchbase distributed cluster is a perfect candidate. Couchbase works well with tools like Ansible and also provides a useful REST API interface. Couchbase REST API methods can be called from Ansible playbooks or Python scripts.<\/p>\n<p>DevOps practice increases the velocity and stability of deployments while also reducing failure recovery time and software update lead times.<\/p>\n<p>In the second part of this tutorial I will show step by step how to build the Ansible role for a Couchbase cluster using Couchbase REST API methods and command line commands.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Arkadiusz Borucki works as\u00a0a\u00a0Site Reliability Engineer at Amadeus, focused on NoSQL databases and automation. In his day-to-day work, he uses Couchbase, MongoDB, Oracle, Python, and Ansible. He\u2019s a self-proclaimed big data enthusiast, interested in data store technologies, distributed systems, analytics, [&hellip;]<\/p>\n","protected":false},"author":53,"featured_media":13873,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1815,1816],"tags":[1299],"ppma_author":[9026],"class_list":["post-4068","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-best-practices-and-tutorials","category-couchbase-server","tag-ansible"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.7.1 (Yoast SEO v25.7) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Infrastructure as code: Couchbase distributed cluster best practices \u2013 Part 1 introduction and theory \u00a0 - The Couchbase Blog<\/title>\n<meta name=\"description\" content=\"This blog focuses on Why use Infrastructure as Code. Why Ansible tool is used for configuration management and orchestration of your infrastructure.\" \/>\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\/infrastructure-code-couchbase-distributed-cluster-best-practices-part-1-introduction-theory\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Infrastructure as code: Couchbase distributed cluster best practices \u2013 Part 1 introduction and theory \u00a0\" \/>\n<meta property=\"og:description\" content=\"This blog focuses on Why use Infrastructure as Code. Why Ansible tool is used for configuration management and orchestration of your infrastructure.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/infrastructure-code-couchbase-distributed-cluster-best-practices-part-1-introduction-theory\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2017-10-02T11:27:43+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-06-26T07:27:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/11\/couchbase-nosql-dbaas.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1800\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Laura Czajkowski, Developer Community Manager, Couchbase\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Laura Czajkowski, Developer Community Manager, 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\/infrastructure-code-couchbase-distributed-cluster-best-practices-part-1-introduction-theory\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/infrastructure-code-couchbase-distributed-cluster-best-practices-part-1-introduction-theory\/\"},\"author\":{\"name\":\"Laura Czajkowski, Developer Community Manager, Couchbase\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/5f1a0ece4e644bc8c037686fbc8f3220\"},\"headline\":\"Infrastructure as code: Couchbase distributed cluster best practices \u2013 Part 1 introduction and theory \u00a0\",\"datePublished\":\"2017-10-02T11:27:43+00:00\",\"dateModified\":\"2019-06-26T07:27:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/infrastructure-code-couchbase-distributed-cluster-best-practices-part-1-introduction-theory\/\"},\"wordCount\":1360,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/infrastructure-code-couchbase-distributed-cluster-best-practices-part-1-introduction-theory\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"keywords\":[\"Ansible\"],\"articleSection\":[\"Best Practices and Tutorials\",\"Couchbase Server\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/infrastructure-code-couchbase-distributed-cluster-best-practices-part-1-introduction-theory\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/infrastructure-code-couchbase-distributed-cluster-best-practices-part-1-introduction-theory\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/infrastructure-code-couchbase-distributed-cluster-best-practices-part-1-introduction-theory\/\",\"name\":\"Infrastructure as code: Couchbase distributed cluster best practices \u2013 Part 1 introduction and theory \u00a0 - The Couchbase Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/infrastructure-code-couchbase-distributed-cluster-best-practices-part-1-introduction-theory\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/infrastructure-code-couchbase-distributed-cluster-best-practices-part-1-introduction-theory\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"datePublished\":\"2017-10-02T11:27:43+00:00\",\"dateModified\":\"2019-06-26T07:27:39+00:00\",\"description\":\"This blog focuses on Why use Infrastructure as Code. Why Ansible tool is used for configuration management and orchestration of your infrastructure.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/infrastructure-code-couchbase-distributed-cluster-best-practices-part-1-introduction-theory\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/infrastructure-code-couchbase-distributed-cluster-best-practices-part-1-introduction-theory\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/infrastructure-code-couchbase-distributed-cluster-best-practices-part-1-introduction-theory\/#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\/infrastructure-code-couchbase-distributed-cluster-best-practices-part-1-introduction-theory\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Infrastructure as code: Couchbase distributed cluster best practices \u2013 Part 1 introduction and theory \u00a0\"}]},{\"@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\/5f1a0ece4e644bc8c037686fbc8f3220\",\"name\":\"Laura Czajkowski, Developer Community Manager, Couchbase\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/9deb07d5daaa00220534c31768bc4409\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/bc8eebaf25cbe39bc12fd7b1ef92550becc3953ab877a3f0285a59ec2d30b754?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/bc8eebaf25cbe39bc12fd7b1ef92550becc3953ab877a3f0285a59ec2d30b754?s=96&d=mm&r=g\",\"caption\":\"Laura Czajkowski, Developer Community Manager, Couchbase\"},\"description\":\"Laura Czajkowski is the Snr. Developer Community Manager at Couchbase overseeing the community. She\u2019s responsible for our monthly developer newsletter.\",\"url\":\"https:\/\/www.couchbase.com\/blog\/author\/laura-czajkowski\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Infrastructure as code: Couchbase distributed cluster best practices \u2013 Part 1 introduction and theory \u00a0 - The Couchbase Blog","description":"This blog focuses on Why use Infrastructure as Code. Why Ansible tool is used for configuration management and orchestration of your infrastructure.","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\/infrastructure-code-couchbase-distributed-cluster-best-practices-part-1-introduction-theory\/","og_locale":"en_US","og_type":"article","og_title":"Infrastructure as code: Couchbase distributed cluster best practices \u2013 Part 1 introduction and theory \u00a0","og_description":"This blog focuses on Why use Infrastructure as Code. Why Ansible tool is used for configuration management and orchestration of your infrastructure.","og_url":"https:\/\/www.couchbase.com\/blog\/infrastructure-code-couchbase-distributed-cluster-best-practices-part-1-introduction-theory\/","og_site_name":"The Couchbase Blog","article_published_time":"2017-10-02T11:27:43+00:00","article_modified_time":"2019-06-26T07:27:39+00:00","og_image":[{"width":1800,"height":630,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/11\/couchbase-nosql-dbaas.png","type":"image\/png"}],"author":"Laura Czajkowski, Developer Community Manager, Couchbase","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Laura Czajkowski, Developer Community Manager, Couchbase","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/infrastructure-code-couchbase-distributed-cluster-best-practices-part-1-introduction-theory\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/infrastructure-code-couchbase-distributed-cluster-best-practices-part-1-introduction-theory\/"},"author":{"name":"Laura Czajkowski, Developer Community Manager, Couchbase","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/5f1a0ece4e644bc8c037686fbc8f3220"},"headline":"Infrastructure as code: Couchbase distributed cluster best practices \u2013 Part 1 introduction and theory \u00a0","datePublished":"2017-10-02T11:27:43+00:00","dateModified":"2019-06-26T07:27:39+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/infrastructure-code-couchbase-distributed-cluster-best-practices-part-1-introduction-theory\/"},"wordCount":1360,"commentCount":0,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/infrastructure-code-couchbase-distributed-cluster-best-practices-part-1-introduction-theory\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","keywords":["Ansible"],"articleSection":["Best Practices and Tutorials","Couchbase Server"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/infrastructure-code-couchbase-distributed-cluster-best-practices-part-1-introduction-theory\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/infrastructure-code-couchbase-distributed-cluster-best-practices-part-1-introduction-theory\/","url":"https:\/\/www.couchbase.com\/blog\/infrastructure-code-couchbase-distributed-cluster-best-practices-part-1-introduction-theory\/","name":"Infrastructure as code: Couchbase distributed cluster best practices \u2013 Part 1 introduction and theory \u00a0 - The Couchbase Blog","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/infrastructure-code-couchbase-distributed-cluster-best-practices-part-1-introduction-theory\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/infrastructure-code-couchbase-distributed-cluster-best-practices-part-1-introduction-theory\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","datePublished":"2017-10-02T11:27:43+00:00","dateModified":"2019-06-26T07:27:39+00:00","description":"This blog focuses on Why use Infrastructure as Code. Why Ansible tool is used for configuration management and orchestration of your infrastructure.","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/infrastructure-code-couchbase-distributed-cluster-best-practices-part-1-introduction-theory\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/infrastructure-code-couchbase-distributed-cluster-best-practices-part-1-introduction-theory\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/infrastructure-code-couchbase-distributed-cluster-best-practices-part-1-introduction-theory\/#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\/infrastructure-code-couchbase-distributed-cluster-best-practices-part-1-introduction-theory\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Infrastructure as code: Couchbase distributed cluster best practices \u2013 Part 1 introduction and theory \u00a0"}]},{"@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\/5f1a0ece4e644bc8c037686fbc8f3220","name":"Laura Czajkowski, Developer Community Manager, Couchbase","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/9deb07d5daaa00220534c31768bc4409","url":"https:\/\/secure.gravatar.com\/avatar\/bc8eebaf25cbe39bc12fd7b1ef92550becc3953ab877a3f0285a59ec2d30b754?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/bc8eebaf25cbe39bc12fd7b1ef92550becc3953ab877a3f0285a59ec2d30b754?s=96&d=mm&r=g","caption":"Laura Czajkowski, Developer Community Manager, Couchbase"},"description":"Laura Czajkowski is the Snr. Developer Community Manager at Couchbase overseeing the community. She\u2019s responsible for our monthly developer newsletter.","url":"https:\/\/www.couchbase.com\/blog\/author\/laura-czajkowski\/"}]}},"authors":[{"term_id":9026,"user_id":53,"is_guest":0,"slug":"laura-czajkowski","display_name":"Laura Czajkowski, Developer Community Manager, Couchbase","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/bc8eebaf25cbe39bc12fd7b1ef92550becc3953ab877a3f0285a59ec2d30b754?s=96&d=mm&r=g","author_category":"","last_name":"Czajkowski","first_name":"Laura","job_title":"","user_url":"","description":"Laura Czajkowski is the Snr. Developer Community Manager at Couchbase overseeing the community. She\u2019s responsible for our monthly developer newsletter."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/4068","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\/53"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/comments?post=4068"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/4068\/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=4068"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/categories?post=4068"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/tags?post=4068"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=4068"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}