使用rpm包安装,可以到官网(“http://www.emqtt.com/downloads”)下载

配置文件目录:/etc/emqttd/

修改配置文件,如下:

## Allow Anonymous Authentication.

##
## Notice: Disable the option for production deployment.
##
## Value: true | false

mqtt.allow_anonymous = false

## Maximum MQTT packet size allowed.

##
## Value: Bytes
##
## Default: 64K

mqtt.max_packet_size = 6400KB

使用mysql插件进行认证,需要关闭其他认证插件;需要注意用户口令是否需要加密以及加密方式“auth.mysql.password_hash = plain”

##--------------------------------------------------------------------
## MySQL Auth/ACL Plugin
##--------------------------------------------------------------------

## MySQL server address.
##
## Value: Port | IP:Port
##
## Examples: 3306, 127.0.0.1:3306, localhost:3306
auth.mysql.server = 127.0.0.1:3306

## MySQL pool size.
##
## Value: Number
auth.mysql.pool = 8

## MySQL username.
##
## Value: String
auth.mysql.username = root

## MySQL password.
##
## Value: String
## auth.mysql.password =

## MySQL database.
##
## Value: String
auth.mysql.database = emqttd

## Variables: %u = username, %c = clientid

## Authentication query.
##
## Note that column names should be 'password' and 'salt' (if used).
## In case column names differ in your DB - please use aliases,
## e.g. "my_column_name as password".
##
## Value: SQL
##
## Variables:
##  - %u: username
##  - %c: clientid
##
auth.mysql.auth_query = select password from mqtt_user where username = '%u' limit 1
## auth.mysql.auth_query = select password_hash as password from mqtt_user where username = '%u' limit 1

## Password hash.
##
## Value: plain | md5 | sha | sha256 | bcrypt
auth.mysql.password_hash = plain

## sha256 with salt prefix
## auth.mysql.password_hash = salt,sha256

## bcrypt with salt only prefix
## auth.mysql.password_hash = salt,bcrypt

## sha256 with salt suffix
## auth.mysql.password_hash = sha256,salt

## pbkdf2 with macfun iterations dklen
## macfun: md4, md5, ripemd160, sha, sha224, sha256, sha384, sha512
## auth.mysql.password_hash = pbkdf2,sha256,1000,20

## Superuser query.
##
## Value: SQL
##
## Variables:
##  - %u: username
##  - %c: clientid
auth.mysql.super_query = select is_superuser from mqtt_user where username = '%u' limit 1

## ACL query.
##
## Value: SQL
##
## Variables:
##  - %a: ipaddr
##  - %u: username
##  - %c: clientid
auth.mysql.acl_query = select allow, ipaddr, username, clientid, access, topic from mqtt_acl where ipaddr = '%a' or username = '%u' or username = '$all' or clientid = '%c'

centos emqttd 笔记相关推荐

  1. Linux(CentOS)学习笔记

    Linux (CentOS 7)笔记 1. Linux 目录的作用 目录名 目录作用 /bin 存放系统命令的目录, 普通用户和超级用户都可以执行. 不过放在/bin下的命令在单用户模式下也可以执行. ...

  2. Centos学习笔记

    CENTOS学习笔记: 一.shell 脚本基础-bash变量和逻辑运行 1. 终端:附着在终端上的接口程序 GUI:KDE ,GNone,Xfce CLI: /etc/shells bash zsh ...

  3. 【CentOS 7笔记13】,find用法和文件传输#171025

    2019独角兽企业重金招聘Python工程师标准>>> hellopasswd 一. find 1. 跟find相似的命令 which ls #从环境变量$PATH中查找wherei ...

  4. 【CentOS 7笔记4】,两种修改密码方式#

    2019独角兽企业重金招聘Python工程师标准>>> Shallow丿ove Linux #重启命令 reboot = init 6 = shutdown -r nowLinux ...

  5. 无显示器u盘安装centos_无光驱情况下,U盘启动安装CentOS (实测 笔记)

    条件: 1.主板支持U盘启动 2.4G的U盘 3.UltraISO软件 步骤: 1.下载CentOS-5.3-i386-bin-DVD.iso文件,文件大小3.69G.(如果是5.5,则4G U盘放不 ...

  6. CentOS 7笔记yum install epel-release

    启用EPEL软件源 sudo yum install epel-release sudo yum repolist sudo yum check-update What is EPEL EPEL (E ...

  7. 【CentOS 7笔记43】,防火墙和iptables filter表#

    2019独角兽企业重金招聘Python工程师标准>>> shallow丿ove firewalld和netfilter setenforce 0 #临时关闭selinux /etc/ ...

  8. CentOS学习笔记 - 9. docker maven编译基于gofabric8的java应用镜像

    2019独角兽企业重金招聘Python工程师标准>>> 续上一篇 1. 修改java工程的pom.xml , 加入docker编译插件 <plugin><group ...

  9. Centos学习笔记之grep命令

    定下学习Linux系统的目标也有段时间了,现在cto学院上一直跟Linux运维工程师职业学习路线图 来学习,基础比较薄弱加上现在的工作用不到所以进度比较慢,昨天跟着马哥的视频学到了grep命令,他的学 ...

最新文章

  1. 如何用C语言改变宏定义的大小,C语言中宏定义使用的小细节
  2. c#_将文件导入到工程目录下
  3. Linux 进程间通信
  4. 一个操作系统的实现第九章笔记
  5. 浏览器打开出现证书错误_SSL证书=安全?小心,别错漏了TA…
  6. mysql慢查询单位_MySQL慢查询
  7. 使用python pandas dataframe学习数据分析
  8. android 静态链接,android通过C代码实现动态和静态链接
  9. SAP License:选择ERP系统的诀窍
  10. 吴恩达团队新研究!用MRNet进行膝关节磁共振影像诊断 已媲美医生 | 论文
  11. WCF Data Services查询
  12. IntelliJ IDEA 的项目配置和Web部署,终于搞懂了!
  13. Flutter+原生开发与H5+原生开发的区别在哪里?
  14. 从头到尾彻底理解KMP(转载自July)
  15. k8s高可用环境部署7(Dashboard and metrics)
  16. 阅读 |《算法图解》读书打卡
  17. Swift表格Lxr
  18. 利用计算机技术全面规划供应,‍ ‍ 利用计算机及网络技术,全面规划供应链中的商流、物流、信息流、资金流等,并进行计划、组织、协调与控制。 ‍ ‍...
  19. 华为鸿蒙OS摄像头,华为放大招:首发屏下摄像头+鸿蒙OS
  20. python3 将科学计数法(用E表示的)转化为书写形式的科学计数法的数字

热门文章

  1. 从Powershell发送样式化HTML电子邮件(在Powershell中使用.NET DLL)
  2. “香港客”一个曾经在潮汕地区很响亮的称谓
  3. 如何从PowerPoint幻灯片中删除幻灯片编号
  4. Laradock 的安装与使用
  5. 学术界的“父母内卷”:近1/4终身教授拥有博士父母,是普通人的25倍
  6. 内存卡(TF或其它)的标准
  7. (第三天) 数字编码应用1--扑克
  8. 多线程间的通信和同步
  9. 儒竞科技创业板IPO过会:拟募资9.8亿 海尔是重要客户
  10. 奇异值(SVD)分解计算过程介绍