Git Product home page Git Product logo

oci-cassandra's Introduction

oci-cassandra

These are Terraform modules that deploy Cassandra on Oracle Cloud Infrastructure (OCI).

About

The Cassandra Oracle Cloud Infrastructure Module provides a Terraform-based Cassandra cluster installation for Oracle Cloud Infrastructure (OCI). Apache Cassandra is a leading NoSQL database providing scalability and high availability without compromising performance. Linear scalability and proven fault-tolerance on cloud infrastructure makes it a compelling solution for mission-critical bid data workloads. Cassandra supports replicating across multiple datacenters, providing lower latency for users and the peace of mind of knowing that you can survive regional outage.

Cassandra cluster architecture

Prerequisites

  1. Download and install Terraform (v0.13 or later)
  2. Download and install the OCI Terraform Provider (v4.10 or later)
  3. Export OCI credentials. (this refer to the https://github.com/oracle/terraform-provider-oci )
  4. An existing VCN with subnets, and those subnets need internet access in order to download tools and files.

What's a Module?

A Module is a canonical, reusable, best-practices definition for how to run a single piece of infrastructure, such as a database or server cluster. Each Module is created using Terraform, and includes automated tests, examples, and documentation. It is maintained both by the open source community and companies that provide commercial support. Instead of figuring out the details of how to run a piece of infrastructure from scratch, you can reuse existing code that has been proven in production. And instead of maintaining all that infrastructure code yourself, you can leverage the work of the Module community to pick up infrastructure improvements through a version number bump.

How to use this Module

Each Module has the following folder structure:

  • root: This folder contains a root module called cassandra-node to create a Cassandra cluster in OCI.
  • modules: This folder contains the reusable code for this Module, broken down into one or more modules.
  • examples: This folder contains examples of how to use the modules.
    • example-1: This is an example of how to use terraform-oci-cassandra-cluster module to deploy a Cassandra cluster in OCI by using an existing VCN, Security list and Subnet.
    • example-2: This example creates a VCN (3 ADs scenario) in Oracle Cloud Infrastructure including default route table, DHCP options, security list and subnet (public) from scratch, then use terraform-oci-cassandra-cluster module to deploy a Cassandra cluster.
    • example-3: This example creates a VCN (single ADs scenario) in Oracle Cloud Infrastructure including default route table, DHCP options, security list and subnet (public) from scratch, then use terraform-oci-cassandra-cluster module to deploy a Cassandra cluster.
    • example-4: This example creates a VCN (single ADs scenario) in Oracle Cloud Infrastructure including default route table, DHCP options, security list and subnets (private for Cassandra, public for Bastion Service) from scratch, then use terraform-oci-cassandra-cluster module to deploy a Cassandra cluster.

To deploy a Cassandra cluster using this Module:

module "cassandra" {
  source               = "../../"
  compartment_ocid     = var.compartment_ocid
  node_count           = "3"
  seeds_count          = "3"
  availability_domains = data.template_file.ad_names.*.rendered
  subnet_ocids         = var.subnet_ocids
  vcn_cidr             = var.vcn_cidr
  image_ocid           = var.image_ocid[var.region]
  storage_port         = "7000"
  ssl_storage_port     = "7001"
  ssh_authorized_keys  = file(var.ssh_authorized_keys)
  ssh_private_key      = file(var.ssh_private_key)
  cassandra_version    = "3.11.10"
  defined_tags         = "<some-tags-you-want-to-add-to-the-nodes>"
}
Argument Description
compartment_ocid Compartment OCID where VCN is created.
ssh_authorized_keys Public SSH keys path to be included in the ~/.ssh/authorized_keys file for the default user on the instance.
ssh_private_key The private key path to access instance.
label_prefix To create unique identifier for multiple clusters in a compartment.
node_count The number of Cassandra nodes in the cluster (SEED and Non-SEED nodes).
seeds_count The number of Cassandra SEED nodes in the cluster.
availability_domains The Availability Domain(s) for Cassandra node(s).
subnet_ocids List of Cassandra node subnets' ids.
vcn_cidr Virtual Cloud Network's CIDR block.
node_display_name The name of the Cassandra node.
cluster_display_name The Cassandra cluster name.
image_ocid The OCID of an image on which the Cassandra node instance is based. You can refer to https://docs.us-phoenix-1.oraclecloud.com/images/ for more details.
node_shape Instance shape for node instance to use.
node_flex_shape_ocpus Number of OCPUs in case of flexible shape usage.
node_flex_shape_memory Number of GB of memory in case of flexible shape usage.
storage_port TCP port for commands and data among Cassandra nodes.
ssl_storage_port SSL port for encrypted communication among Cassandra nodes.
cassandra_version Version of the Cassandra to be installed.
defined_tags optional tags for Cassandra nodes.

oci-cassandra's People

Contributors

benofben avatar jiangcheng2018 avatar lfeldman avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

oci-cassandra's Issues

Cassandra node creation fails running remote-exec

I used shape BM.DenseIO2.52

I executed terraform apply using the example 1.
This results in the following error: "mdadm: cannot open /dev/nvme8n1: No such file or directory"

Log:

module.cassandra.module.cassandra-node.null_resource.remote-exec-scripts[1] (remote-exec): Dependencies Resolved

module.cassandra.module.cassandra-node.null_resource.remote-exec-scripts[1] (remote-exec): ========================================
module.cassandra.module.cassandra-node.null_resource.remote-exec-scripts[1] (remote-exec): Package
module.cassandra.module.cassandra-node.null_resource.remote-exec-scripts[1] (remote-exec): Arch Version Repository Size
module.cassandra.module.cassandra-node.null_resource.remote-exec-scripts[1] (remote-exec): ========================================
module.cassandra.module.cassandra-node.null_resource.remote-exec-scripts[1] (remote-exec): Updating:
module.cassandra.module.cassandra-node.null_resource.remote-exec-scripts[1] (remote-exec): mdadm
module.cassandra.module.cassandra-node.null_resource.remote-exec-scripts[1] (remote-exec): x86_64 4.1-4.el7 ol7_latest 438 k

module.cassandra.module.cassandra-node.null_resource.remote-exec-scripts[1] (remote-exec): Transaction Summary
module.cassandra.module.cassandra-node.null_resource.remote-exec-scripts[1] (remote-exec): ========================================
module.cassandra.module.cassandra-node.null_resource.remote-exec-scripts[1] (remote-exec): Upgrade 1 Package

module.cassandra.module.cassandra-node.null_resource.remote-exec-scripts[1] (remote-exec): Total download size: 438 k
module.cassandra.module.cassandra-node.null_resource.remote-exec-scripts[1] (remote-exec): Downloading packages:
module.cassandra.module.cassandra-node.null_resource.remote-exec-scripts[1] (remote-exec): Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
module.cassandra.module.cassandra-node.null_resource.remote-exec-scripts[1] (remote-exec): mdadm-4.1-4.el7.x8 | 438 kB 00:00
module.cassandra.module.cassandra-node.null_resource.remote-exec-scripts[1] (remote-exec): Running transaction check
module.cassandra.module.cassandra-node.null_resource.remote-exec-scripts[1] (remote-exec): Running transaction test
module.cassandra.module.cassandra-node.null_resource.remote-exec-scripts[1] (remote-exec): Transaction test succeeded
module.cassandra.module.cassandra-node.null_resource.remote-exec-scripts[1] (remote-exec): Running transaction
module.cassandra.module.cassandra-node.null_resource.remote-exec-scripts[1] (remote-exec): Updating : mdadm-4. [ ] 1/2
module.cassandra.module.cassandra-node.null_resource.remote-exec-scripts[1] (remote-exec): Updating : mdadm-4. [# ] 1/2
module.cassandra.module.cassandra-node.null_resource.remote-exec-scripts[1] (remote-exec): Updating : mdadm-4. [## ] 1/2
module.cassandra.module.cassandra-node.null_resource.remote-exec-scripts[1] (remote-exec): Updating : mdadm-4. [### ] 1/2
module.cassandra.module.cassandra-node.null_resource.remote-exec-scripts[1] (remote-exec): Updating : mdadm-4. [#### ] 1/2
module.cassandra.module.cassandra-node.null_resource.remote-exec-scripts[1] (remote-exec): Updating : mdadm-4. [##### ] 1/2
module.cassandra.module.cassandra-node.null_resource.remote-exec-scripts[1] (remote-exec): Updating : mdadm-4. [###### ] 1/2
module.cassandra.module.cassandra-node.null_resource.remote-exec-scripts[1] (remote-exec): Updating : mdadm-4. [####### ] 1/2
module.cassandra.module.cassandra-node.null_resource.remote-exec-scripts[1] (remote-exec): Updating : mdadm-4. [######## ] 1/2
module.cassandra.module.cassandra-node.null_resource.remote-exec-scripts[1] (remote-exec): Updating : mdadm-4.1-4.el7.x8 1/2
module.cassandra.module.cassandra-node.null_resource.remote-exec-scripts[1] (remote-exec): Cleanup : mdadm-4.0-5.el7.x8 2/2
module.cassandra.module.cassandra-node.null_resource.remote-exec-scripts[1] (remote-exec): Verifying : mdadm-4.1-4.el7.x8 1/2
module.cassandra.module.cassandra-node.null_resource.remote-exec-scripts[1] (remote-exec): Verifying : mdadm-4.0-5.el7.x8 2/2

module.cassandra.module.cassandra-node.null_resource.remote-exec-scripts[1] (remote-exec): Updated:
module.cassandra.module.cassandra-node.null_resource.remote-exec-scripts[1] (remote-exec): mdadm.x86_64 0:4.1-4.el7

module.cassandra.module.cassandra-node.null_resource.remote-exec-scripts[1] (remote-exec): Complete!
module.cassandra.module.cassandra-node.null_resource.remote-exec-scripts[1] (remote-exec): + sudo mdadm --create /dev/md0 --chunk=256 --raid-devices=9 --level=6 /dev/nvme0n1 /dev/nvme1n1 /dev/nvme2n1 /dev/nvme3n1 /dev/nvme4n1 /dev/nvme5n1 /dev/nvme6n1 /dev/nvme7n1 /dev/nvme8n1
module.cassandra.module.cassandra-node.null_resource.remote-exec-scripts[1] (remote-exec): mdadm: cannot open /dev/nvme8n1: No such file or directory

Error: error executing "/tmp/terraform_25516934.sh": Process exited with status 2

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.