What is emqttd?

emqttd is a massively scalable and clusterable MQTT V3.1/V3.1.1 broker written in Erlang/OTP.
emqttd supports both MQTT V3.1/V3.1.1 protocol specification with extended features.

Goals

emqttd is aimed to provide a solid, enterprise grade, extensible open-source MQTT broker for IoT(M2M) applications that need to support ten millions of concurrent MQTT clients.

  • Easy to install

  • Massively scalable

  • Easy to extend

  • Solid stable

You can find more info at emqtt.io

icon-broker

Let’s Start
To build emqttd I’m using an old Mac Mini (Late 2009) running Mac OS X Yosemite (10.10.3).

Step 0 – Prepare your Mac
First of all you have to install the Apple Developer Tools. If you are reading this post, I think they are already installed onto your Mac.
Install the git command line client

Step 1 – Install erlang.
You have to install erlang, make sure to install the version from rudix.org (http://rudix.org/packages/erlang.html)

If you have installed the version from “Erlang Solutions” (24th June 2015) you could face to the following compilation error:
{‘EXIT’,{{badmatch,{error,”goldrush: Application version clash. Multiple directories contain version \”0.1.6\”.”}}

Step 2 – Getting the source code
Download the source code for emqttd
$ mkdir emqtt
$ cd emqtt
$ git clone https://github.com/emqtt/emqttd.git

Step 3 – Build
$ cd emqttd
$ make
$ make dist

Step 4 – Finding emqttd
Where are your files? The “make dist” command creates a complete set of directory inside the rel directory. So cd into rel/emqttd
$ cd rel/emqttd
$ ls
bin data erts-6.3 etc lib log plugins releases
Step 5 – Run emqttd
$ ./bin/emqttd console
starting emqttd on node 'emqttd@127.0.0.1'
emqttd trace is starting...[done]
emqttd pooler is starting...[done]
emqttd client manager is starting...[done]
emqttd session manager is starting...[done]
emqttd session supervisor is starting...[done]
emqttd pubsub is starting...[done]
emqttd stats is starting...[done]
emqttd metrics is starting...[done]
emqttd broker is starting...[done]
emqttd mode supervisor is starting...[done]
emqttd bridge supervisor is starting...[done]
emqttd access control is starting...[done]
emqttd system monitor is starting...[done]
07:59:30.235 [info] load module presence successfully
07:59:30.235 [info] load module autosub successfully
07:59:30.276 [info] mqtt listen on 0.0.0.0:1883 with 16 acceptors.
07:59:30.278 [info] mqtts listen on 0.0.0.0:8883 with 4 acceptors.
07:59:30.285 [info] http listen on 0.0.0.0:8083 with 4 acceptors.
Erlang MQTT Broker 0.8.5-beta-4-gafa0c18 is running now
Eshell V6.3 (abort with ^G)

Now you have only to try your brand new broker.

Gg1