概述
1.下载mosquitto mqtt,下载连接Download | Eclipse Mosquitto,
2.安装在服务器上【注意安装路径不要有空格,比如直接 装在Cmosquitto下 】;
3.配置mosquitto的conf文件【配置了个允许匿名;配置端口1883】
修改配置文件:
#设置允许匿名登录
allow_anonymous true
#设置账户密码文件位置为C:mosquittopwfile.example
password_file /mosquitto/pwfile.example
#设置用户权限文件位置为C:mosquittoaclfile.example
#acl_file /mosquitto/aclfile.example
#修改默认端口
listener 22252
4.打开cmd,执行
mosquitto.exe -c mosquitto.conf
创建用户
创建用户名和密码、打开命令窗口 键入如下命令:
mosquitto_passwd -c /mosquitto/pwfile.example admin
提示连续两次输入密码、创建成功。命令解释: -c 创建一个用户、/mosquitto/pwfile.example 是将用户创建到 pwfile.example 文件中、admin 是用户名。
最后
以上就是糟糕星星为你收集整理的mosquitto mqtt服务搭建的全部内容,希望文章能够帮你解决mosquitto mqtt服务搭建所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复