RabbitMQ搭建

【安装epel】

[[email protected] opt]# wget -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

--2015-12-27 15:46:14--  http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

正在解析主机 dl.fedoraproject.org... 209.132.181.24, 209.132.181.25, 209.132.181.26, ...

正在连接 dl.fedoraproject.org|209.132.181.24|:80... 已连接。

已发出 HTTP 请求,正在等待回应... 200 OK

长度:14540 (14K) [application/x-rpm]

正在保存至: “epel-release-6-8.noarch.rpm”

100%[===========================================================================================>] 14,540      23.2K/s   in 0.6s

2015-12-27 15:46:16 (23.2 KB/s) - 已保存 “epel-release-6-8.noarch.rpm” [14540/14540])

[[email protected] opt]# ls

epel-release-6-8.noarch.rpm

[[email protected] opt]# rpm -ivh epel-release-6-8.noarch.rpm

warning: epel-release-6-8.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY

Preparing...                ########################################### [100%]

1:epel-release           ########################################### [100%]

[[email protected] opt]#

[[email protected] opt]#

[[email protected] opt]#

[[email protected] opt]#

[[email protected] opt]#

[[email protected] opt]# cd /etc/yum.repos.d/;ls

epel.repo  epel-testing.repo

[[email protected] yum.repos.d]# wget -c http://mirrors.163.com/.help/CentOS6-Base-163.repo

--2015-12-27 15:48:34--  http://mirrors.163.com/.help/CentOS6-Base-163.repo

正在解析主机 mirrors.163.com... 123.58.173.186, 123.58.173.185

正在连接 mirrors.163.com|123.58.173.186|:80... 已连接。

已发出 HTTP 请求,正在等待回应... 200 OK

长度:2006 (2.0K) [application/octet-stream]

正在保存至: “CentOS6-Base-163.repo”

100%[=============================>] 2,006       --.-K/s   in 0s

2015-12-27 15:48:34 (284 MB/s) - 已保存 “CentOS6-Base-163.repo” [2006/2006])

[[email protected] yum.repos.d]# yum clean all

Loaded plugins: fastestmirror, refresh-packagekit, security

Cleaning repos: base epel extras updates

Cleaning up Everything

Cleaning up list of fastest mirrors

[[email protected] yum.repos.d]# yum makecache

Loaded plugins: fastestmirror, refresh-packagekit, security

Determining fastest mirrors

epel/metalink                                   | 4.2 kB     00:00

* epel: mirrors.opencas.cn

base                                            | 3.7 kB     00:00

base/group_gz                                   | 219 kB     00:00

base/filelists_db                               | 6.3 MB     00:11

base/primary_db                                 | 4.6 MB     00:12

base/other_db                                   | 2.8 MB     00:12

epel                                            | 4.3 kB     00:00

epel/group_gz                                   | 149 kB     00:00

epel/filelists_db                               | 7.9 MB     00:28

epel/updateinfo                                 | 709 kB     00:01

epel/primary_db                                 | 5.7 MB     00:18

epel/other_db                                   | 2.9 MB     00:09

extras                                          | 2.9 kB     00:00

extras/filelists_db                             |  36 kB     00:00

extras/primary_db                               |  33 kB     00:00

extras/other_db                                 |  48 kB     00:00

updates                                         | 3.4 kB     00:00

updates/filelists_db                            | 2.5 MB     00:11

updates/prestodelta                             | 289 kB     00:01

updates/primary_db                              | 3.3 MB     00:13

updates/other_db                                |  39 MB     01:26

Metadata Cache Created

[[email protected] yum.repos.d]# yum -y install rabbitmq-server

Loaded plugins: fastestmirror, refresh-packagekit, security

Loading mirror speeds from cached hostfile

* epel: mirrors.opencas.cn

Setting up Install Process

Resolving Dependencies

--> Running transaction check

...

---> Package tcl.x86_64 1:8.5.7-6.el6 will be installed

--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================

Package                 Arch    Version                Repository

Size

=======================================================================

Installing:

rabbitmq-server         noarch  3.1.5-1.el6            epel     3.6 M

Installing for dependencies:

SDL                     x86_64  1.2.14-7.el6_7.1       updates  193 k

erlang                  x86_64  R14B-04.3.el6          epel      26 k

...

wxGTK-gl                x86_64  2.8.12-1.el6.centos    extras    31 k

Transaction Summary

=======================================================================

