Coder Social home page Coder Social logo

oracle-quickstart / oci-couchbase Goto Github PK

View Code? Open in Web Editor NEW
3.0 10.0 5.0 5.14 MB

Terraform module to deploy Couchbase on Oracle Cloud Infrastructure (OCI)

License: Apache License 2.0

Shell 29.76% HCL 59.87% Python 10.37%
terraform oci cloud couchbase syncgateway nosql partner-led oracle

oci-couchbase's Introduction

oci-couchbase

These are Terraform modules that deploy Couchbase Enterprise on Oracle Cloud Infrastructure (OCI). They are developed jointly by Oracle and Couchbase.

  • simple is a Terraform module that will deploy Couchbase on OCI. Instructions on how to use it are below.
  • generator is a Python script that will create a Terraform module. It can be used to generate more complex configurations that take advantage of MDS.

Prerequisites

First off you'll need to do some pre deploy setup. That's all detailed here.

Clone the Module

Now, you'll want a local copy of this repo. You can make that with the commands:

git clone https://github.com/oracle-quickstart/oci-couchbase.git
cd oci-couchbase/simple
ls

That should give you this:

We now need to initialize the directory with the module in it. This makes the module aware of the OCI provider. You can do this by running:

terraform init

This gives the following output:

Deploy

Now for the main attraction. Let's make sure the plan looks good:

terraform plan

You'll be prompted to enter a value for var.adminPassword if you haven't set a default in variables.tf. That gives:

If that's good, we can go ahead and apply the deploy:

terraform apply

You'll need to enter yes when prompted. The apply should take about seven minutes to run. Once complete, you'll see something like this:

When the apply is complete, the infrastructure will be deployed, but cloud-init scripts will still be running. Those will wrap up asynchronously. So, it'll be a few more minutes before your cluster is accessible. Now is a good time to get a coffee.

Connect to the Cluster

When the terraform apply completed, it printed out two values. One of those is the URL to access Couchbase Server, the other one is for Couchbase Sync Gateway. First, let's try accessing Server on port 8091 of the public IP. You should see this:

Now enter in the username (default couchbase) and password you specified in variables.tf, or the value you entered when prompted if not defined in the file. You should now have a view of your cluster and the services running.

Couchbase runs the admin interface on every node. So, we could login to any node in the cluster to see this view.

Next, let's access to Sync Gateway on port 4984 of its public IP. You should see:

SSH to a Node

These machines are using Oracle Enterprise Linux (OEL). The default login is opc. You can SSH into the machine with a command like this:

ssh -i ~/.ssh/oci opc@<Public IP Address>

Couchbase is installed under /opt/couchbase/bin. You can debug deployments by investigating the cloud-init log file /var/log/messages. You'll need to sudo su to be able to read it.

View the Cluster in the Console

You can also login to the web console here to view the IaaS that is running the cluster.

Destroy the Deployment

When you no longer need the deployment, you can run this command to destroy it:

terraform destroy

You'll need to enter yes when prompted. Once complete, you'll see something like this:

oci-couchbase's People

Contributors

benofben avatar cpoczatek avatar mjmcdonough avatar oguzpastirmaci avatar sliburd avatar zkaufman avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

oci-couchbase's Issues

Support XDCR across Public Internet

Right now OCI doesn't offer public DNS, only public IP, private IP and private DNS. While networks within OCI can be peered for XDCR, that doesn't solve for the cross cloud and hybrid XDCR case (a cluster in Azure and one in OCI for example). This is another case of what we've previously discussed @anilkumar29 and quite similar to restrictions on GCP. cc @mjmcdonough so he's aware of the gap.

Server deploy is busted

