需要的安装包
otp_src_18.2.1.tar.gz.tar
rabbitmq-server-3.5.7.tar.gz
1、安装erlang 语言环境
RabbitMQ是基于Erlang的,所以首先必须配置Erlang环境.
yum -y install make gcc gcc-c++ kernel-devel m4 ncurses ncurses-devel openssl-devel perl
cd /usr/local/xp
tar -zxvf otp_src_18.2.1.tar.gz.tar
cd otp_src_17.4;
./configure --prefix=/usr/local/erlang;
make && make install
修改/etc/profile文件,增加下面的环境变量:
#set erlang environment
export PATH=$PATH:/usr/local/erlang/bin
. /etc/profile
安装完成以后,执行erl看是否能打开eshell,用’halt().’退出,注意后面的点号,那是erlang的结束符。
[root@localhost ~]# erl
Erlang/OTP 18 [erts-7.2.1] [source] [64-bit] [smp:2:2] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V7.2.1 (abort with ^G)
1>
2、安装RabbitMQ
下载源码
cd /usr/local/xp
yum install xmlto -y # 安装依赖文件 否则编译时报错:line 1: xmlto: command not found
tar -zxvf rabbitmq-server-3.5.7.tar.gz
cd rabbitmq-server-3.5.7
make TARGET_DIR=/usr/local/rabbitmq SBIN_DIR=/usr/local/rabbitmq/sbin MAN_DIR=/usr/local/rabbitmq/man DOC_INSTALL_DIR=/usr/local/rabbitmq/doc
make TARGET_DIR=/usr/local/rabbitmq SBIN_DIR=/usr/local/rabbitmq/sbin MAN_DIR=/usr/local/rabbitmq/man DOC_INSTALL_DIR=/usr/local/rabbitmq/doc install
添加系统环境变量:
修改/etc/profile文件,增加下面的环境变量:
export PATH=$PATH:/usr/local/erlang/bin:/usr/local/rabbitmq/sbin
source /etc/profile
启动服务
运行rabbitmq:
/usr/rabbitmq/sbin/rabbitmq-server -detached #默认监听端口5672、25672
查看rabbitmq状态:
/usr/rabbitmq/sbin/rabbitmqctl status
关闭rabbitmq:
/usr/rabbitmq/sbin/rabbitmqctl stop
查看RabbitMQ服务启动的状态
到此处rabbitmq的安装基本搞定,接下来搞的就是配置了,前提以rabbitmq WEB 登陆为主
,所以在先下面的三个基本配置中有一个是必须的,其中以红色为主。
enabled_plugins
[root@yunwei_dev rabbitmq]# cat enabled_plugins
[rabbitmq_management,rabbitmq_shovel,rabbitmq_shovel_management].rabbitmq.conf
rabbitmq-env.conf
接下来是开启rabbitmq WEB控制台,开启rabbitmq_management插件
rabbitmq-plugins enable rabbitmq_management
然后重启rabbitmq服务
转载于:https://blog.51cto.com/ntxjxp/1748740