Code Monkey home page Code Monkey logo

datacenter-sensor's Introduction

datacenter-sensor

Introduction

This repository supports my Dockercon talk and demo

Docker and IoT securing the server-room with realtime microservices by Alex Ellis

In this hack, we secure the data-center through a scaleable network of real-time sensors and microservices running Docker. Each rack in the server-room is filled with thousands of terabytes of priceless customer data, IoT lets us keep one step ahead and keep that data safe. The cluster deploys a set of smart sensors running the Docker Swarm agent to the rack panels.

Each sensor constantly samples the ambient temperature of the rack and sends a real-time alarm to the control room when levels rise above normal levels. An anti-tamper motion sensor picks up tiny vibrations and alerts the admins when someone is performing unscheduled maintenance on the equipment. A custom made RGB LED display made by Pimoroni for Dockercon shows the status of up to 8 racks in real-time.

Swag

Producing the Hack

Thanks for the support

A large percentage of the hardware for this hack is being supplied by Pimoroni.com - so a huge thanks to them for helping out. They also designed a brand new add-on board for the Raspberry Pi with 8 RGB LEDs just for this demo and gave me early access to their environmental sensing board - envirophat.

Come to the live demo at Dockercon for all the rest of the details. We'll have a time for Q&A come prepared!

See also: original Dockercon hack entry

Visualizing a production-ready load-balancer with LEDs and Docker Swarm

Contributions

I'm not accepting pull-requests to the demo code at present, but feel free to fork it or re-use elements in your own projects in-line with the MIT license.

Booting up the demo

Step 1

Log into the manager and start the Docker Swarm manager image and consul as a key-value store with this shell script:

$ datacenter-sensor/start_manage.sh

Step 2

Log into each additional Pi Zero and launc the Swarm Agent:

$ datacenter-sensor/join/auto_join.sh

The Consul IP address has to be hard-coded into the systemd docker.service file and this batch file.

Step 3

Enter: Docker-compose

Point the DOCKER_HOST environmental variable to the swarm manager and type in:

$ export DOCKER_HOST=tcp://manager1.local:2376

$ docker-compose up -d

Step 4

Then once running you can scale up the sensor service to the number of sensor Pis in your network.

$ docker-compose scale sensor=4

Step 5

Profit.

If you want to open the web-dashboard, then use docker-compose ps to find where it has been placed in the swarm and which port has been dynamically assigned to it.

When you're done you can use docker-compose stop to pause the demo or docker-compose down to clean everything up.

Sneak previews:

Descending date of release.

datacenter-sensor's People

Contributors

alexellis 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.