一、auth_username授权
1.需要在安装目录下修改配置文件,把匿名登录关闭 /etc/emqx.conf
## Value: true | false
allow_anonymous = false
2.在插件->管理->新增用户的用户数据存储 ./bin/emqx_ctl。查询为:
./emqx_ctl users list
另外命令
$ ./bin/emqx_ctl users list
users add <Username> <Password>
users update <Username> <NewPassword>
users del <Username>
二、日志问题
可以查看到一些配置 cat emqx.conf | grep logs
log.to = both
log.level = warning
log.file = emqx.log
#log.chars_limit = 8192
1.log.to 默认值是 both,可选的值为:
- offff: 完全关闭日志功能
- fifile: 仅将日志输出到文件
- console: 仅将日志输出到标准输出(emqx 控制台)
- both: 同时将日志输出到文件和标准输出(emqx 控制台)
2.EMQ X 的日志分 8 个等级, 由低到高分别为:
debug < info < notice < warning < error < critical < alert < emergency
3.将 error 及 error 以上的日志单独输出到 error.log.N 文件中
4.将单个日志消息的最大字符长度设置为 8192