版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/TStana/article/details/73648935
centos 7 安装erlang
PS:注意rabbitmq依赖版本,详见官网
找到安装指南:Installation Guides
http://www.rabbitmq.com/download.html
找到suppert-version
Minimum Required Version
The minimum version of Erlang required to run the RabbitMQ server 3.6.x is R16B03. The most recent Erlang/OTP release series supported by 3.6.x is 19.3.x.
As a rule of thumb, stable (GA) version of Erlang/OTP 19.3.x are recommended for running RabbitMQ.
下载erlang 发布稳定版本
http://www.erlang.org/downloads/19.3
wget http://erlang.org/download/otp_src_19.3.tar.gz
解压
tar zxf otp_src_19.3.tar.gz
配置安装路径编译代码:
进入解压目录
设置 安装目录 和 编译免javac
./configure --prefix=/usr/lib/erlang --without-javac
安装执行 make & make install
ps:安装依赖环境 后面,少啥安装啥
yum -y install make gcc gcc-c++ kernel-devel m4 ncurses-devel openssl-devel unixODBC-devel
make
make install
配置环境变量
# vi /etc/profile
#末尾添加
#set erlang environment
export PATH=$PATH:/emdc/app/erlang/otp_src_19.3/bin
#set rabbitmq environment
export PATH=$PATH:/emdc/app/mq/rabbitmq_server-3.6.10/sbin
查看erl版本
#cd /usr/lib/erlang/bin
#erl -version
# ./erl -version
Erlang (SMP,ASYNC_THREADS,HIPE) (BEAM) emulator version 8.3
安装大功告成
安装过程问题解决:
在安装过程中可能会遇到如下情况:
*********************************************************************
********************** APPLICATIONS DISABLED **********************
*********************************************************************
crypto : No usable OpenSSL found
odbc : ODBC library - link check failed
orber : No C++ compiler found
ssh : No usable OpenSSL found
ssl : No usable OpenSSL found
*********************************************************************
*********************************************************************
********************** APPLICATIONS INFORMATION *******************
*********************************************************************
wx : wxWidgets not found, wx will NOT be usable
*********************************************************************
*********************************************************************
********************** DOCUMENTATION INFORMATION ******************
*********************************************************************
documentation :
fop is missing.
Using fakefop to generate placeholder PDF files.
解决上述问题:
1. ODBC library - link check failed 需要安装 unixODBC
> yum list|grep unixODBC
> yum install unixODBC-devel
2. No usable OpenSSL found :需要安装 openssl
> yum list|grep ssl
> yum install openssl-devel
3. No C++ compiler found:需要安装gc c++ 编译器
> yum list|grep gcc
> yum install gcc-c++
4. wxWidgets not found, wx will NOT be usable : wxWidgets 这个库需要单独下
(http://www.wxwidgets.org/downloads/),yum 下没有:
> 下载wxWidgets 源码包 后解压缩并编译安装
> bzip2 -d wxWidgets-3.0.0.tar.bz2 tar -jxvf
> tar -xvf wxWidgets-3.0.0.tar
> 安装依赖库: yum list *gtk+* yum install gtk+extra
>进入解压缩目录, ./configure --with-opengl --enable-debug --enable-unicode
> 出现问题 OpenGL libraries not available,则需要安装OpenGL库
>> yum list mesa* yum install mesa *
>> yum list|grep freeglut yum install freeglut*
>解决 OpenGL 问题后直接运行 make & make install
5. fop is missing. 可忽略
版本不兼容问题:
Erlang
服务器上新安装了R1603 版本后,启动crypto模块 时出现下面的错误:
The on_load function for module crypto returned {error,
{load_failed,
“Failed to load NIF library: ‘/usr/local/lib/erlang/lib/crypto-3.2/priv/lib/crypto.so: undefined symbol: EC_GROUP_new_curve_GF2m’”}}
原因:
因R16+版本和最新的openssl不兼容所至,服务器上的openssl版本是OpenSSL 1.0.1e-fips 11 Feb 2013。网上说可通过下载openssl源码,修改编译参数即可解决。但修改openssl编译后,问题并没解决。
最后,在erlagn.org中找到的解决方法(不用下载openssl源码)。
修改crypto源码包中的lib/crypto/c_src/crypto.c(erlang安装源文件目录)文件,把原有定义
#if OPENSSL_VERSION_NUMBER >= 0x009080ffL \
&&!defined(OPENSSL_NO_EC) \
&&!defined(OPENSSL_NO_ECDH) \
&&!defined(OPENSSL_NO_ECDSA)
# define HAVE_EC
#endif
修改为
#if OPENSSL_VERSION_NUMBER
>= 0x009080ffL \
&&!defined(OPENSSL_NO_EC)\
&&!defined(OPENSSL_NO_EC2M)\
&&!defined(OPENSSL_NO_ECDH)\
&&!defined(OPENSSL_NO_ECDSA)
# define HAVE_EC
#endif
重新编译安装Erlang即可。
#新建用户 admin
[root@ecs-ee22 bin]# rabbitmqctl add_user admin password
Creating user "admin"
#添加权限
[root@ecs-ee22 bin]# rabbitmqctl set_permissions -p "/" admin ".*" ".*" ".*"
Setting permissions for user "admin" in vhost "/"
#添加用户组
[root@ecs-ee22 bin]# rabbitmqctl set_user_tags admin administrator
Setting tags for user "admin" to [administrator]
问题:configure: error: OpenGL libraries not available
$ sudo yum install mesa-libGL-devel
$ sudo yum install mesa-libGLU-devel