环境:centos7
1.安装的时候需要安装openssl
安装的时候始终不能启动成功,最后发现在群里问大家,才知道要依赖openssl
centos7 直接安装命令:
yum install -y openssl
然后直接启动即可大功告成!!!
2.开启mysql身份认证
- 配置关闭匿名认证,如果继续开启的话会出现,任何的身份任何的密码都可以通过的现象;
- 可以参考文档
- https://developer.emqx.io/docs/tutorial/zh/security/auth.html#mysqlpostgresql-%E8%AE%A4%E8%AF%81
/etc/emqx.conf
## Allow anonymous authentication by default if no auth plugins loaded.
## Notice: Disable the option in production deployment!
##
## Value: true | false
allow_anonymous = false
配置 etc/plugins/emqx_auth_mysql.conf
## Variables:
## - %u: username
## - %c: clientid
## - %cn: common name of client TLS cert
## - %dn: subject of client TLS cert
## 这里添加上加盐字段
auth.mysql.auth_query = select password,salt 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 = sha256
## 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
3,端口问题
最容易出现的端口冲突是8080端口,这个端口的话需要在plus模块中配置