eclipse / mosquitto

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

Steps to install mosquitto broker over websockets on Amazon Linux #699

Open romuye123 opened 6 years ago

romuye123 commented 6 years ago

I am looking out for step by step guide to install mosquitto broker over websockets for Amazon Linux(AMI - ec2 instance).

  1. I tried following these instructions(using mosquitto package with yum): http://blog.yatis.io/install-secure-robust-mosquitto-mqtt-broker-aws-ubuntu/

And i get following error: Starting Mosquitto MQTT brokerError: Websockets support not available.

  1. I tried installing by downloading the source from Git and building (with following steps):
    
    git clone https://github.com/warmcat/libwebsockets.git
    cd libwebsockets
    mkdir build
    cd build
    cmake .. -DCMAKE_C_COMPILER=/usr/bin/gcc
    make
    sudo make install

wget http://mosquitto.org/files/source/mosquitto-1.4.10.tar.gz tar xvzf mosquitto-1.4.10.tar.gz cd mosquitto-1.4.10/ sudo nano config.mk Change WITH_WEBSOCKETS to yes make sudo make install sudo service mosquitto start



And i get following error:
`mosquitto: unrecognized service`

I have been following this issue on git since last few days:
[https://github.com/eclipse/mosquitto/issues/538](https://github.com/eclipse/mosquitto/issues/538)

**Unable to understand to how to install the mosquitto broker properly. Please help.**
AdamMiltonBarker commented 6 years ago

Well here is a doc I found yesterday, at the bottom there is info on Websockets on Amazon, maybe some helpful info there.

https://docs.aws.amazon.com/iot/latest/developerguide/protocols.html#mqtt-ws

Re the issue you are having with Websockets, try find if you have multiple versions of Mosquitto installed this was my issue in the issue you replied to, once I removed that it worked correctly. Here are some things I found just now that may help you:

https://medium.com/@achildrenmile/mqtt-broker-on-aws-ec2-hands-on-install-configure-test-out-f12dd2f5c9d0

http://blog.yatis.io/install-secure-robust-mosquitto-mqtt-broker-aws-ubuntu/

AdamMiltonBarker commented 6 years ago

I would make sure you remove everything you have installed so far in attempts to avoid conflicts, how I got into the situation in my issue was from upgrading the broker.