安装依赖环境:
yum install build-essential openssl openssl-devel unixODBC unixODBC-devel make gcc gcc-c++ kernel-devel m4 ncurses-devel
一、安装erlang
1、下载所需源码,此次下载的是otp_src_17.4.tar.gz
(wget http://erlang.org/download/otp_src_19.0.tar.gz)
2、解压源码,tar xvf otp_src_17.4.tar.gz
3、进入解压后的目录 cd otp_src_17.4
4、配置安装路径,./configure --prefix=/home/erlang
(./configure --prefix=/usr/local/erlang --with-ssl -enable-threads -enable-smmp-support -enable-kernel-poll --enable-hipe --without-javac)
configure之后发现有以下提示信息:
*********************************************************************
********************** APPLICATIONS DISABLED **********************
*********************************************************************
odbc : ODBC library – link check failed
jinterface : No Java compiler found
如果出现下面错误:
crypto : No usable OpenSSL found
ssh : No usable OpenSSL found
ssl : No usable OpenSSL found
这时请执行下面命令:
apt-get install libssl-dev(适用与ubuntu下)
这时需要执行一条命令:
yum install unixODBC unixODBC-dev
安装前配置: ./configure --prefix=/home/erlang --without-javac
5、开始编译, make
6、安装,make install
下面给erl做一个软连接到/usr/local/bin/,以方便使用
ln -s /home/erlang/bin/erl /usr/local/bin/erl |
配置环境变量:
vi /etc/profile
ERLANG_HOME=/home/erlang
PATH=$ERLANG_HOME/bin:$PATH
export ERLANG_HOME
export PATH
source /etc/profile
开始测试:
[root@localhost ~]# erl
Erlang R13B04 (erts-5.7.5) [source] [smp:2:2] [rq:2] [async-threads:0] [hipe] [kernel-poll:false]
Eshell V5.7.5 (abort with ^G)
二、安装RabbitMq
1、下载源码,rabbitmq-server-generic-unix-3.6.14.tar.xz
(wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.14/rabbitmq-server-generic-unix-3.6.14.tar.xz
)
2、解压文件
xz -d rabbitmq-server-generic-unix-3.6.14.tar.xz
tar -xvf rabbitmq-server-generic-unix-3.6.14.tar
3、重新拷贝,命名(可有可无)
cp -rf ./rabbitmq_server-3.6.14 /usr/local/
cd /usr/local/
mv rabbitmq_server-3.6.14 rabbitmq-3.6.14
4、配置变量
cd ./rabbitmq-3.6.14/sbin/
vi ./rabbitmq-server
ERLANG_HOME=/usr/local/erlang
PATH=$ERLANG_HOME/bin:$PATH
export ERLANG_HOME
export PATH
5、启动服务
./rabbitmq-server -detached
6、启用插件
./rabbitmq-plugins enable rabbitmq_management
7、添加用户
./rabbitmqctl add_user admin admin
./rabbitmqctl set_user_tags admin administrator
(在docker容器中添加好像保存不了,只好去修改/ebin/rabbit.app中,将{loopback_users, [<<"guest">>]}改成{loopback_users, []},允许guest远程登录)
7、停止服务
./rabbitmqctl stop