Git Product home page Git Product logo

openshift-kafka's Introduction

Thanks https://github.com/Yolean/kubernetes-kafka.

# Pre-req 
oc cluster up  # setup openshift on docker for Mac  (Skip this if you already have a cluster)
git clone https://github.com/debianmaster/openshift-kafka.git && cd openshift-kafka
oc login -u system:admin



# Create namespace
oc new-project kafka

# Unfortunately we need root priv for the containers that are used in this example
oc adm policy add-scc-to-user anyuid -z default

# Create Persistant Volumes  No londer need these
#./zookeeper/bootstrap/pv.sh
#./bootstrap/pv.sh

# Create  Persistant volumes claims
oc create -f ./bootstrap/pvc.yml
oc create -f ./zookeeper/bootstrap/pvc.yml

# Create Zookeeper & Kakfa
oc create -f ./zookeeper/service.yml
oc create -f ./zookeeper/zookeeper.yaml 
oc create -f ./

# Test
oc create -f test/99testclient.yml
oc rsh testclient   #terminal 1
oc rsh testclient   #terminal 2

## Inside testclient container Terminal 1
./bin/kafka-topics.sh --zookeeper zookeeper:2181 --topic test1 --create --partitions 1 \
--replication-factor 1 #create topic
./bin/kafka-console-consumer.sh --zookeeper zookeeper:2181 --topic test1 \
--from-beginning #read topic

## Inside testclient container Terminal 2
./bin/kafka-console-producer.sh --broker-list kafka-0.broker.kafka.svc.cluster.local:9092,\
kafka-1.broker.kafka.svc.cluster.local:9092 --topic test1    # Type message and press ^Z when done, check terminal 1


# Scale up Cluster
oc edit petset kakfa  #change replicas to desired number (make sure you have enough PV,PVC)

# Cleanup
oc delete all,petset --all
oc delete pv,pvc --all

Demo Image

openshift-kafka's People

Contributors

debianmaster avatar dynamostack avatar evie404 avatar solsson avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

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.