Mac 下 Mosquitto 安装和配置 (Mosquitto为开源的mqtt服务器)
官网:http://mosquitto.org/download/
官网的介绍简单明了
Mac 下一个命令“brew install mosquitto” 安装成功了,还学会了brew
找到 /usr/local/Cellar/mosquitto/1.3.5 /etc/mosquitto/mosquitto.conf ,打开这个文件,就可以对服务器进行相关配置
- # =================================================================
- # General configuration
- # =================================================================
- # 客户端心跳的间隔时间
- #retry_interval 20
- # 系统状态的刷新时间
- #sys_interval 10
- # 系统资源的回收时间,0表示尽快处理
- #store_clean_interval 10
- # 服务进程的PID
- #pid_file /var/run/mosquitto.pid
- # 服务进程的系统用户
- #user mosquitto
- # 客户端心跳消息的最大并发数
- #max_inflight_messages 10
- # 客户端心跳消息缓存队列
- #max_queued_messages 100
- # 用于设置客户端长连接的过期时间,默认永不过期
- #persistent_client_expiration
- # =================================================================
- # Default listener
- # =================================================================
- # 服务绑定的IP地址
- #bind_address
- # 服务绑定的端口号
- #port 1883
- # 允许的最大连接数,-1表示没有限制
- #max_connections -1
- # cafile:CA证书文件
- # capath:CA证书目录
- # certfile:PEM证书文件
- # keyfile:PEM密钥文件
- #cafile
- #capath
- #certfile
- #keyfile
- # 必须提供证书以保证数据安全性
- #require_certificate false
- # 若require_certificate值为true,use_identity_as_username也必须为true
- #use_identity_as_username false
- # 启用PSK(Pre-shared-key)支持
- #psk_hint
- # SSL/TSL加密算法,可以使用“openssl ciphers”命令获取
- # as the output of that command.
- #ciphers
- # =================================================================
- # Persistence
- # =================================================================
- # 消息自动保存的间隔时间
- #autosave_interval 1800
- # 消息自动保存功能的开关
- #autosave_on_changes false
- # 持久化功能的开关
- persistence true
- # 持久化DB文件
- #persistence_file mosquitto.db
- # 持久化DB文件目录
- #persistence_location /var/lib/mosquitto/
- # =================================================================
- # Logging
- # =================================================================
- # 4种日志模式:stdout、stderr、syslog、topic
- # none 则表示不记日志,此配置可以提升些许性能
- log_dest none
- # 选择日志的级别(可设置多项)
- #log_type error
- #log_type warning
- #log_type notice
- #log_type information
- # 是否记录客户端连接信息
- #connection_messages true
- # 是否记录日志时间
- #log_timestamp true
- # =================================================================
- # Security
- # =================================================================
- # 客户端ID的前缀限制,可用于保证安全性
- #clientid_prefixes
- # 允许匿名用户
- #allow_anonymous true
- # 用户/密码文件,默认格式:username:password
- #password_file
- # PSK格式密码文件,默认格式:identity:key
- #psk_file
- # pattern write sensor/%u/data
- # ACL权限配置,常用语法如下:
- # 用户限制:user <username>
- # 话题限制:topic [read|write] <topic>
- # 正则限制:pattern write sensor/%u/data
- #acl_file
- # =================================================================
- # Bridges
- # =================================================================
- # 允许服务之间使用“桥接”模式(可用于分布式部署)
- #connection <name>
- #address <host>[:<port>]
- #topic <topic> [[[out | in | both] qos-level] local-prefix remote-prefix]
- # 设置桥接的客户端ID
- #clientid
- # 桥接断开时,是否清除远程服务器中的消息
- #cleansession false
- # 是否发布桥接的状态信息
- #notifications true
- # 设置桥接模式下,消息将会发布到的话题地址
- # $SYS/broker/connection/<clientid>/state
- #notification_topic
- # 设置桥接的keepalive数值
- #keepalive_interval 60
- # 桥接模式,目前有三种:automatic、lazy、once
- #start_type automatic
- # 桥接模式automatic的超时时间
- #restart_timeout 30
- # 桥接模式lazy的超时时间
- #idle_timeout 60
- # 桥接客户端的用户名
- #username
- # 桥接客户端的密码
- #password
- # bridge_cafile:桥接客户端的CA证书文件
- # bridge_capath:桥接客户端的CA证书目录
- # bridge_certfile:桥接客户端的PEM证书文件
- # bridge_keyfile:桥接客户端的PEM密钥文件
- #bridge_cafile
- #bridge_capath
- #bridge_certfile
- #bridge_keyfile
最后,启动Mosquitto服务很简单,直接运行命令行“mosquitto -c /usr/local/Cellar/mosquitto/1.3.5/etc/mosquitto/mosquitto.conf -d”即可开启服务
命令为:./mosquitto -c /usr/local/Cellar/mosquitto/1.3.5/etc/mosquitto/mosquitto.conf -d
如果不想用命令启动的话,也可以直接进入/usr/local/Cellar/mosquitto/1.3.5/sbin 目录下,点击相应的脚本执行文件,就会自动启动,如果要想退出的话,需要到活动监视器里面强制退出,如果只是关闭終端窗口,程序并没有真正的退出。
Mac 下 Mosquitto 安装和配置 (Mosquitto为开源的mqtt服务器)的更多相关文章
- Mac下Maven安装与配置
Mac下Maven安装与配置 下载maven http://maven.apache.org/download.cgi main->download菜单下的Files 下载后解压在Documen ...
- Mac下Git安装及配置
Mac下: 1.下载git版本并安装 运行终端 查看git版本: bogon:~ yan$ git --version git version 2.16.3 配置gitconfig文件 vim ~/. ...
- Mac下charles安装及配置
一.下载地址 https://www.charlesproxy.com/download/ 激活码 Registered Name: https://zhile.io License Key: 488 ...
- mac下mysql安装及配置启动
---恢复内容开始--- 原始链接:https://segmentfault.com/q/1010000000475470 按照如下方法成功安装并启动: mysql.server start//启动服 ...
- Mac下brew安装与配置mysql
一.打开mac控制台 $ brew install mysql 二.启动mysql服务 $ mysql.server start 三.初始化mysql配置 1 rainMacBook-Pro:~ co ...
- Mac下nginx安装和配置
nginx安装 brew search nginx brew install nginx 安装完以后,可以在终端输出的信息里看到一些配置路径: /usr/local/etc/nginx/nginx.c ...
- Mac Hadoop的安装与配置
这里介绍Hadoop在mac下的安装与配置. 安装及配置Hadoop 首先安装Hadoop $ brew install Hadoop 配置ssh免密码登录 用dsa密钥认证来生成一对公钥和私钥: $ ...
- Mac下Tomcat安装与Intellij IDEA配置Tomcat
Mac下Tomcat安装与Intellij IDEA配置Tomcat 一 安装 1 下载地址:https://tomcat.apache.org/download-90.cgi 2 将压缩包解压后移至 ...
- Mac 下 docker安装
http://www.th7.cn/system/mac/201405/56653.shtml Mac 下 docker安装 以及 处理错误Cannot connect to the Docker d ...
随机推荐
- 018-Spring Boot Starter开发
自建spring-boot-starter artifactId命名 Spring 官方 Starter通常命名为spring-boot-starter-{name}如 spring-boot-sta ...
- Latex技巧:在图表序号中加入章节号(实现诸如“图1.1.2”这样的图表序号)
平时看书经常看到"图1.2"这样的编号,含义是第1章的第2幅插图:或者"图1.1.2",含义是第1章第1节的第2幅插图.而在LaTeX中如果直接插图的话只会显示 ...
- 爬虫、网页测试 及 java servlet 测试框架等介绍
scrapy 抓取网页并存入 mongodb的完整示例: https://github.com/rmax/scrapy-redis https://github.com/geekan/scrapy-e ...
- 前端基础之jquery_mouse相关操作与不同
jquery中mouse相关操作与不同 mousedown() //当鼠标指针移动到元素上方,并按下鼠标左键时,会发生 mousedown 事件 mouseup() //当鼠标指针移动到元素上方,并松 ...
- 学习小程序第三天 WXML语言特性
WXML语言特性 1.数据绑定 Musstache 语法 获取json中指定键值:变量名加双括号的绑定语法 如下: (1)绑定文本 注意所有组件和属性 都要小写 (2)绑定属性 ( ...
- Array.asList:数组转list
String s[]={"aa","bb","cc"}; List<String> sList=Arrays.asList(s) ...
- 试坑不完美的 clip-path (我说的 CSS 的那个)
需求跟我说,咱们要创新,想做一个蜂巢状的列表,年少无知的我竟然一口答应了,全然因为刚接触了 clip-path: But,然而,不幸的是,这只是坎坷路途的开始.... clip-path 的教程很多了 ...
- JSP笔记04——架构(转)
原始内容:https://www.tutorialspoint.com/struts_2/basic_mvc_architecture.htm Web服务器需要一个JSP引擎,即一个处理JSP页面的容 ...
- axios拦截器/http
Interceptors //处理请求或响应之前拦截请求或响应. //添加一个请求拦截器 axios.interceptors.request.use(function (config) { //在请 ...
- LVS 负载均衡原理详解
LVS简介 LVS是一个开源软件,由章文嵩博士于1998年5月创立,可以实现Linux平台下的简单负载均衡.LVS是Linux Virtual Server的简写,是一个虚拟的服务器集群系统. LVS ...