Browse the Repo

file-type-icon.circleci
file-type-icon_docs
file-type-iconexamples
file-type-iconcouchbase-ami
file-type-iconcouchbase-cluster-mds
file-type-iconcouchbase-cluster-simple-dns-tls
file-type-iconcouchbase-cluster-simple
file-type-iconlocal-test
file-type-iconuser-data
file-type-iconREADME.md
file-type-iconcouchbase-multi-datacenter-replication
file-type-iconlocal-mocks
file-type-iconmodules
file-type-icontest
file-type-icon.gitignore
file-type-icon.pre-commit-config.yaml
file-type-icon.pre-commit-hooks.yaml
file-type-iconCODEOWNERS
file-type-iconCONTRIBUTING.md
file-type-iconLICENSE
file-type-iconNOTICE
file-type-iconREADME.md
file-type-iconmain.tf
file-type-iconoutputs.tf
file-type-iconvariables.tf

Browse the Repo

file-type-icon.circleci
file-type-icon_docs
file-type-iconexamples
file-type-iconcouchbase-ami
file-type-iconcouchbase-cluster-mds
file-type-iconcouchbase-cluster-simple-dns-tls
file-type-iconcouchbase-cluster-simple
file-type-iconlocal-test
file-type-iconuser-data
file-type-iconREADME.md
file-type-iconcouchbase-multi-datacenter-replication
file-type-iconlocal-mocks
file-type-iconmodules
file-type-icontest
file-type-icon.gitignore
file-type-icon.pre-commit-config.yaml
file-type-icon.pre-commit-hooks.yaml
file-type-iconCODEOWNERS
file-type-iconCONTRIBUTING.md
file-type-iconLICENSE
file-type-iconNOTICE
file-type-iconREADME.md
file-type-iconmain.tf
file-type-iconoutputs.tf
file-type-iconvariables.tf
Couchbase

Couchbase

Deploy a Couchbase cluster. Supports automatic bootstrapping, Sync Gateway, Web Console UI, cross-region replication, and auto healing.

Code Preview

Preview the Code

mobile file icon

README.md

down

Couchbase Single Cluster Example

The root folder of this repo shows an example of Terraform code that uses the couchbase-cluster module to deploy a Couchbase cluster in AWS. The cluster consists of one Auto Scaling Group (ASG) that runs all Couchbase services and Sync Gateway:

Couchbase single-cluster architecture

This example also deploys a Load Balancer in front of the Couchbase cluster using the load-balancer module.

You will need to create an Amazon Machine Image (AMI) that has Couchbase installed, which you can do using the couchbase-ami example).

To see an example of the Couchbase services and Sync Gateway deployed in separate clusters, see the couchbase-cluster-mds example. For more info on how the Couchbase cluster works, check out the couchbase-cluster documentation.

Quick start

To deploy a Couchbase Cluster:

  1. git clone this repo to your computer.
  2. Optional: build a custom Couchbase AMI. See the couchbase-ami example documentation for instructions. Make sure to note down the ID of the AMI.
  3. Install Terraform.
  4. Open the variables.tf file in the root of this repo, set the environment variables specified at the top of the file, and fill in any other variables that don't have a default. If you built a custom AMI, put its ID into the ami_id variable. If you didn't, this example will use public AMIs that Gruntwork has published, which are fine for testing/learning, but not recommended for production use.
  5. Run terraform init in the root folder of this repo.
  6. Run terraform apply in the root folder of this repo.

Connecting to the cluster

Check out How do you connect to the Couchbase cluster documentation. To log into the Couchbase Web Console, use the username and password from the cluster_username and cluster_password vars in user-data.sh.

Note that booting up and rebalancing a Couchbase cluster can take 5 - 10 minutes, depending on the number and types of instances.

Questions? Ask away.

We're here to talk about our services, answer any questions, give advice, or just to chat.

Ready to hand off the Gruntwork?