-
Clone the repo github.com/emqtt/emq-relx
-
Edit
Makefile
:- Add
emq_plugin_elasticsearch
toDEPS
- Add a line
dep_emq_plugin_elasticsearch = git https://github.com/phanimahesh/emq_plugin_elasticsearch preview
- Add
-
Edit
relx.config
- Add
{emq_plugin_elasticsearch, load}
to releaseemqttd
's list of applications.
- Add
-
make
-
Copy the folder
_rel/emqttd
where needed. This is a self contained release. -
Review files under
etc
and verify the settings. In particular, checketc/plugins/emq_plugin_elasticsearch.conf
Update the url to ES, and fields to be logged to ES. Keep only the ones strictly needed. As of writing, apinf dashboard only needstopic
andtopics
in relevant events. -
Run
bin/emqttd start
. Checkbin/emqttd ping
(should respondpong
) andbin/emqttd_ctl plugins list
. -
If ES plugin is not active, run
bin/emqttd_ctl plugins load emq_plugin_elasticsearch
To verify if emqttd is working properly:
- Install a mqtt client. Example: mosquitto_pub and mosquitto_sub, bundled with mosquitto
- Subscribe to a topic and publish messages to it, verify they are received.
- Verify that ES instance configured received events corresponding to the messsage.