概述
我尝试过自己下载erlang和rabbitmq压缩包然后配置环境变量,然后就出现了一堆错误,什么版本不依赖,通配符错误,行,不这样弄了。
直接在线安装了
erlang安装包
wget www.rabbitmq.com/releases/erlang/erlang-18.3-1.el7.centos.x86_64.rpm
socat秘钥安装包
wget http://repo.iotti.biz/CentOS/7/x86_64/socat-1.7.3.2-5.el7.lux.x86_64.rpm
rabbitmq服务端安装包
wget www.rabbitmq.com/releases/rabbitmq-server/v3.6.5/rabbitmq-server-3.6.5-1.noarch.rpm
首先安装Erlang的语言基础安装包,安装过程如下所示:
[root@localhost ~]# rpm -ivh erlang-18.3-1.el7.centos.x86_64.rpm
Preparing...
################################# [100%]
Updating / installing...
1:erlang-18.3-1.el7.centos
################################# [100%]
[root@localhost ~]#
开始安装密钥包,如下所示:
[root@localhost ~]# rpm -ivh socat-1.7.3.2-5.el7.lux.x86_64.rpm
Preparing...
################################# [100%]
Updating / installing...
1:socat-1.7.3.2-5.el7
################################# [100%]
[root@localhost ~]#
开始安装rabbitmq服务器端,如下所示:
[root@localhost ~]# rpm -ivh rabbitmq-server-3.6.5-1.noarch.rpm
warning: rabbitmq-server-3.6.5-1.noarch.rpm: Header V4 RSA/SHA1 Signature, key ID 6026dfca: NOKEY
Preparing...
################################# [100%]
Updating / installing...
1:rabbitmq-server-3.6.5-1
################################# [100%]
[root@localhost ~]#
rpm安装方式已经帮助你配置好了环境这些东西,比解压缩安装好点,因为解压缩安装还需要手动配置环境变量的。接下来,配置一下RabbitMQ。配置如下所示:
修改内容如是:{loopback_users, <<“guest”>>},修改为{loopback_users, [guest]}。这个是用户的设置。必须修改的。
RabbitMQ安装成功以后,就可以进行RabbitMQ的服务启动和停止。
[root@localhost ~]# rabbitmq-server start &
[1] 14092
[root@slaver4 ~]#
RabbitMQ 3.6.5. Copyright (C) 2007-2016 Pivotal Software, Inc.
##
##
Licensed under the MPL.
See http://www.rabbitmq.com/
##
##
##########
Logs: /var/log/rabbitmq/rabbit@slaver4.log
######
##
/var/log/rabbitmq/rabbit@slaver4-sasl.log
##########
Starting broker...
completed with 0 plugins.
启动完成以后,如何验证启动是否正常呢,使用如下命令可以查看RabbitMQ启动是否正常。可以看到RabbitMQ的进程号,以及协议名称等等。
先装lsof插件
yum -y install lsof
[root@localhost ~]# lsof -i:5672
COMMAND
PID
USER
FD
TYPE DEVICE SIZE/OFF NODE NAME
beam
14206 rabbitmq
48u
IPv6
70172
0t0
TCP *:amqp (LISTEN)
[root@localhost ~]#
如何停止RabbitMQ呢,可以使用如下所示停止方式,如下所示
[root@localhost ~]# rabbitmqctl stop
Stopping and halting node rabbit@slaver4 ...
Gracefully halting Erlang VM
可以使用rabbitmq-plugins list命令查看默认提供了什么样的插件。
[root@localhost ~]# rabbitmq-plugins list
Configured: E = explicitly enabled; e = implicitly enabled
| Status:
* = running on rabbit@localhost
|/
[
] amqp_client
3.6.5
[
] cowboy
1.0.3
[
] cowlib
1.0.1
[
] mochiweb
2.13.1
[
] rabbitmq_amqp1_0
3.6.5
[
] rabbitmq_auth_backend_ldap
3.6.5
[
] rabbitmq_auth_mechanism_ssl
3.6.5
[
] rabbitmq_consistent_hash_exchange 3.6.5
[
] rabbitmq_event_exchange
3.6.5
[
] rabbitmq_federation
3.6.5
[
] rabbitmq_federation_management
3.6.5
[
] rabbitmq_jms_topic_exchange
3.6.5
[
] rabbitmq_management
3.6.5
[
] rabbitmq_management_agent
3.6.5
[
] rabbitmq_management_visualiser
3.6.5
[
] rabbitmq_mqtt
3.6.5
[
] rabbitmq_recent_history_exchange
1.2.1
[
] rabbitmq_sharding
0.1.0
[
] rabbitmq_shovel
3.6.5
[
] rabbitmq_shovel_management
3.6.5
[
] rabbitmq_stomp
3.6.5
[
] rabbitmq_top
3.6.5
[
] rabbitmq_tracing
3.6.5
[
] rabbitmq_trust_store
3.6.5
[
] rabbitmq_web_dispatch
3.6.5
[
] rabbitmq_web_stomp
3.6.5
[
] rabbitmq_web_stomp_examples
3.6.5
[
] sockjs
0.3.4
[
] webmachine
1.10.3
上面插件列表里没有可视化UI界面,需要配置可视化RabbitMQ管理界面
[root@localhost sbin]#
/usr/lib/rabbitmq/lib/rabbitmq_server-3.6.5/sbin/rabbitmq-plugins enable rabbitmq_management
The following plugins have been enabled:
mochiweb
webmachine
rabbitmq_web_dispatch
amqp_client
rabbitmq_management_agent
rabbitmq_management
Applying plugin configuration to rabbit@localhost... started 6 plugins.
安装了可视化插件后,还要加个用户登录
如下的命令就是创建一个用户名为root,密码为root的登录用户,就可以使用可视化界面了
[root@localhost sbin]# rabbitmqctl add_user root root
Creating user "root" ...
[root@localhost sbin]# rabbitmqctl set_user_tags root administrator
Setting tags for user "root" to [administrator] ...
[root@localhost sbin]# rabbitmqctl set_permissions -p / root '.*' '.*' '.*'
Setting permissions for user "root" in vhost "/" ...
[root@localhost sbin]# rabbitmqctl list_permissions
Listing permissions in vhost "/" ...
root
.*
.*
.*
guest
.*
.*
.*
最后
以上就是超级小天鹅为你收集整理的rabbitmq的安装的全部内容,希望文章能够帮你解决rabbitmq的安装所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复