Coder Social home page Coder Social logo

oracle-quickstart / oci-confluent Goto Github PK

View Code? Open in Web Editor NEW
8.0 8.0 3.0 4.19 MB

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

License: Apache License 2.0

HCL 67.07% Shell 32.93%
terraform oci cloud confluent kafka partner-led oracle

oci-confluent's Introduction

oci-confluent

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

Architecture

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-confluent.git

If you want to deploy community edition:

cd oci-confluent/community
ls

If you want to deploy enterprise edition (comes with 30 day free trial):

cd oci-confluent/enterprise
ls

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

That gives:

This command details what will be deployed based on the variables.tf file. 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 five 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. The cluster might take ten minutes. Now is a good time to get a coffee.

The outputs of the deploy list the public ips of all the deployed instances. You can ssh into any of the instances by running a command like:

ssh -i ~/.ssh/oci opc@<instance ip>

Confluent Control Center

If you installed the enterprise version, you can login to Confluent Control Center.

View the Cluster in OCI Console

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

Virtual Cloud Network (vcn) page:

Instances page:

Create Topics, Produce and Consume Messages

First off, let's try creating a topic.

Login to a broker instance:

ssh opc@<broker_instance_ip>

Now create a topic by running the command

/usr/bin/kafka-topics --zookeeper zookeeper-0:2181 --create --topic demo --partitions 1 --replication-factor 3

Alternatively, if you installed Enterprise Edition, you can create a topic through the Confluent Control Center Web Console.

Now we can try adding a few messages to the topic. For instance, we can use the REST API to publish 10 messages. This can be done from any machine which has access to Kafka REST API endpoint. For example:

export RPURL=http://rest-0:8082
curl -X POST -H "Content-Type: application/vnd.kafka.json.v1+json"  --data '{"records":[{"value":{"foo":"bar"}}]}' $RPURL/topics/demo

Now let's trying consuming messages:

curl -X POST -H "Content-Type: application/vnd.kafka.v1+json" --data '{"name": "ext_consumer_demo","format": "json", "auto.offset.reset": "smallest"}' $RPURL/consumers/c1
curl -X GET -H "Accept: application/vnd.kafka.json.v1+json" $RPURL/consumers/c1/instances/ext_consumer_demo/topics/demo

oci-confluent's People

Contributors

benofben avatar cpoczatek avatar pvaldria avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

oci-confluent's Issues

Minimal Open Ports

Here's what Pinkesh has open today. The architecture diagram I drew has a public and private subnet. Need to think about that.


resource "oci_core_security_list" "PublicSubnet" {
    compartment_id = "${var.compartment_ocid}"
    display_name = "Public Subnet"
    vcn_id = "${oci_core_virtual_network.confluent_vcn.id}"
    egress_security_rules = [{
        destination = "0.0.0.0/0"
        protocol = "6"
    }]
    ingress_security_rules = [{
        tcp_options {
            "max" = 22
            "min" = 22
        }
        protocol = "6"
        source = "0.0.0.0/0"
    }]
    ingress_security_rules = [{
        protocol = "6"
	source = "${var.VPC-CIDR}"
    }]
    ingress_security_rules = [{
        tcp_options {
            "max" = 9092
            "min" = 9092
        }
        protocol = "6"
        source = "0.0.0.0/0"
    }]
    ingress_security_rules = [{
        tcp_options {
            "max" = 9021
            "min" = 9021
        }
        protocol = "6"
        source = "0.0.0.0/0"
    }]
    ingress_security_rules = [{
        tcp_options {
            "max" = 8083
            "min" = 8083
        }
        protocol = "6"
        source = "0.0.0.0/0"
    }]
    ingress_security_rules = [{
        tcp_options {
            "max" = 8088
            "min" = 8088
        }
        protocol = "6"
        source = "0.0.0.0/0"
    }]
    ingress_security_rules = [{
        tcp_options {
            "max" = 8082
            "min" = 8082
        }
        protocol = "6"
        source = "0.0.0.0/0"
    }]
    ingress_security_rules = [{
        tcp_options {
            "max" = 8081
            "min" = 8081
        }
        protocol = "6"
        source = "0.0.0.0/0"
    }]
    ingress_security_rules = [{
        tcp_options {
            "max" = 2181
            "min" = 2181
        }
        protocol = "6"
        source = "0.0.0.0/0"
    }]

}

Use Fault Domains

We're focusing on single AD because performance is better and new regions only have a single AD. Need to map racks to FDs.

ZooKeeper Script

Currently getting this when it tries to start:

[root@zookeeper-2 log]# systemctl start confluent-zookeeper
[root@zookeeper-2 log]# systemctl status confluent-zookeeper
โ— confluent-zookeeper.service - Apache Kafka - ZooKeeper
Loaded: loaded (/usr/lib/systemd/system/confluent-zookeeper.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Mon 2019-03-11 00:32:20 GMT; 14s ago
Docs: http://docs.confluent.io/
Process: 12789 ExecStart=/usr/bin/zookeeper-server-start /etc/kafka/zookeeper.properties (code=exited, status=127)
Main PID: 12789 (code=exited, status=127)

Mar 11 00:32:20 zookeeper-2 systemd[1]: Started Apache Kafka - ZooKeeper.
Mar 11 00:32:20 zookeeper-2 systemd[1]: confluent-zookeeper.service: main process exited, code=exited, status=127/n/a
Mar 11 00:32:20 zookeeper-2 systemd[1]: Unit confluent-zookeeper.service entered failed state.
Mar 11 00:32:20 zookeeper-2 systemd[1]: confluent-zookeeper.service failed.
[root@zookeeper-2 log]#

Deploy Simple Cluster per Customer Ask

We have a customer asking for a simple community cluster that looks like this:

Kafka Brokers | 3 | VM.Standard.E2.4 | 700GB Block
ZooKeeper | 3 | VM.Standard.E2.2 | Standard 40GB OS Volume
Kafka Connect | 2 | VM.Standard.E2.2 | Standard 40GB OS Volume
REST Proxy | 2 | VM.Standard.E2.2 | Standard 40GB OS Volume

We need to be able to deploy this config solely by modifying variables.tf. The dev branch here has a similar example for Cloudera: https://github.com/oci-quickstart/oci-cloudera/tree/development/terraform

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.