Centos7安装emqx遇上的小坑

环境: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模块中配置

4,配置证书

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值