Liunx安装eclipse-mosquitto之docker容器
1、docker拉取
docker pull eclipse-mosquitto
2、查看镜像
docker images
3、建立配置目录
mkdir -p /mnt/mosquitto/config
mkdir -p /mnt/mosquitto/data
mkdir -p /mnt/mosquitto/log
4、分配权限
chmod -R 755 /mnt/mosquitto
chmod -R 777 /mnt/mosquitto/log
5、创建配置文件
touch mosquitto.conf
配置内容:
# 关闭匿名模式
allow_anonymous false
# 指定密码文件(运行docker前,docker里没有这个文件,需要进入容器创建)
# password_file /mosquitto/config/pwfile.conf
#持久化本地存储
persistence true
persistence_location /mosquitto/data
#日志的保存文件
log_dest file /mosquitto/log/mosquitto.log
# mqtt 这个端口是mqtt默认用的,尽量别改
listener 1883
protocol mqtt
# websocket 端口根据自己需要修改
listener 1884
protocol websockets
6、运行容器
docker run -it \
--name=mosquitto --privileged \
-p 1883:1883 -p 1884:1884 \
-v /mnt/mosquitto/config/mosquitto.conf:/mosquitto/config/mosquitto.conf \
-v /mnt/mosquitto/data:/mosquitto/data \
-v /mnt/mosquitto/log:/mosquitto/log \
-d eclipse-mosquitto
7、添加账号
# 进入docker 容器
docker exec -it mosquitto sh
# 进入配置
cd /mosquitto/config
# 创建密码配置文件
touch pwfile.conf
# 添加账号密码
mosquitto_passwd -b /mosquitto/config/pwfile.conf test test
# 创建完成后退出容器,先ctrl+p 然后 ctrl+q
# 重启docker
docker restart 容器id
Liunx安装eclipse-mosquitto之docker容器的更多相关文章
- 【docker部署】基于linux的centos操作系统部署安装docker容器
一.docker介绍 容器是轻量级的,包含应用运行所需所有东西(代码.库.运行时环境.系统设置,以及依赖关系)的独立的包.每个容器都部署于它自己的 CPU.内存.块 I/O,以及网络资源上,所有这些都 ...
- Centos7环境下Docker容器的安装与卸载
Docker是一个开源的引擎,可以轻松的为任何应用创建一个轻量级的.可移植的.自给自足的容器.开发者在笔记本上编译测试通过的容器可以批量地在生产环境中部署,包括VMs(虚拟机).bare metal. ...
- Linux下Docker容器安装与使用
注:作者使用的环境是CentOS 7,64位,使用yum源安装. 一.Docker容器的安装 1.查看操作系统及内核版本,CentOS 7安装docker要求系统为64位.系统内核版本为 3.10及以 ...
- Docker学习(13) Docker容器的网络连接
Docker容器的网络连接 Docker容器的网络基础 先安装网桥管理工具 Docker容器的互联 默认 Docker容器与外部网络的连接
- docker——容器安装tomcat
写在前面: 继续docker的学习,学习了docker的基本常用命令之后,我在docker上安装jdk,tomcat两个基本的java web工具,这里对操作流程记录一下. 软件准备: 1.jdk-7 ...
- 在docker容器中安装和使用,linux版的powershell
powershell 传教士 原创文章.始于 2016-09-18 ,2016-10-27修改powershell docker官网.允许转载,但必须保留名字和出处,否则追究法律责任 1 在任意版本的 ...
- docker - 容器里安装ssh
docker安装ssh 通过命令行安装 pull ubuntu镜像 docker pull ubuntu:latest 启动并进入bash docker run -it -d ubuntu:laste ...
- centos安装docker容器
centos安装docker容器 系统环境需求 docker要运行在centos7系统中,系统为64位机器上,内核最小版本在3.10以上 如果系统为centos6,后面有附带的安装方法 uname - ...
- 安装配置 flannel - 每天5分钟玩转 Docker 容器技术(59)
上一节我们部署了 etcd,本节安装和配置 flannel. build flannel flannel 没有现成的执行文件可用,必须自己 build,最可靠的方法是在 Docker 容器中 buil ...
- 如何安装和配置 Rex-Ray?- 每天5分钟玩转 Docker 容器技术(74)
Rex-Ray 是一个优秀的 Docker volume driver,本节将演示其安装和配置方法. Rex-Ray 以 standalone 进程的方式运行在 Docker 主机上,安装方法很简单, ...
随机推荐
- vue webpack打包之后 重新修改配置文件接口API路径,无需修改代码后再打包
用vue-cli构建的项目通常是采用前后端分离的开发模式,也就是前端与后台完全分离,此时就需要将后台接口地址打包进项目中,但是有的时候需要修改接口地址,为了避免为了修改接口地址而进行修改代码后再重新打 ...
- GeoServer 发布PostGIS数据库中的栅格数据
1.导入栅格数据 进入PostgreSQL\bin目录,利用raster2pgsql工具导入栅格数据,具体命令如下所示: <!-- 分块,切片存储到PostGIS数据库中 --> rast ...
- shell - scriptreplay timing.log output.session
script -t 2> timing.log -a output.session cmd cmd cmd exit scriptreplay timing.log output.session ...
- jsonpath表达式
JsonPath是一种简单的方法来提取给定JSON文档的部分内容,其中正则表达式的包含或不包含配制有时候非常有用! json操作实例 { "store": { "book ...
- Unity Prefab(预制体)一次性循环10个会得到同样的
IEnumerator Test1() { for(int i = 0;i < 5;i++) { GameObject gb = (GameObject)Resources.Load(" ...
- openwrt 配置虚拟wan口
一.刷固件:1.刷入 刷不死,百度上找教程:2.下载固件:https://downloads.openwrt.org/releases/17.01.6/targets/ramips/mt7620/ 按 ...
- startActivity 新开一个Activity
private void startActivity(Intent intent) { Context ctx = ApplicationController.getTopActivity(); if ...
- Dynamics 365 如何代表其他用户发送邮件
举个例子,用户A和用户B,用户B在新建电子邮件时,发件人以用户A的身份去发送邮件,这个时候需要做如下配置才可以. 首先登录用户A,在高级设置->个人设置中,配置允许其他人代表自己发送电子邮件. ...
- java hibernate +mysql demo
origin article:http://www.javatpoint.com/example-to-create-hibernate-application-in-eclipse-ide requ ...
- 洛谷P5356 [Ynoi2017] 由乃打扑克
题目 https://www.luogu.com.cn/problem/P5356 思路 由乃题,那么考虑分块(大雾,但确实分块是正解). 题面很清晰,就是求动态的区间第k小,支持区间加法操作. 根据 ...