You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> The move overwrites the default. At this point, the moved file will probably be owned by user "pi" but that does not matter.
184
-
184
+
185
185
2. Mosquitto will always enforce correct ownership (1883:1883) on any restart but it will not overwrite permissions. If in doubt, use mode 644 as your default for permissions:
186
186
187
187
```bash
@@ -193,7 +193,7 @@ Using `mosquitto.conf` as the example, assume you wish to use your existing file
193
193
```bash
194
194
$ docker-compose restart mosquitto
195
195
```
196
-
196
+
197
197
4. Check your work:
198
198
199
199
```bash
@@ -279,7 +279,7 @@ A common problem with the previous version of Mosquitto for IOTstack occurred wh
279
279
The Mosquitto container performs self-repair each time the container is brought up or restarts. If `pwfile` is missing, an empty file is created as a placeholder. This prevents the restart loop. What happens next depends on `allow_anonymous`:
280
280
281
281
* If `true` then:
282
-
282
+
283
283
- Any MQTT request *without* credentials will be permitted;
284
284
- Any MQTT request *with* credentials will be rejected (because `pwfile` is empty so there is nothing to match on).
285
285
@@ -292,17 +292,17 @@ To create a username and password, use the following as a template.
Replace «username» and «password» with appropriate values, then execute the command. For example, to create the username "hello" with password "world":
297
-
297
+
298
298
```
299
299
$ docker exec mosquitto mosquitto_passwd -b /mosquitto/pwfile/pwfile hello world
300
300
```
301
301
302
302
Note:
303
303
304
304
* See also [customising health-check](#healthCheckCustom). If you are creating usernames and passwords, you may also want to create credentials for the health-check agent.
$ mosquitto_pub -h 127.0.0.1 -p 1883 -t "/password/test" -m "up up and away" -u hello -P world
468
468
2021-02-16T14:40:51+1100 /password/test up up and away
@@ -471,7 +471,7 @@ $ mosquitto_pub -h 127.0.0.1 -p 1883 -t "/password/test" -m "up up and away" -u
471
471
Note:
472
472
473
473
* the second line above is coming from the `mosquitto_sub` running in the background.
474
-
474
+
475
475
When you have finished testing you can kill the background process (press return twice after you enter the `kill` command):
476
476
477
477
```
@@ -493,7 +493,7 @@ The agent is invoked 30 seconds after the container starts, and every 30 seconds
493
493
```
494
494
iotstack/mosquitto/healthcheck
495
495
```
496
-
496
+
497
497
* Subscribes to the same broker for the same topic for a single message event.
498
498
* Compares the payload sent with the payload received. If the payloads (ie time-stamps) match, the agent concludes that the Mosquitto broker (the process running inside the same container) is functioning properly for round-trip messaging.
499
499
@@ -529,7 +529,7 @@ Possible reply patterns are:
529
529
NAMES STATUS
530
530
mosquitto Up About a minute (unhealthy)
531
531
```
532
-
532
+
533
533
You can also subscribe to the same topic that the health-check agent is using to view the retained messages as they are published:
534
534
535
535
```bash
@@ -553,16 +553,16 @@ You can customise the operation of the health-check agent by editing the `mosqui
553
553
environment:
554
554
- HEALTHCHECK_PORT=12345
555
555
```
556
-
556
+
557
557
2. If the default topic string used by the health-check agent causes a name-space collision, you can override it. For example, you could use a Universally-Unique Identifier (UUID):
* You will also need to use the same topic string in the `mosquitto_sub` command shown at [monitoring health-check](#healthCheckMonitor).
567
567
568
568
3. If you have enabled authentication for your Mosquitto broker service, you will need to provide appropriate credentials for your health-check agent:
@@ -581,15 +581,15 @@ You can customise the operation of the health-check agent by editing the `mosqui
581
581
```
582
582
583
583
Notes:
584
-
584
+
585
585
* The directives to disable health-checking are independent of the environment variables. If you want to disable health-checking temporarily, there is no need to remove any `HEALTHCHECK_` environment variables that may already be in place.
586
-
* Conversely, the mere presence of a `healthcheck:` clause in the `mosquitto` service definition overrides the supplied agent. In other words, the following can't be used to re-enable the supplied agent:
586
+
* Conversely, the mere presence of a `healthcheck:` clause in the `mosquitto` service definition overrides the supplied agent. In other words, the following can't be used to re-enable the supplied agent:
@@ -665,7 +665,7 @@ If you need to pin Mosquitto to a particular version:
665
665
```
666
666
667
667
The new *local image* is built, then the new container is instantiated based on that image. The `prune` deletes the old *local image*.
668
-
668
+
669
669
Note:
670
670
671
671
* As well as preventing Docker from updating the *base image*, pinning will also block incoming updates to the *Dockerfile* from a `git pull`. Nothing will change until you decide to remove the pin.
@@ -701,7 +701,7 @@ If you have a use-case that needs port 9001, you can re-enable support by:
701
701
listener 1883
702
702
listener 9001
703
703
```
704
-
704
+
705
705
You need **both** lines. If you omit 1883 then Mosquitto will stop listening to port 1883 and will only listen to port 9001.
0 commit comments