Giter Site home page Giter Site logo

chaitut715 / hadoop-docker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from juancasado/hadoop-docker

0.0 1.0 0.0 91.25 MB

Hadoop deployment on docker and Docker Swarm

Home Page: http://www.mrblissfulgrin.com

Dockerfile 9.34% Shell 27.54% HiveQL 5.79% PigLatin 6.66% Python 1.27% HTML 2.09% JavaScript 47.30%

hadoop-docker's Introduction

Hadoop stack

Using Hadoop 3.2.1 over debian 9 with JDK-8. The stack deploys a multi node hadoop with the following components installed.

  • Flume 1.7.0
  • HBase 2.2.4
  • Pig 0.17.0
  • Hive 3.1.2
  • PostgreSQL 12.2.0
  • Zookeeper 3.4.10

Setup

Before stating the compose or the swarm deployment the base container needs to be created. This can be done by running:

./setup.sh

Then the rest of the images can be built with:

docker-compose build

For swarm to run docker-compose docker-machine are needed.

Hadoop Compose single node

A fixed sized multi node node hadoop installation with just a single node. Easy to use, manage and deploy with docker-compose. New node managers or data nodes can be added manually to create a new fixed size deployment (not recommend, instead use swarm).

Do not start both swarm and compose at the same time, namespaces may collide.

Starting containers

  docker-compose up

Stopping the containers

  ^C
  docker-compose down

Hadoop Swarm multi node

The full multi node hadoop potential is unleashed. Each component can be replicated which will extend the number of instances of data nodes and node managers.

Starting swarm

This will build the images needed for the swarm. Also the containers can be build manually before starting the swarm.

  ./swarm.sh up

Swarm will start a swarm visualizer on port 8080.

Stopping swarm

  ./swarm.sh down

Accessing services

If swarm mode is used localhost needs to be changed for the IP that swarm creates for its entry point, that IP is printed when swarm up is run. Also it can be checked with:

  docker-machine ls

It will be the IP of the master.

Extracting data with flume

  docker-compose -f docker-compose-data.yml up flume

By modifying docker-compose-data.yml env.SOURCE parameter container execution can be changed. Options are:

  SOURCE: "TwitterSpainpbKeywords"
  SOURCE: "TwitterSpainPB"
  SOURCE: "TwitterMadrid"
  SOURCE: "TwitterKeywords"
  SOURCE: "TwitterBarcelona"

To access the container:

  command: "bash"

Moving data from hdfs to hbase with pig

  docker-compose -f docker-compose-data.yml up pig

By modifying docker-compose-data.yml command parameter container execution can be changed. Options are:

  command: "pig -x local /scripts/analysis.pig"
  command: "pig -x mapreduce /scripts/analysis.pig"

To access the container:

  command: "bash"

Exploiting Twitter

By following the Lambda architecture this hadoop installation can be used by performing the following actions:

  1. Create Hbase and Hive tables if not yet created
  2. Extract data from Twitter with Flume and save it on HDFS
  3. Load that data from HDFS into Hbase
  4. Delete the data from HDFS
  5. Repeat from step 2

This actions have already been implemented leaving the data ready to use in Hive by running

  ./exploit.sh

Configuring hadoop

The available configurations are:

  • /etc/hadoop/core-site.xml CORE_CONF
  • /etc/hadoop/hdfs-site.xml HDFS_CONF
  • /etc/hadoop/yarn-site.xml YARN_CONF
  • /etc/hadoop/httpfs-site.xml HTTPFS_CONF
  • /etc/hadoop/kms-site.xml KMS_CONF
  • /etc/hadoop/mapred-site.xml MAPRED_CONF

If you need to extend some other configuration file, refer to base/entrypoint.sh bash script.

hadoop-docker's People

Contributors

chaitut715 avatar juancasado avatar

Watchers

 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.