-
Notifications
You must be signed in to change notification settings - Fork 1
Mosquitto Docker Compose
perf_test
App
This page describes how to create a Docker environment and launch a Mosquitto cluster using docker-compose
.
❗ You must first install Docker and Docker Compose. See References for download links.
Make sure you switch into the correct Mosquitto cluster before creating a Docker cluster. The create_docker
command applies the current cluster settings to the Docker Compose files.
# Create and switch into a Mosquitto cluster
create_cluster -product mosquitto -cluster mymosquitto
switch_cluster mymosquitto
Once you are switched into the cluster, run the create_docker
command which creates a Docker cluster that is specific to that product.
# Create Mosquitto cluster with 3 members (default) with the default host name prefix, 'broker'.
# You can change the prefix with the -prefix option.
create_docker -cluster edge
By default, the create_docker command adds two (3) Mosquitto brokers (members) in the cluster. You can change the number of brokers using the -count
option. For example, the following command adds five (5) brokers.
# Create Mosquitto cluster with five (5) brokers with the default host name prefix, 'broker'.
create_docker -cluster edge -count 5
cd_docker edge
Edit the .env
file as needed.
vi .env
There are four configuration files as follows. Edit them as needed.
Configuration File | For |
---|---|
padogrid/etc/mqttv5-client.yaml |
HaMqttClient |
padogrid/etc/simulator.yaml |
MQTT data feed |
The padogrid-mqtt
containers are configured with the padogrid/etc/simulator.yaml
file for publishing simulated data. Before starting the containers, you can replace or modify this file as needed to generate the desired data.
vi padogrid/etc/simulator.yaml
cd_docker edge
docker compose up
If you launched the default cluster, i.e., three (3) brokers, then you can create and run vc_subscribe
without the endpoints specified. By default, vc_subscribe creates a virtual cluster comprised of the endpoints tcp://localhost:1883-1885
.
The following command listens on data published by the first broker, broker1
, or the endpoint, tcp://localhost:18883
.
# Subscribe to broker1 - tcp://localhost:1883
vc_subscribe -t edge/broker1/#
To listen on messages from all the brokers, subscribe to edge/#
.
# Subscribe to all of the default brokers
vc_subscribe -t edge/#
If you have created cluster with additional brokers, then you can specify the -endpoints
option to create a virutal cluster that includes them. For example, the following includes five (5) endpoints.
# Subscribed to five (5) brokers
vc_subscribe -endpoints tcp://localhost:1883-1887 -t edge/#
The simulator comes in a bundle, which also includes the chart_mqtt
command that graphically displays the simulated MQTT data. You can install the bundle as follows.
install_bundle -download -quiet bundle-none-app-simulator
Once installed, change directory to simulator
and run the chart_mqtt
command as follows.
cd_app simulator/bin_sh
./build_app
./chart_mqtt -t edge/broker1/sine
The simulator in each padogrid-mqtt
container publishes to numerous topics. You can find the topic names from the vc_subscribe
output or the simulator.yaml
file.
cd_docker edge
cat padogrid/etc/simulator.yaml
Some interesting charts are as follows.
cd_app simulator/bin_sh
./chart_mqtt -t edge/broker1/dampedSineWave
./chart_mqtt -t edge/broker1/circle
./chart_mqtt -t edge/broker1/tanh
./chart_mqtt -t edge/broker1/heartbeat
Like vc_subscribe
, chart_mqtt
also supports the -endpoints
option. The following chart_mqtt
command creates a virtual cluster that includes five (5) brokers and displays the circle
data published by broker5
that has the endpoint tcp://localhost:1887
.
# Both of the following display the same data received from broker5
./chart_mqtt -endpoints tcp://localhost:1883-1887 -t edge/broker5/circle
./chart_mqtt -endpoints tcp://localhost:1887 -t edge/broker5/circle
If you have launched the default cluster, i.e., three (3) brokers, then you can create and run perf_test
as is. If you have changed the cluster endpoints, then you need to set the endpoints for perf_test
in the etc/mqttv5-client.yaml
file as follows.
create_app
cd_app perf_test; cd bin_sh
vi etc/mqttv5-client.yaml
Change the value of serverURIs
accordiningly.
serverURIs: [tcp://localhost:1883-1885]
Run perf_test
.
cd bin_sh
./test_group -run
Ctrl-C from the docker compose up
command and prune the containers.
docker compose down
docker container prune
- If you get the "No space left on device" error when you start
docker compose
, run the following to free up the disk space.
docker system prune --volumes
- Install Docker, ttps://docs.docker.com/install/.
- Install Docker Compose, Docker Compose is now part of the
docker
command. Before installingdocker-compose
, check to see if this option exists, https://docs.docker.com/compose/install/. - Data Feed Simulator, bundle-none-app-simulator, PadoGrid Bundles, https://github.com/padogrid/bundle-none-app-simulator.
PadoGrid Manual
Overview
- Home
- PadoGrid in 5 Minutes
- Quick Start
- Introduction
- Bundle Catalogs
- Building PadoGrid
- Supported Data Grid Products and Downloads
- PadoGrid Components
- Installing PadoGrid
- Root Workspaces Environments (RWEs)
- Initializing PadoGrid
- Bash Auto-Completion
- Viewing PadoGrid Summaries
- Updating Products
- Upgrading PadoGrid
- Migrating Workspaces
- PadoGrid Pods
- Kubernetes
- Docker
- Apps
- Software List
Operations
- Workspace Lifecycle Management
- Creating RWE
- Creating Workspace and Starting Cluster
- Managing Workspaces
- Understanding Workspaces
- Understanding Clusters
- Running Clusters
- Default Port Numbers
- Running Clusters Independent of PadoGrid
- Running Apps
- Understanding Groups
- Running Groups
- Understanding Bundles
- User Bundle Repos
- Using Bundle Templates
- Bundle Repo Guidelines
- User Bundle Catalogs
- Private Bundle Repos
- Gitea Repos
- Running Bundles in Container
- PadoGrid Addon Jars
- Understanding PadoGrid Pods
- Tested Vagrant Boxes
- VM-Enabled Pods
- Multitenancy
- Multitenancy Best Practices
- PadoGrid Configuration Files
Tools
Platforms
Clouds
Pado
Geode/GemFire
- Geode CLASSPATH
- Geode Kubernetes
- Geode Minikube
- Geode Minikube on WSL
- Geode Docker Compose
- Geode Grafana App
- Geode
perf_test
App - Geode WAN Example
- Geode Workspaces on VMs
- Geode on AWS EC2
- Reactivating Geode Workspaces on AWS EC2
Hazelcast/Jet
- Hazelcast CLASSPATH
- Creating Jet Workspace
- Configuring Hazelcast Addon
- HQL Query
- Hazelcast Kubernetes
- Hazelcast GKE
- Hazelcast Minikube
- Hazelcast Minikube on WSL
- Hazelcast Minishift/CDK
- Hazelcast OpenShift
- Hazelcast Docker Compose
- Hazelcast Desktop App
- Hazelcast Grafana App
- Hazelcast
jet_demo
App - Hazelcast
perf_test
App - Hazelcast WAN Example
- Hazelcast Workspaces on VMs
- Hazelcast on AWS EC2
- Reactivating Hazelcast Workspaces on AWS EC2
ComputeDB/SnappyData
Coherence
Hadoop
Kafka/Confluent
Mosquitto
- Mosquitto CLASSPATH
- Mosquitto Overview
- Installing/Building Mosquitto
- Clustering MQTT
- Cluster Archetypes
- Enabling Mosquitto SSL/TLS
- Mosquitto Docker Compose
- MQTT perf_test App
Redis
Spark