Install      66 Package(s)

Total download size: 45 M

Installed size: 90 M

Downloading Packages:

(1/66): SDL-1.2.14-7.el6_7.1.x86_64.rpm         | 193 kB     00:00

...

(66/66): wxGTK-gl-2.8.12-1.el6.centos.x86_64.rp |  31 kB     00:00

-----------------------------------------------------------------------

Total                                  248 kB/s |  45 MB     03:07

warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY

Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

Importing GPG key 0x0608B895:

Userid : EPEL (6) <[email protected]>

Package: epel-release-6-8.noarch (installed)

From   : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

Running rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

Warning: RPMDB altered outside of yum.

Installing : erlang-crypto-R14B-04.3.el6.x86_64                 1/66

...

Verifying  : erlang-cosEvent-R14B-04.3.el6.x86_64              66/66

Installed:

rabbitmq-server.noarch 0:3.1.5-1.el6

Dependency Installed:

SDL.x86_64 0:1.2.14-7.el6_7.1

erlang.x86_64 0:R14B-04.3.el6

...

wxGTK-gl.x86_64 0:2.8.12-1.el6.centos

Complete!

[[email protected] yum.repos.d]# erl

Erlang R14B04 (erts-5.8.5) [source] [64-bit] [rq:1] [async-threads:0] [kernel-poll:false]

Eshell V5.8.5  (abort with ^G)

1>

BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded

(v)ersion (k)ill (D)b-tables (d)istribution

^C

[[email protected] yum.repos.d]#

[[email protected] yum.repos.d]#

[[email protected] yum.repos.d]#

[[email protected] yum.repos.d]#

[[email protected] yum.repos.d]#

[[email protected] yum.repos.d]#

[[email protected] yum.repos.d]# ls

CentOS6-Base-163.repo  epel.repo  epel-testing.repo  other

[[email protected] yum.repos.d]#

[[email protected] yum.repos.d]#

[[email protected] yum.repos.d]# cd /usr/lib/rabbitmq/

[[email protected] rabbitmq]# ls

bin  lib

[[email protected] rabbitmq]# cd bin

[[email protected] bin]# ls

rabbitmqctl        rabbitmq-env      rabbitmq-server

rabbitmq-defaults  rabbitmq-plugins

[[email protected] bin]# ./rabbitmq-plugins list  #查看插件表

[ ] amqp_client                       3.1.5

[ ] cowboy                            0.5.0-rmq3.1.5-git4b93c2d

[ ] eldap                             3.1.5-gite309de4

[ ] mochiweb                          2.7.0-rmq3.1.5-git680dba8

[ ] rabbitmq_amqp1_0                  3.1.5

[ ] rabbitmq_auth_backend_ldap        3.1.5

[ ] rabbitmq_auth_mechanism_ssl       3.1.5

[ ] rabbitmq_consistent_hash_exchange 3.1.5

[ ] rabbitmq_federation               3.1.5

[ ] rabbitmq_federation_management    3.1.5

[ ] rabbitmq_jsonrpc                  3.1.5

[ ] rabbitmq_jsonrpc_channel          3.1.5

[ ] rabbitmq_jsonrpc_channel_examples 3.1.5

[ ] rabbitmq_management               3.1.5

[ ] rabbitmq_management_agent         3.1.5

[ ] rabbitmq_management_visualiser    3.1.5

[ ] rabbitmq_mqtt                     3.1.5

[ ] rabbitmq_shovel                   3.1.5

[ ] rabbitmq_shovel_management        3.1.5

[ ] rabbitmq_stomp                    3.1.5

[ ] rabbitmq_tracing                  3.1.5

[ ] rabbitmq_web_dispatch             3.1.5

[ ] rabbitmq_web_stomp                3.1.5

[ ] rabbitmq_web_stomp_examples       3.1.5

[ ] rfc4627_jsonrpc                   3.1.5-git5e67120

[ ] sockjs                            0.3.4-rmq3.1.5-git3132eb9

[ ] webmachine                        1.10.3-rmq3.1.5-gite9359c7

[[email protected] bin]# ls

rabbitmqctl        rabbitmq-env      rabbitmq-server

rabbitmq-defaults  rabbitmq-plugins

[[email protected] bin]# ./rabbitmq-plugins enable rabbitmq_management  #启动web插件

The following plugins have been enabled:

mochiweb

webmachine

rabbitmq_web_dispatch

amqp_client

