Project

General

Profile

Actions

Inst mosquitto » History » Revision 6

« Previous | Revision 6/9 (diff) | Next »
Michael Gunsch, 01/04/2023 09:19 AM


Installation MQTT-Server (Broker) Mosquitto unter Debian

Pakete installieren

sudo apt install mosquitto mosquitto-clients

Konfiguration

/etc/mosquitto/mosquitto.conf

# Place your local configuration in /etc/mosquitto/conf.d/
#
# A full description of the configuration file is at
# /usr/share/doc/mosquitto/examples/mosquitto.conf.example

pid_file /var/run/mosquitto.pid

persistence true
persistence_location /var/lib/mosquitto/
persistent_client_expiration 30d

log_dest file /var/log/mosquitto/mosquitto.log

include_dir /etc/mosquitto/conf.d

Im Verzeichnis /etc/mosquitto/conf.d werden die Konfigurationsdateien hinterlegt. Die Angaben in spitzen Klammern, wie <host> sind anzupassen, die Spitzen Klammern sind wegzulassen. Beispiel für eine Verbindung (Bridge) zu einem anderen Mosquitto-Broker:

/etc/mosquitto/conf.d/andino.conf

listener 1883

connection <bridge-name>
address <host>:8883
allow_anonymous true
bridge_cafile /etc/ssl/certs/ISRG_Root_X1.pem
remote_username <username>
remote_password <password>
# topic # out 1 "" <prefix>/
# topic # in 1 <prefix>/ "" 
topic # both 1

Test

mosquitto_sub -h localhost -t '#' -v

Updated by Michael Gunsch almost 3 years ago · 6 revisions