- Abstract: Foreword The blogger wrote an article "Building an MQTT Server under Windows" before. This time, I will try to build an MQTT server under Ubuntu. In fact, after downloading the source code package, everything that follows is almost the same as that article. Development environment virtual machine Ubuntu14.04.5LTS Apache-Apollo-1.7.1 preparation work Since the Apollo environment variable needs to have JAVA_HOME, this time you need to install JDK, you can refer to this article: "Ubuntu install JDK1.8.0 and configure environment variables". To download and decompress, the first step is to download Apache-Apollo, download page: http://www.
- foreword
The blogger wrote an article "Building an MQTT Server under Windows" before, and this time I will try to build an MQTT server under Ubuntu. In fact, after downloading the source code package, everything that follows is almost the same as that article.
development environment- Virtual machine Ubuntu 14.04.5 LTS
- Apache-Apollo-1.7.1
Since JAVA_HOME is required to build Apollo environment variables, JDK needs to be installed at this time, you can refer to this article: " Ubuntu install JDK1.8.0 and configure environment variables ".
Download and unzipThe first is to download Apache-Apollo, download page: http://www.apache.org/dyn/closer.cgi?path=activemq/activemq-apollo/1.7.1/apache-apollo-1.7.1-unix-distro. tar.gz
Or enter the following command
wget http://apache.fayea.com/activemq/activemq-apollo/1.7.1/apache-apollo-1.7.1-unix-distro.tar.gzUnzip the source package
tar -zxvf apache-apollo- 1.7.1 -unix-distro.tar.gzEnter the apache-apollo-1.7.1/bin directory
cd apache-apollo-1.7.1/bin/Type ./apollo to see help
***@***-virtual-machine:~/Downloads/apache-apollo-1.7.1/bin$ ./apollousage: apollo [--log <log_level>] <command> [<args>]The most commonly used apollo commands are: create creates a new broker instance disk-benchmark Benchmarks your disk's speed help Display help information version Displays the broker versionSee 'apollo help <command>' for more information on a specific command.Create a Broker example: /apollo create mybroker, the MQTT server is called Broker.
***@***-virtual-machine:~/Downloads/apache-apollo-1.7.1/bin$ ./apollo create mybrokerCreating apollo instance at: mybrokerGenerating ssl keystore...You can now start the broker by executing: "/home/***/Downloads/apache-apollo-1.7.1/bin/mybroker/bin/apollo-broker" runOr you can setup the broker as system service and run it in the background: sudo ln -s "/home/***/Downloads/apache-apollo-1.7.1/bin/mybroker/bin/apollo-broker-service" /etc/init.d/ /etc/init.d/apollo-broker-service startThere will be tips on how to start the server and create a service later.
Start Apollo:
***@***-virtual-machine:~/Downloads/apache-apollo-1.7.1/bin$ ./mybroker/bin/apollo-broker runAfter viewing the print information, you can know the port to which MQTT is connected and the port of the management page.
end.
MQTT server construction for Linux learning
Guess you like
Origin http://43.154.161.224:23101/article/api/json?id=324895722&siteId=291194637
Recommended
Ranking