rabbitmq_management_agent

rabbitmq_management

Plugin configuration has changed. Restart RabbitMQ for changes to take effect.

[[email protected] bin]# /etc/init.d/rabbitmq-server start     #启动服务

Starting rabbitmq-server: SUCCESS

rabbitmq-server.

[[email protected] bin]# /etc/init.d/rabbitmq-server status    #查看状态

Status of node [email protected] ...

[{pid,27920},

{running_applications,

[{rabbitmq_management,"RabbitMQ Management Console","3.1.5"},

{rabbitmq_web_dispatch,"RabbitMQ Web Dispatcher","3.1.5"},

{webmachine,"webmachine","1.10.3-rmq3.1.5-gite9359c7"},

{mochiweb,"MochiMedia Web Server","2.7.0-rmq3.1.5-git680dba8"},

{rabbitmq_management_agent,"RabbitMQ Management Agent","3.1.5"},

{rabbit,"RabbitMQ","3.1.5"},

{mnesia,"MNESIA  CXC 138 12","4.5"},

{os_mon,"CPO  CXC 138 46","2.2.7"},

{inets,"INETS  CXC 138 49","5.7.1"},

{xmerl,"XML parser","1.2.10"},

{amqp_client,"RabbitMQ AMQP Client","3.1.5"},

{sasl,"SASL  CXC 138 11","2.1.10"},

{stdlib,"ERTS  CXC 138 10","1.17.5"},

{kernel,"ERTS  CXC 138 10","2.14.5"}]},

{os,{unix,linux}},

{erlang_version,

"Erlang R14B04 (erts-5.8.5) [source] [64-bit] [rq:1] [async-threads:30] [kernel-poll:true]\n"},

{memory,

[{total,31040512},

{connection_procs,5296},

{queue_procs,5296},

{plugins,251696},

{other_proc,9663216},

{mnesia,57360},

{mgmt_db,52400},

{msg_index,20920},

{other_ets,1043720},

{binary,7576},

{code,17075518},

{atom,1548833},

{other_system,1308681}]},

{vm_memory_high_watermark,0.4},

{vm_memory_limit,411407155},

{disk_free_limit,1000000000},

{disk_free,95179345920},

{file_descriptors,

[{total_limit,924},{total_used,3},{sockets_limit,829},{sockets_used,1}]},

{processes,[{limit,1048576},{used,191}]},

{run_queue,0},

{uptime,4}]

...done.

[[email protected] bin]# netstat -tlnp | grep beam   #查看端口

tcp        0      0 0.0.0.0:53906               0.0.0.0:*                   LISTEN      27920/beam

tcp        0      0 0.0.0.0:15672               0.0.0.0:*                   LISTEN      27920/beam

tcp        0      0 0.0.0.0:55672               0.0.0.0:*                   LISTEN      27920/beam

tcp        0      0 :::5672                     :::*                        LISTEN      27920/beam

[[email protected] bin]# rabbitmqctl list_queues  #显示所有队列

Listing queues ...

...done.

[[email protected] bin]# rabbitmqctl list_vhosts  #遍历所有虚拟主机信息

Listing vhosts ...

/

...done.

[[email protected] bin]# rabbitmqctl add_vhost vhostname  #创建vhost

Creating vhost "vhostname" ...

...done.

[[email protected] bin]# rabbitmqctl list_vhosts  #遍历所有虚拟主机信息

Listing vhosts ...

/

vhostname

...done.

[[email protected] bin]# rabbitmqctl add_user wsyht 123456  #添加用户及密码

Creating user "wsyht" ...

...done.

[[email protected] bin]# rabbitmqctl list_users  #查看用户表

Listing users ...

guest   [administrator]

wsyht   []

...done.

[[email protected] bin]# rabbitmqctl set_user_tags wsyht administrator    #给用户添加管理员权限

Setting tags for user "wsyht" to [administrator] ...

...done.

【WEB访问登陆】

时间: 2024-10-15 07:07:20

RabbitMQ搭建的相关文章

centos6.5 已 zero-dependency Erlang from RabbitMQ 搭建环境

rabbitmq 官方安装文档可参考:http://www.rabbitmq.com/install-rpm.html  ,由于rabbitmq 使用Erlang 开发的,运行环境需要用到Erlang,本文主要记录采用zero-dependency Erlang 方式搭建rabbitmq 环境. 1.安装Erlang基础依赖: yum -y install make gcc gcc-c++ kernel-devel m4 ncurses-devel openssl-devel 2.下载编译源码h