couchbase-server systemd: Binding to IPv6 address not available since kernel does not support IPv6.
Mar 12 05:11:35 couchbase-server systemd: Binding to IPv6 address not available since kernel does not support IPv6.
Mar 12 05:11:35 couchbase-server cloud-init: Setting swappiness to 0...
Mar 12 05:11:35 couchbase-server cloud-init: vm.swappiness = 0
Mar 12 05:11:35 couchbase-server cloud-init: Configuring Couchbase Server...
Mar 12 05:11:35 couchbase-server cloud-init: Using the settings:
Mar 12 05:11:35 couchbase-server cloud-init: rallyDNS 'group1.couchbase.couchbase.oraclevcn.com'
Mar 12 05:11:35 couchbase-server cloud-init: nodeDNS 'couchbase-server.couchbase.couchbase.oraclevcn.com'
Mar 12 05:11:35 couchbase-server cloud-init: services ''
Mar 12 05:11:35 couchbase-server cloud-init: Running couchbase-cli node-init
Mar 12 05:11:35 couchbase-server cloud-init: node-init output 'ERROR: Unable to connect to host at http://couchbase-server.couchbase.couchbase.oraclevcn.com:8091'
Mar 12 05:11:40 couchbase-server systemd: Got automount request for /proc/sys/fs/binfmt_misc, triggered by 17414 (df)
Mar 12 05:11:40 couchbase-server systemd: Mounting Arbitrary Executable File Formats File System...
Mar 12 05:11:40 couchbase-server systemd: Mounted Arbitrary Executable File Formats File System.
Mar 12 05:11:46 couchbase-server cloud-init: node-init output 'SUCCESS: Node initialized'
Mar 12 05:11:56 couchbase-server cloud-init: Running couchbase-cli server-add
Mar 12 05:11:56 couchbase-server cloud-init: server-add output 'ERROR: Cluster is not initialized, use cluster-init to initialize the cluster'
Mar 12 05:12:06 couchbase-server cloud-init: server-add output 'ERROR: Cluster is not initialized, use cluster-init to initialize the cluster'
Mar 12 05:12:16 couchbase-server cloud-init: server-add output 'ERROR: Cluster is not initialized, use cluster-init to initialize the cluster'
Mar 12 05:12:26 couchbase-server cloud-init: server-add output 'ERROR: Cluster is n

Add a Data Disk

Right now we're just using the boot volume to store the database.

Restrict Network

Right now everything is open. We might want to be more selective about open ports.

Clean up sync gateway start

noticed this in the logs:


t: -verbose=false: Log more info about requests
Mar 12 05:09:06 couchbase-syncgateway cloud-init: By using this software you agree to the End User License Agreement.
Mar 12 05:09:06 couchbase-syncgateway cloud-init: See /opt/couchbase-sync-gateway/LICENSE.txt.
Mar 12 05:09:06 couchbase-syncgateway cloud-init: /var/lib/cloud/instance/scripts/part-001: line 29: /opt/sync_gateway/etc/sync_gateway.json: No such file or directory
Mar 12 05:09:06 couchbase-syncgateway cloud-init: chmod: cannot access ‘/opt/sync_gateway/etc/sync_gateway.json’: No such file or directory
Mar 12 05:09:06 couchbase-syncgateway cloud-init: chown: cannot access ‘/opt/sync_gateway/etc/sync_gateway.json’: No such file or directory
Mar 12 05:09:06 couchbase-syncgateway cloud-init: chgrp: cannot access ‘/opt/sync_gateway/etc/sync_gateway.json’: No such file or directory
Mar 12 05:09:06 couchbase-syncgateway dracut: dracut module 'plymouth' will not be installed, because it's in the list to be omitted!
Mar 12 05:09:06 couchbase-syncgateway cloud-init: Redirecting to /bin/systemctl stop sync_gateway.service
Mar 12 05:09:06 couchbase-syncgateway systemd: Stopping Couchbase Sync Gateway server...

Remove remote exec

Hi @OguzPastirmaci,

I see some of the changes have a remote exec. I think we should avoid having a dependency on that if at all possible. It breaks the fire and forget model usually available in IaC deploys. It also doesn't scale as you have to SSH to each node. Please refactor to remove that.

Recommend Projects

  • React photo React

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

  • Vue.js photo Vue.js

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

  • Typescript photo Typescript

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

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

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

  • web

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

  • server

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

  • Machine learning

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

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

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

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.