Debian 9 Stretch, High Sierra 10.13.5 için Mosquitto Message Broker & Client Kurulum ve Detaylı Yapılandırma Ayarları

2726
    Mosquitto

Message Queuing Telemetry Transport yani MQTT mesajın bir istemciden diğer istemciye gönderilmesi için kullanılan bir haberleşme protokolüdür. Machine 2 Machine ve IOT Mimarisinde sıklıkla kullanılır. Bu haberleşme trafiğini kontrol eden yöneticiye BROKER, mesaj yayınlama işlemine PUBLISH ve bu mesaj yayınına abone olma işlemine SUBSCRIBE denilir. Kendi Websocket ve yetkilendirme desteği de sunmaktadır.

Mosquitto ve Mosquitto Client Kurulum
Debian strech dağıtımları için ihtiyaç duyulan repo
$ wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key
$ sudo apt-key add mosquitto-repo.gpg.key
$ cd /etc/apt/sources.list.d/
$ sudo wget http://repo.mosquitto.org/debian/mosquitto-stretch.list
Ubuntu için üstteki adımlara gerek duyulmaz
$ sudo apt-get update
$ sudo apt-get install mosquitto 
$ sudo apt-get install mosquitto-clients
High Sierra 10.13.5 - Mosquitto Kurulumu (usr/local yazma problemini düzeltmek)
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.bash_profile
$ sudo mkdir /usr/local/Cellar
$ sudo mkdir /usr/local/opt
$ sudo mkdir /usr/local/include
$ sudo mkdir /usr/local/Frameworks
$ sudo chown -R $(whoami) $(brew --prefix)/*
$ brew install git
$ brew install mosquitto
$ brew link mosquitto
$ brew services start mosquitto

Sunucuyu başlattık şimdi dinleyelim
$ mosquitto_sub -t topicTitle

İkinci bir konsol penceresi açalım
$ mosquitto_pub -t topicTitle -m "hello world"

OSX için conf dosyası yolu
$ nano /usr/local/etc/mosquitto/mosquitto.conf