Centos6, Centos7 安装erlang&rabbitmq
1.安装erlang
1.1准备工作,先安装依赖库
yum-yinstallmakegccgcc-c++kernel-develm4ncurses-developenssl-devel
yuminstallncurses-devel
1.2下载erlang源码
wgethttp://www.erlang.org/download/otp_src_R16B02.tar.gz
cpotp_src_R16B02.tar.gz/usr/src/otp_src_R16B02.tar.gz
cd/usr/src
tar-xzvfotp_src_R16B02.tar.gz
mvotp_src_R16B02erlang_R16B
1.3编译安装
cderlang_R16B/
./configure--prefix=/usr/local/erlang--with-ssl--enable-threads--enable-smp-support--enable-kernel-poll--enable-hipe--without-javac//不用java编译,故去掉java避免错误
make&&makeinstall//编译后安装
1.4配置环境变量
vi/etc/profile
ERL_HOME=/usr/local/erlang
exportPATH=$PATH:$ERL_HOME/bin
保存以上修改
source/etc/profile
2安装rabbitmq
2.1下载
wgethttp://www.rabbitmq.com/releases/rabbitmq-server/v3.1.5/rabbitmq-server-3.1.5.tar.gz
cprabbitmq-server-3.1.5.tar.gz/usr/src
cd/usr/src
tar-xzvfrabbitmq-server-3.1.5.tar.gz
2.2安装依赖库
yum-yinstallxmlto
否则会编译不通过:
/bin/sh:line1:xmlto:commandnotfound
2.3编译
cdrabbitmq-server-3.1.5
make
makeinstallTARGET_DIR=/usr/local/rabbitmqSBIN_DIR=/usr/local/rabbitmq/sbinMAN_DIR=/usr/local/rabbitmq/man//将rabbitmq编译到/opt/mq/rabbitmq目录
(注意:make的时候有可能会报错escript,执行如下命令:
ln-s/usr/local/erlang/bin/escript/usr/sbin/escript
)
2.4安装web插件管理界面
cd/usr/local/rabbitmq/sbin
mkdir/etc/rabbitmq/
./rabbitmq-pluginsenablerabbitmq_management
查看插件列表
./rabbitmq-pluginslist
2.5常用命令
启动rabbitmq
./rabbitmq-server-detached
在浏览器上输入http://127.0.0.1:15672/登录管理界面了
使用登录的名户名和密码默认都算guest
2.6关闭rabbitmq
./rabbitmqctlstop
原文出自:
https://blog.csdn.net/alonesword/article/details/42360653