eclipse / mosquitto

Eclipse Mosquitto - An open source MQTT broker
https://mosquitto.org
Other
8.93k stars 2.37k forks source link

Running eclipse-mosquitto Broker and PAHO GO MQTT client #2024

Open sharan-git opened 3 years ago

sharan-git commented 3 years ago

Hi, I am new to MQTT/Mostquitto and trying to use this for our system's IPC between the containers. So on a server running Kubernetes with Docker containers, I am trying to create 3 containers

  1. eclipse mosquitto container with eclipse-mos docker image
  2. Two Centos containers with mqtt GO PAHO client downloaded
  3. Want to have both the Centos containers to talk to each other through the Broker container

Above are running within the same POD.. Have couple queries

  1. How can I verify broker is running ? systemctl doesnt work in the Apline OS, current am only relying on "netstat -l"
  2. How does a typical kubernetes YAML file look like for starting a mosquitto image ? Like specifying logs location., volume etc ?
  3. How can I generate logs for my broker at /mosquitto/log
  4. Are there any limitations on GO client to talk to a C mosquitto broker ?
  5. How can I enable logs on the GO client to see if packet is being sent to the broker ? I am using tcpdump for now
ralight commented 3 years ago

Here you go:

  1. You could use ps, netstat -l (as you suggest), or try to connect to the ports you have configured.
  2. I don't know, I don't use kubernetes.
  3. Add a line log_dest file /mosquitto/log/mosquitto.log to your mosquitto configuration file.
  4. There shouldn't be.
  5. You'd have to check the Go client documentation I'm afraid.