一:Erlang的安装
Erlang的版本和RabbitMQ的版本有严格的要求,具体的对应关系请查看RabbitMQ官网
官网地址如下:https://www.rabbitmq.com/which-erlang.html
1:解压
tar xf otp_src_21.2.tar.gz
2:进入到otp_src_21.2
cd otp_src_21.2
执行./configure --prefix=/usr/local/erlang20 --without-javac 就会开始编译安装 会编译到 /usr/local/erlang20 下然后执行
./configure --prefix=/usr/local/erlang20 --without-javac
3:编译和安装
make -j 4
make install
然后进入到erlang20文件夹下
cd erlang20/bin
./erl
则表示Erlang安装成功
二:RabbitMQ的安装
1:解压
tar xf rabbitmq-server-generic-unix-3.7.10.tar.xz
2:重命名
mv rabbitmq-server rabbitmq
3:启动rabbitmq
cd rabbitmq/sbin
./rabbitmq-server
4:查看日志
tail -f /usr/local/rabbitmq/var/log/rabbitmq/[email protected]
netstat -nap | grep 5672
5:查看RabbitMQ的启动状态
表示已经启动成功。
三:安装过程中遇到的坑
Error description:
noproc
Log files (may contain more information):
/var/log/rabbitmq/[email protected]
/var/log/rabbitmq/[email protected]
Stack trace:
[{gen,do_for_proc,2,[{file,"gen.erl"},{line,228}]},
{gen_event,rpc,2,[{file,"gen_event.erl"},{line,239}]},
{rabbit,ensure_working_log_handlers,0,
[{file,"src/rabbit.erl"},{line,788}]},
{rabbit,'-boot/0-fun-0-',0,[{file,"src/rabbit.erl"},{line,268}]},
{rabbit,start_it,1,[{file,"src/rabbit.erl"},{line,403}]},
{init,start_em,1,[]},
{init,do_boot,3,[]}]
=INFO REPORT==== 9-Aug-2018::11:14:43.848127 ===
Error description:
noproc
Log files (may contain more information):
/var/log/rabbitmq/[email protected]
/var/log/rabbitmq/[email protected]
Stack trace:
[{gen,do_for_proc,2,[{file,"gen.erl"},{line,228}]},
{gen_event,rpc,2,[{file,"gen_event.erl"},{line,239}]},
{rabbit,ensure_working_log_handlers,0,
[{file,"src/rabbit.erl"},{line,788}]},
{rabbit,'-boot/0-fun-0-',0,[{file,"src/rabbit.erl"},{line,268}]},
{rabbit,start_it,1,[{file,"src/rabbit.erl"},{line,403}]},
{init,start_em,1,[]},
{init,do_boot,3,[]}]
{"init terminating in do_boot",noproc}
init terminating in do_boot (noproc)
Crash dump is being written to: erl_crash.dump...done
这个问题在很大的程度上是Erlang和RabbitMQ的版本要求不一致所造成的。
因此请参考官网的匹配方式。