Giter VIP home page Giter VIP logo

zookeeper-demo's Introduction

Apache Zookeeper Demo

Overview

This repository hold manifests for Zookeeper demo.

Details:

  1. These files are required for the demo.
├── add-configuration.py # it will create a data node and add configuration on that node.
├── delete-node.py # it will delete the data node 
├── distributed-system-service.py # it will extract data from the data node
└── update_configuration.py # it will update the data node.
  1. Start Zookeeper service:

    • Download Zookeeper binaries.

    • Extract the content:

    tar -xvf apache-zookeeper-x.x.x-bin.tar.gz
    • Rename the default zookeeper config file. It is available in apache-zookeeper-x.x.x-bin/conf folder:
    mv zoo_sample.cfg zoo.cfg
    • Start the service using the command given below:
    # move inside the folder containing zookeeper manifests
    cd apache-zookeeper-x.x.x-bin
    
    # start the service
    sudo ./bin/zkServer.sh start
    • To stop the service, use the command given below:
    sudo ./bin/zkServer.sh stop
  2. Install python3.

  3. Install required python3 modules:

python3 install -r requirements.txt
  1. Now start the distributed system's service:
python3 distributed-system-service.py

It will perform following tasks:

  • It will check whether the data node is created or not, after a defined interval of 5 seconds.
  • Once data node is created it will populate SERVICE_CONFIG dict with the data on the node.
  • It will add watch method on the data node to update the SERVICE_CONFIG if any change occurs on the data node.
  • It will continue to print the SERVICE_CONFIG on the terminal at a interval of 10 seconds.
  1. Create a data node and populate it with data:
python3 add-configuration.py
  1. When the data node is created and populated with data the change can be seen in the service logs on the terminal that was started in the previous step.

  2. Update the data on the node:

python3 update_configuration.py

If the data node is updated successfully it can be seen in the service logs that the config is also updated.

  1. Delete the data node:
python3 delete-node.py

zookeeper-demo's People

Contributors

aliartiza75 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

xiez aliartiza75

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.