rabbitmq安装
Posted xy51
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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 安装正常
[[email protected] ~]# /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/ 还不能看到管理界面。
进行如下操作。
添加用户
[[email protected] sbin]# rabbitmqctl add_user admin admin
Creating user "admin" ...
设置用户权限为administrator
[[email protected] sbin]# rabbitmqctl set_user_tags admin administrator
Setting tags for user "admin" to [administrator] ...
[[email protected] sbin]#
查看插件
[[email protected] sbin]# rabbitmq-plugins list
Configured: E = explicitly enabled; e = implicitly enabled
| Status: * = running on [email protected]
|/
[ ] 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管理界面
[[email protected] 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 [email protected] started 6 plugins.
查看运行状态
[[email protected] sbin]# rabbitmqctl status
Status of node [email protected] ...
[{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]
"},
{memory,
[{total,60247192},
{connection_readers,0},
{uptime,466},
{kernel,{net_ticktime,60}}]
查看用户列表
[[email protected] sbin]# rabbitmqctl list_users
Listing users ...
admin [administrator]
guest [administrator]
到此,漂亮的界面就能看到了!!!
后台启动rabbitmq命令
/usr/local/rabbitmq/sbin/rabbitmq-server -detached
如果登陆http://IP:15672/ 还不能看到管理界面。可能事防火墙问题。
重启rabbitmq服务通过两个命令来实现: rabbitmqctl stop
:停止rabbitmq rabbitmq-server restart
: 重启rabbitmq
以上是关于rabbitmq安装的主要内容,如果未能解决你的问题,请参考以下文章