Search
๐Ÿฏ

EMQ X Edge

์ƒ์„ฑ์ผ
2021/02/18 07:09
Image
logo_512.png
reference

Introduction

EMQ X Edge is an open source, lightweight MQTT broker at any resource constraint edge devices.
EMQ X Edge is fully open source and licensed under the Apache Version 2.0. EMQ X implements both MQTT V3.1/V3.1.1. and V5.0 protocol specifications, and supports MQTT, TCP, WebSocket and different industry protocols such ModBus.
EMQ X Edge can be running at different kinds of resource constrained edge devices, such as Raspberry Pi, gateway and industrial servers. And as the bridge betweewn the local terminals and the remote broker, EMQ X Edge provides local data processing and cloud synchronization which will automatically synchronize data with cloud service based on network status.
Search
Homepage:
http://emqx.ioย (opens new window)
emqx@googlegroups.com
contact < contact@emqx.io >

Get Started

Overview

EMQ X Edge is written in Erlang/OTP, and Erlang/OTP is a concurrent, fault-tolerant, soft-realtime and distributed programming platform. MQTT is an extremely lightweight publish/subscribe messaging protocol powering IoT, M2M and Mobile applications.
Highlights of the EMQ X Edge Broker:
โ€ข
It supports MQTT, TCP, WebSocket and different industry protocols such ModBus.
โ€ข
It can be runninbg at different kinds of resource constrained edge devices, such as Raspberry Pi, gateway and industrial servers.
โ€ข
It provides local data processing and cloud synchronization which will automatically synchronize data with cloud service based on network status.
โ€ข
Integrated with EMQ X Storm which provides central monitoring and management services.

Features

โ€ข
Lightweight - 20MB runtime memory with minimal resource consumption, which can run on ARM/x86 CPU, from Raspberry Pi to industrial X86 servers.
โ€ข
Near real-time response - processing the data generated locally, so it can respond quickly to local events.
โ€ข
Operate online or offline - it operate locally and can cache data when network is not available; when they're back online it can synchronize data to the cloud and use the cloud for management, analysis and date persistence.
โ€ข
Easy management & monitoring - central edge broker management, data synchronization, visualized monitoring tools based on web UI.
โ€ข
Extensibility - Open APIs available to third party plugins to support more protocols, new functions and features.

Quick Start

Download and Install

The EMQ X Edge is cross-platform, which could be depolyed on Raspberry Pi, Linux and FreeBSD.
Download binary package from:ย http://emqx.io/downloads
Installing on Linux, for example:

Installing from Source

The EXQ X Edge broker requires Erlang/OTP R21+ to build since 3.0 release.

Plugins

The EMQ X Edge broker could be extended by Plugins. A plugin is an Erlang application that adds extra feature to the EMQ X Edge broker:
A plugin could be enabled by 'bin/emqx_ctl plugins load' command.
For example, enable 'emqx_auth_mysql' plugin:

MQTT Client Libraries

Search

Installation

The EMQ X Edge broker V3.1 supports CentOS, Alpine, Raspbian, Debian, Ubuntu and Docker.

Download Packages

Download binary package from: https://www.emqx.io/downloads/edge
The following OS types are supported:
โ€ข
CentOS6.8
โ€ข
CentOS7
โ€ข
Debian7
โ€ข
Debian8
โ€ข
Debian9
โ€ข
Alpine3.8
โ€ข
Raspbian8
โ€ข
Raspbian9
โ€ข
Ubuntu12.04
โ€ข
Ubuntu14.04
โ€ข
Ubuntu16.04
โ€ข
Ubuntu18.04
โ€ข
Docker
The package name consists of platform, version and release time.
For example: emqx-edge-centos7-v3.1-beta1.zip

Install via zip

Select and download zip package from https://www.emqx.io/downloads/edge (opens new window) , and then unzip:
Start the Edge broker in console mode:
If the broker is started successfully, console will print:
CTRL+C to close the console and stop the broker
Start the broker in daemon mode:
Check the running status of the broker:
Or check the status by URL:
Stop the broker:

Install via RPM

์ƒ๋žต.

Install via DEB

์ƒ๋žต.

Install via Docker Image

Select Docker group from https://www.emqx.io/downloads/edge, and download EMQ X Edge 3.1 Beta1 Docker Image.
unzip emqx-edge-docker image:
Load Docker Image:
Run the Container:
Stop the broker:
Start the broker:

Installing From Source

์ƒ๋žต.

TCP Ports Used

The TCP ports used can be configured in etc/eqmx.config:

Quick Setup

Two main configuration files of the EQM X Edge broker:
Two important parameters in etc/emqx.conf:
node.process_limit > maximum number of allowed concurrent clients * 2 node.max_ports > maximum number of allowed concurrent clients
The maximum number of allowed MQTT clients:

/etc/init.d/emqx

chkconfig:
์šฐ๋ถ„ํˆฌ์—์„œ๋Š” chkconfig ๋ช…๋ น์–ด๋ฅผ ์ง€์›ํ•˜์ง€ ์•Š์Œ "https://stackoverflow.com/questions/20680050/how-do-i-install-chkconfig-on-ubuntu" ๋ฅผ ์ฐธ๊ณ ํ•˜์—ฌ "update-rc.d <service> defaults" ์‚ฌ์šฉ
boot test:
erlexec: HOME must be set uncomment '# export HOME=/root' if "HOME must be set" error.

Configuration

Plugins

My Test

Install Erlang

Install emqtt bench and Usage

Test Command

./emqtt_bench pub -h ec2-13-125-242-175.ap-northeast-2.compute.amazonaws.com -c 300 -I 1000 -t battery/%i -s 80 -q 2
Bash
๋ณต์‚ฌ
โ€ข
Connection count(-c): 300
โ€ข
Interval of publishing message(-I): 1000ms
โ€ข
QoS Level(-q): 2
โ€ข
Topic(-t): "battery/%i"
โ€ข
Payload size(-s): 80

๋ฐ•์‚ฌ๋‹˜ ํ”ผ๋“œ๋ฐฑ

โ€ข
SSL ๊ณ ๋ ค
โ€ข
๋‹จ์ผ ๋จธ์‹ ์—์„œ ์ƒ์„ฑํ•˜๋Š” 300๊ฐœ ์ปค๋„ฅ์…˜๊ณผ ์—ฌ๋Ÿฌ ๋จธ์‹ (300๊ฐœ)์—์„œ ์ƒ์„ฑํ•˜๋Š” 300๊ฐœ ์ปค๋„ฅ์…˜์€ ๋‹ค๋ฅผ ์ˆ˜ ์žˆ๋‹ค๊ณ  ํ•˜์‹ฌ
โ€ข
ํด๋ผ์šฐ๋“œ ๋น„์šฉ๋„ ๊ณ ๋ ค ํ•„์š” โ†’ ์ด๊ฑด ๋‚ด ์ƒ๊ฐ