Git Product home page Git Product logo

flocker-pipelinedb's Introduction

flocker-pipelinedb

Demo video

Flocker PipelineDB demo

Step 1 - Provision Cluster

Install

  • 3 node Flocker-Swarm cluster

    • 1 Control Node
    • 2 Agent Nodes
    • 1 Client Node to execute your docker commands from

    If you choose to create the stack manually, please restart Docker on Agent Node 1 with a tag flocker-node==1, and Agent Node 2 with tag flocker-node==2 (by adding --label flocker-node=${node_number} to DOCKER_OPTS variable in /etc/default/docker).

Please run below steps from the client node.

Step 2 - Prepare Client

  • Set DOCKER_HOST to point to Swarm Manager (export DOCKER_HOST=tcp://54.86.117.247:2376).

  • git clone https://github.com/myechuri/flocker-pipelinedb.git

Step 3 - Start PipelineDB server on Agent Node 1

  • cd flocker-pipelinedb

  • Start PipelineDB server on Agent Node 1:


docker-compose -f pipelinedb-node1.yml up
  • Connect to PipelineDB server on Agent Node 1, create database twitter with static stream tweets, and a continuous view tagstream that pulls hashtags from tweets within past one hour.
ubuntu@ip-172-31-7-164:~$ psql -h 54.173.243.221  -p 5432 -U pipeline
Password for user pipeline:


pipeline=# create database twitter;
CREATE DATABASE

pipeline=# \c twitter
You are now connected to database "twitter" as user "pipeline".
twitter=# create stream tweets ( content json );
CREATE STREAM

twitter=# CREATE CONTINUOUS VIEW tagstream as SELECT json_array_elements(content #> ARRAY['entities','hashtags']) ->> 'text' AS tag FROM tweets WHERE arrival_timestamp > ( clock_timestamp() - interval '1 hour' );

CREATE CONTINUOUS VIEW

Step 4 - Generate streaming workload

environment:
  CONSUMER_KEY: ''
  CONSUMER_SECRET: ''
  ACCESS_TOKEN_KEY: ''
  ACCESS_TOKEN_SECRET: ''
  PIPELINE_SERVER_HOST_IP:

Run the container for a few minutes, then terminate.

docker-compose -f twitter-workload-node1.yml up

If you want it to run in the background indefinitely add the -d flag

docker-compose -f twitter-workload-node1.yml up -d

Step 5 - Verify workload reached PipelineDB

  • Connect to PipelineDB server on Agent Node 1, and verify workload reached the server.
twitter=# select * from tagstream limit 5;

Step 6 - Relocated PipelineDB to Agent Node 2

  1. Stop PipelineDB server on Agent Node 1

docker-compose -f pipelinedb-node1.yml stop
docker-compose -f pipelinedb-node1.yml rm -f
  1. Move PipelineDB server to Agent Node 2 by Docker Composing up with a manifest constraining it to Agent Node 2.

docker-compose -f pipelinedb-node2.yml up

Step 7 - Verify state persisted across relocation

  • Connect to PipelineDB server on Agent Node 2, then select from tagstream - you should see the same output as in Step 5.

twitter=# select * from tagstream limit 5;

Motivation

This demo is based on PipelineDB workflow suggested in this blogpost.

Acknowledgements

This demo is made possible by:

  • Josh Berkus, Derek Nelson, Usman Masood from PipelineDB.

  • ClusterHQ Engineering and Marketing.

flocker-pipelinedb's People

Contributors

myechuri avatar

Watchers

 avatar  avatar

Forkers

stephenitis

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.