RabbitMQ搭建与使用(windows)

1.MQ 消息队列(Message Queue,简称MQ),队列可以理解为管道,以管道的方式做消息传递. 2.场景 和我们平时超市购物一样,在我们结算的时候,并不会一窝蜂涌入收银台,而是排队结算.这就是队列机制. 3.搭建RabbitMQ环境 3.1.下载地址:http://www.rabbitmq.com/download.html3.2.安装Erlang:http://www.erlang.org/download/otp_win64_17.3.exe 3.3.启动管理工具输入命令:rabb

RabbitMQ的安装及集群搭建方法

RabbitMQ安装 1 安装erlang 下载地址:http://www.erlang.org/downloads 博主这里采用的是otp_src_19.1.tar.gz (200MB+) [[email protected] util]# tar zxvf otp_src_19.1.tar.gz [[email protected] util]# cd otp_src_19.1 [[email protected] otp_src_19.1]# ./configure --prefix=/o

RabbitMQ集群、镜像部署配置

1   RABBITMQ简介及安装 RabbitMQ是一个开源的AMQP实现,服务器端用Erlang语言编写,支持多种客户端,如:Python.Ruby..NET.Java.JMS.C.PHP.ActionScript.XMPP.STOMP等,支持AJAX.用于在分布式系统中存储转发消息,在易用性.扩展性.高可用性等方面表现不俗. AMQP,即Advanced message Queuing Protocol,高级消息队列协议,是应用层协议的一个开放标准,为面向消息的中间件设计.消息中间件主要用

RABBITMQ集群及HA、LB

一.Rabbitmq简介 RabbitMQ是一个开源的AMQP实现,服务器端用Erlang语言编写,支持多种客户端,如:Python.Ruby..NET.Java.JMS.C.PHP.ActionScript.XMPP.STOMP等,支持AJAX.用于在分布式系统中存储转发消息,在易用性.扩展性.高可用性等方面表现不俗. AMQP,即Advanced message Queuing Protocol,高级消息队列协议,是应用层协议的一个开放标准,为面向消息的中间件设计.消息中间件主要用于组件之间

rabbitmq 安装-单点

centos6.5  rabbitmq搭建 环境:centos6.5 192.168.9.41 安装rabbitmq需要先安装erlang.rabbitmq3.6版本需要erlang R16B03++版本的支持. 1.准备好安装包 wget http://erlang.org/download/otp_src_19.0.tar.gz wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.5/rabbitmq-server-gener

RabbitMQ消息队列应用

RabbitMQ消息队列应用 消息通信组件Net分布式系统的核心中间件之一,应用与系统高并发,各个组件之间解耦的依赖的场景.本框架采用消息队列中间件主要应用于两方面:一是解决部分高并发的业务处理:二是通过消息队列传输系统日志.目前业界使用较多的消息队列组件有RabbitMQ.ActiveMQ.MSMQ.kafka.zeroMQ等,本文对系统架构之MQ Component诠释,并采用RabbitMQ作为消息队列中间件. 图1- 消息队列组件示意图 一.RabbitMQ介绍 RabbitMQ是一款基

Net分布式系统之四:RabbitMQ消息队列应用

消息通信组件Net分布式系统的核心中间件之一,应用与系统高并发,各个组件之间解耦的依赖的场景.本框架采用消息队列中间件主要应用于两方面:一是解决部分高并发的业务处理:二是通过消息队列传输系统日志.目前业界使用较多的消息队列组件有RabbitMQ.ActiveMQ.MSMQ.kafka.zeroMQ等,本文对系统架构之MQ Component诠释,并采用RabbitMQ作为消息队列中间件. 图1- 消息队列组件示意图 一.RabbitMQ介绍 RabbitMQ是一款基于AMQP(消息队列协议),由

分布式rabbitmq集群部署

分布式rabbitmq集群部署本次部署使用的三台centos服务器安装的erlang 版本为 21.0.4安装的rabbitmq版本为3.7.8-rc.2在三台服务器中分别安装rabbitmq-serverrabbitmq通信是建立在erlang环境中 所以需要先安装erlang环境 因为国外的erlang官方地址中中国不能直接访问,所以我们使用第三方包https://github.com/rabbitmq/erlang-rpm 安装说明地址 修改系统repo包文件修改repo# In /etc