linux安装rabbitMQ
Posted 艾斯利文
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了linux安装rabbitMQ相关的知识,希望对你有一定的参考价值。
安装rabbitMQ需要提前安装elarge。
参考多个博客安装,各种问题,各种失败。各种依赖问题。
因此把安装步骤记录下来。
1.安装elarge:
wget http://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm
rpm -Uvh erlang-solutions-1.0-1.noarch.rpm
安装各种依赖:
yum -y install unixODBC unixODBC-devel wxBase wxGTK SDL wxGTK-gl
yum -y install install make gcc gcc-c++ kernel-devel m4 ncurses-devel openssl openssl-devel xmlto zip unzip
yum -y install gtk2-devel binutils-devel
下载这三个依赖:
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/wxGTK3-3.0.2-14.el6.x86_64.rpm
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/wxGTK3-3.0.2-14.el6.x86_64.rpm
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/wxBase3-3.0.2-14.el6.x86_64.rpm
安装下载的三个依赖:
rpm -ivh wxBase3-3.0.2-14.el6.x86_64.rpm
rpm -ivh libmspack-0.5-0.1.alpha.el6.x86_64.rpm
rpm -ivh libmspack-0.5-0.1.alpha.el6.x86_64.rpm
下载otp_src_19.3.tar.gz:
wget http://erlang.org/download/otp_src_19.3.tar.gz
解压otp_src_19.3.tar.gz:
tar -xvzf otp_src_19.3.tar.gz
cd otp_src_19.3
配置cd otp_src_19.3:
./configure --enable-smp-support --enable-threads --enable-sctp --enable-kernel-poll --enable-hipe --with-ssl
上述参数说明:
--prefix 指定安装目录
--enable-smp-support启用对称多处理支持(Symmetric Multi-Processing对称多处理结构的简称)
--enable-threads启用异步线程支持
--enable-sctp启用流控制协议支持(Stream Control Transmission Protocol,流控制传输协议)
--enable-kernel-poll启用Linux内核poll
--enable-hipe启用高性能Erlang(High Performance Erlang)参考资料:http://www.cnblogs.com/me-sa/archive/2012/10/09/erlang_hipe.html
--with-ssl使用SSL包
执行命安装
make && make install
下面几步为检测erlang 是否安装正常
find / -name erlang
/root/otp_src_19.3/lib/jinterface/java_src/com/ericsson/otp/erlang
/usr/share/java/erlang
/usr/local/lib/erlang
/usr/lib64/erlang
find / -name erl
/root/otp_src_19.3/bin/erl
/root/otp_src_19.3/bootstrap/bin/erl
/root/otp_src_19.3/erts/etc/win32/msys_tools/erl
/root/otp_src_19.3/erts/etc/win32/cygwin_tools/erl
/usr/local/bin/erl
/usr/local/lib/erlang/erts-8.3/bin/erl
/usr/local/lib/erlang/bin/erl
如果有如下信息提示出现,则标示 erlang 安装正常
[root@Rabbitmq ~]# /usr/local/bin/erl
Erlang/OTP 19 [erts-8.3] [source] [64-bit] [smp:2:2] [async-threads:10] [hipe] [kernel-poll:false]
2.安装rabbitMQ
下载rabbitmq-server-generic-unix-3.6.9.tar.xz :
wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.9/rabbitmq-server-generic-unix-3.6.9.tar.xz
安装xz解压软件:
yum -y install xz
解压:
xz -d rabbitmq-server-generic-unix-3.6.9.tar.xz
tar -xvf rabbitmq-server-generic-unix-3.6.9.tar
配置环境变量(这个我没有配置)
ERL_HOME=/usr/local/lib/erlang
RABBITMQ_HOME=/usr/local/rabbitmq
PATH=$PATH:$ERL_HOME/bin:/usr/local/rabbitmq/sbin
export ERL_HOME PATH RABBITMQ_HOME
启动:
rabbitmq-server start
此时登陆http://IP:15672/ 还不能看到管理界面。
进行如下操作。
添加用户
[root@Rabbitmq sbin]# rabbitmqctl add_user admin admin
Creating user "admin" ...
设置用户权限为administrator
[root@Rabbitmq sbin]# rabbitmqctl set_user_tags admin administrator
Setting tags for user "admin" to [administrator] ...
[root@Rabbitmq sbin]#
查看插件
[root@Rabbitmq sbin]# rabbitmq-plugins list
Configured: E = explicitly enabled; e = implicitly enabled
| Status: * = running on rabbit@Rabbitmq
|/
[ ] amqp_client 3.6.9
[ ] cowboy 1.0.4
[ ] cowlib 1.0.2
[ ] rabbitmq_amqp1_0 3.6.9
[ ] rabbitmq_auth_backend_ldap 3.6.9
启用插件 ,可以使用rabbitmq管理界面
[root@Rabbitmq sbin]# rabbitmq-plugins enable rabbitmq_management
The following plugins have been enabled:
amqp_client
cowlib
cowboy
rabbitmq_web_dispatch
rabbitmq_management_agent
rabbitmq_management
Applying plugin configuration to rabbit@Rabbitmq... started 6 plugins.
查看运行状态
[root@Rabbitmq sbin]# rabbitmqctl status
Status of node rabbit@Rabbitmq ...
[{pid,1612},
{running_applications,
[{rabbitmq_management,"RabbitMQ Management Console","3.6.9"},
{rabbitmq_management_agent,"RabbitMQ Management Agent","3.6.9"},
{amqp_client,"RabbitMQ AMQP Client","3.6.9"},
{kernel,"ERTS CXC 138 10","5.2"}]},
{os,{unix,linux}},
{erlang_version,
"Erlang/OTP 19 [erts-8.3] [source] [64-bit] [smp:2:2] [async-threads:64] [hipe] [kernel-poll:true]\\n"},
{memory,
[{total,60247192},
{connection_readers,0},
{uptime,466},
{kernel,{net_ticktime,60}}]
查看用户列表
[root@Rabbitmq sbin]# rabbitmqctl list_users
Listing users ...
admin [administrator]
guest [administrator]
重启服务:
service iptables restart
到此,漂亮的界面就能看到了!!!
后台启动rabbitmq命令
/usr/local/rabbitmq/sbin/rabbitmq-server -detached
如果登陆http://IP:15672/ 还不能看到管理界面。可能事防火墙问题。
需要对防火墙进行处理:
找到iptables配置路径:
[root@Rabbitmq sbin]# find / -name iptables
/etc/sysconfig/iptables
修改配置文件:
[root@Rabbitmq sbin]# vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 27017 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 28017 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 15672 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 5672 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 25672 -j ACCEPT
重启服务:
service iptables restart
参考博客:http://blog.csdn.net/spyiu/article/details/32134443
界面管理介绍可参考:http://blog.csdn.net/u013696226/article/details/21530659
以上是关于linux安装rabbitMQ的主要内容,如果未能解决你的问题,请参考以下文章