YAZONG 我的开源

rabbitmq3.6.14基于erlang(otp20.1)环境的搭建

  , , ,
0 评论0 浏览

#记录erlang在Ubuntu18-64bit操作系统中安装编译的大坑,时间超长….

root@XX:~# uname -a
Linux XX 5.0.0-37-generic #40~18.04.1-Ubuntu SMP Thu Nov 14 12:06:39 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
/application/software/erlang/otp_src_20.1
#在上述otp目录下编译安装
./configure --prefix=/application/install/erlang20 --enable-hipe --enable-threads --enable-smp-support --enable-kernel-poll --without-javac

安装报错

configure: error: No curses library functions found
configure: error: /bin/bash '/application/software/erlang/otp_src_20.1/erts/configure' failed for erts
*********************************************************************
**********************  APPLICATIONS DISABLED  **********************
*********************************************************************
#第一部分
crypto         : No usable OpenSSL found
jinterface     : Java compiler disabled by user
odbc           : ODBC library - link check failed
ssh            : No usable OpenSSL found
ssl            : No usable OpenSSL found

*********************************************************************
*********************************************************************
**********************  APPLICATIONS INFORMATION  *******************
*********************************************************************
#第二部分
wx             : wxWidgets not found, wx will NOT be usable

*********************************************************************
*********************************************************************
**********************  DOCUMENTATION INFORMATION  ******************
*********************************************************************
#第三部分
documentation  : 
                 xsltproc is missing.
                 fop is missing.
                 xmllint is missing.
                 The documentation can not be built.

*********************************************************************

上述第一部分的错误,执行

apt-get install libncurses5-dev
apt-get install libssl-dev
apt-get install unixodbc unixodbc-dev

上述第二部分的错误,执行(下述install下载特别慢,2小时-2个半小时)

先根据https://developer.aliyun.com/mirror/ubuntu设置mirror
再次,依次执行下述内容
apt-key adv --fetch-keys http://repos.codelite.org/CodeLite.asc
apt-add-repository 'deb http://repos.codelite.org/wx3.0.4/ubuntu/ artful universe'
apt-get update
apt-get install libwxbase3.0-0-unofficial \
                 libwxbase3.0-dev \
                 libwxgtk3.0-0-unofficial \
                 libwxgtk3.0-dev \
                 wx3.0-headers \
                 wx-common \
                 libwxbase3.0-dbg \
                 libwxgtk3.0-dbg \
                 wx3.0-i18n \
                 wx3.0-examples \
                 wx3.0-doc
#如果网速快可以在下述网站下载此包,可省略上述的install内容
https://www.wxwidgets.org/downloads/
https://wiki.codelite.org/pmwiki.php/Main/WxWidgets30Binaries#toc2

上述第三部分的错误,执行

apt-get  install libxml2-utils  xsltproc fop

到这里重新编译安装erlang即可,如果没安装jdk先安装jdk

root@XX:/application/install/jdk/bin# ./java -version
java version "1.8.0_212"
Java(TM) SE Runtime Environment (build 1.8.0_212-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.212-b10, mixed mode)
#再次编译安装erlang
root@XX:/application/software/erlang/otp_src_20.1
./configure --prefix=/application/install/erlang20 --enable-hipe --enable-threads --enable-smp-support --enable-kernel-poll --without-javac
#这里编译完成后如果还报第一部分错误中的
jinterface     : Java compiler disabled by user
可忽略

至于rabbitmq直接解压包即可,加入erlang和rabbitmq的环境变量

ERLANG_HOME=/application/install/erlang
PATH=$ERLANG_HOME/bin:$PATH
export ERLANG_HOME
export PATH

RABBITMQ_HOME=/application/install/rabbitmq_server
PATH=$RABBITMQ_HOME/sbin:$PATH
export RABBITMQ_HOME
export PATH

测试erlang

root@XX:/application/software/erlang# erl 
Erlang/OTP 20 [erts-9.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false]

Eshell V9.1  (abort with ^G)
1> 

测试rabbitmq启动

root@XX:rabbitmq-server &
root@XX:/application/software/erlang# netstat -lntup|grep 5672
tcp        0      0 0.0.0.0:25672           0.0.0.0:*               LISTEN      3237/beam.smp       
tcp6       0      0 :::5672                 :::*                    LISTEN      3237/beam.smp 

测试rabbitmq停止

root@XX:/application/software/erlang# rabbitmqctl stop
root@XX:/application/software/erlang# netstat -lntup|grep 5672

标题:rabbitmq3.6.14基于erlang(otp20.1)环境的搭建
作者:yazong
地址:https://blog.llyweb.com/articles/2019/12/16/1578147941446.html