Coder Social home page Coder Social logo

denniscgc / mqtt-testbed Goto Github PK

View Code? Open in Web Editor NEW

This project forked from embcla/mqtt-testbed

0.0 0.0 0.0 5.2 MB

Shell 8.22% JavaScript 0.34% Ruby 0.04% C++ 0.24% Python 0.44% Perl 3.52% C 52.12% PHP 1.27% Java 0.94% CSS 0.01% Makefile 16.02% PLpgSQL 0.08% Yacc 0.06% Lex 0.05% M4 2.18% Dockerfile 0.01% Roff 14.45%

mqtt-testbed's Introduction

Distributed MQTT testbed based on docker compose

This repo contains a docker compose and then specific container configurations.

Docker Compose Concept

Pre-requisites

The docker compose configuration has the following pre-requisites:

  • a docker network has to be created before hand with the following command
$ docker network create --gateway 10.5.0.254 --subnet 10.5.0.0/16 mqtt-net
  • an mqtt-stresser docker container needs to be created from the mqtt-stresser submodule with the following command
$ make container
  • empty logs have to be created, due to the way Docker volume mounts work
$ ./setup-logs.sh

Services

Once the pre-requisites are met, the services can be started with

docker-compose up

Docker will create the following services

  • MQTT Broker 1
  • MQTT Broker 2
  • MQTT Broker 3
  • MQTT stresser 1
  • MQTT stresser 2
  • MQTT stresser 3
  • MQTT collectd 1
  • MQTT collectd 2
  • MQTT collectd 3
  • cloud bridge

Brokers

Brokers 1 to 3 have specific detailed configuration to startup and configure channel bridges to the cloud-bridge. Each subfolder contains a dedicated configuration for each broker, where logging and bridging can be modified.

Stressers

Stressers are containers running https://github.com/inovex/mqtt-stresser/ which need to be pre-built and available to the docker engine. This is already considered by the creators of the stresser, so all it takes is

cd mqtt-stresser
make container

The stress configurations are inside the docker-compose configuration, they are not persistent and so their configuration exists purely as a command line set of parameters within the container definition in docker. For other options see https://stackoverflow.com/questions/51999953/load-testing-services-for-mqtt

collectd

Collectd is not available as a package pre-built with mqtt support, so included in the repo there is a copy of the collectd source repo and a Dockerfile used to build a custom collectd image used by the compose environment. In order to correctly build the image, the only thing needed is to assign it the proper tag

cd collectd-docker
docker build . -t collectd:custom-mqtt

Visualizing MQTT data

There are many ways to visualize what goes on MQTT channels and brokers. One is mosquitto clients, like pub/sub from the command line. More advanced are UI tools like https://mqtt-explorer.com/ and https://mqttx.app/ which can connect to mulitple brokers at the same time and visualize topic updates.

mqtt-testbed's People

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.