VerneMQ
  • Welcome
  • Getting Started
  • MQTT Introduction
  • Installing VerneMQ
    • Running VerneMQ using Docker
  • Configuring VerneMQ
    • Introduction
    • The VerneMQ conf file
    • Auth using files
    • Auth using a database
    • Enhanced Auth
    • MQTT Options
    • MQTT Listeners
    • HTTP Listeners
    • Non-standard MQTT options
    • Websockets
    • Logging
    • Consumer session balancing
    • Plugins
    • Shared subscriptions
    • Advanced Options
    • Storage
    • No Op Engine
    • Generic offline store
    • Redis based message passing
    • Redis based subscription store
    • MQTT Bridge
  • VerneMQ Clustering
    • Introduction
    • Inter-node Communication
    • Dealing with Netsplits
  • Live Administration
    • Introduction
    • Inspecting and managing sessions
    • Retained messages
    • Live reconfiguration
    • Managing Listeners
    • HTTP API
    • Tracing
  • Monitoring
    • Introduction
    • $SYSTree
    • Graphite
    • Netdata
    • Prometheus
    • Health Checker
    • Status Page
  • Plugin Development
    • Introduction
    • Session lifecycle
    • Subscribe Flow
    • Publish Flow
    • Enhanced Auth Flow
    • Erlang Boilerplate
    • Lua Scripting Support
    • Webhooks
    • Events sidecar Plugin
  • Misc
    • Loadtesting VerneMQ
    • Not a tuning guide
    • Change Open File Limits
  • Guides
    • A typical VerneMQ deployment
    • VerneMQ on Kubernetes
    • Loadtesting VerneMQ
    • Clustering during development
    • Not a tuning guide
    • Change Open File Limits
Powered by GitBook
On this page
  • Default Reg trie
  • Lua directory
  • Redis database
  • Redis sentinel endpoints
  1. Configuring VerneMQ

Redis based subscription store

Configure Routing store.

One of the problems that we tried to address was that of subscription state not syncing when one of the nodes restarted. The subscription state used to build up on other nodes and the restarted node was unable to catch up to the other nodes. We finally achieved this using an external store(redis) for maintaining a common subscription state for all the nodes.

You can use the redis based external subscription store using the following configs as mentioned below:

Default Reg trie

You have to configure the default_reg_view to vmq_reg_redis_trie to start using redis store as the subscription store.

default_reg_view = vmq_reg_redis_trie

Lua directory

By default, we use a set of lua scripts that are loaded into /etc/lua inside the _build/default/rel/vernemq when a release is created using make rel. This value can be overridden if you wish to use a different set of scripts.

redis_lua_dir = ./etc/lua

Redis database

Redis databases are numbered from 0 to 15 and, by default, you connect to database 0 when you connect to your Redis instance. However, you can change the database you’re using with the select command after you connect. This config specifies which redis_database to use. By default, you always connect to database 0.

redis_database = 0

Redis sentinel endpoints

The address of redis sentinel endpoints.

redis_sentinel_endpoints = [{"vernemq-redis-1", 26379}, {"vernemq-redis-2", 26379}, {"vernemq-redis-3", 26379}]
PreviousRedis based message passingNextMQTT Bridge

Last updated 2 years ago