centos 7 部署 MQTT

Posted polar-lights

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了centos 7 部署 MQTT相关的知识,希望对你有一定的参考价值。

1.由于emqttd是用Erlang语言编写的,所以,在Linux下安装时,需要先安装Erlang。

安装依赖库

sudo yum -y install make gcc gcc-c++ kernel-devel m4 ncurses-devel openssl-devel

获取源码包

wget http://www.erlang.org/download/otp_src_R13B04.tar.gz

解压、编译、安装

tar xfvz otp_src_R13B04.tar.gz
cd otp_src_R13B04/

编译此时会出大问题,会提示没有java什么的,需要进行下面操作,

这里主要注意 APPLICATIONS DISABLED 部分的提示,其他两部分是不影响编译的。

jinterface : No Java compiler found 什么?没有java编译器?其实这里我们可以选择用gcc等其他方式来编译erlang。

如果你安装了gcc,这里就用不上java编译了,因此可以在configure时增加 –disable-javac 避免第二个错误; 

odbc : ODBC library – link check failed  表示你未安装unixODBC库

好吧,想办法安装下unixODBC:

安装 ODBC

下载unixODBC源码包(http://www.unixodbc.org/unixODBC-2.2.1.tar.gz)放到某处比如/usr/local下,然后运行下述命令:

tar zxvf unixODBC-2.2.1.tar.gz

  cd unixODBC-2.2.1

  ./configure --prefix=/usr/local/unixODBC-2.2.1 --includedir=/usr/include --libdir=/usr/lib -bindir=/usr/bin --sysconfdir=/etc --enable-gui=no

    make

    make install

 紧接着会出现 checking for X... 
configure: error: Can‘t find X includes

解决方法:

./configure --x-includes=/usr/include/X11

后又出现

checking for X... configure: error: Can‘t find X libraries. Please check your installation and add the correct paths!

./configure --x-includes=/usr/include/X11 --x-libraries=/usr/lib/X11

 

以上是关于centos 7 部署 MQTT的主要内容,如果未能解决你的问题,请参考以下文章

MQTT--linux安装部署(CentOS)

centos 7 安装mqtt

centos 7 安装mqtt 修改用户名和密码

Centos 7 安装MQTT(EMQ)服务端

centos 7安装gitlab及使用

centos6.5 mqtt安装