http://www.rabbitmq.com/download.html


[root@contoso ~]#rpm -Uvh http://download.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-10.noarch.rpm

[root@contoso ~]# yum install -y erlang
[root@contoso ~]# rpm --import https://www.rabbitmq.com/rabbitmq-release-signing-key.asc
[root@contoso ~]# yum install -y https://bintray.com/rabbitmq/rabbitmq-server-rpm/download_file?file_path=rabbitmq-server-3.6.10-1.el7.noarch.rpm
[root@contoso ~]# systemctl enable rabbitmq-server
[root@contoso ~]# systemctl restart rabbitmq-server
[root@contoso ~]# systemctl status rabbitmq-server
[root@contoso ~]# rabbitmqctl status
Status of node rabbit@contoso
[{pid,6577},
{running_applications,
[{rabbit,"RabbitMQ","3.6.10"},
{mnesia,"MnesIA CXC 138 12","4.11"},
{os_mon,"CPO CXC 138 46","2.2.14"},
{ranch,"Socket acceptor pool for TCP protocols.","1.3.0"},
{ssl,"Erlang/OTP SSL application","5.3.3"},
{public_key,"Public key infrastructure","0.21"},
{crypto,"CRYPTO version 2","3.2"},
{rabbit_common,
"Modules shared by rabbitmq-server and rabbitmq-erlang-client",
"3.6.10"},
{compiler,"ERTS CXC 138 10","4.9.4"},
{xmerl,"XML parser","1.3.6"},
{Syntax_tools,"Syntax tools","1.6.13"},
{asn1,"The Erlang ASN1 compiler version 2.0.4","2.0.4"},
{sasl,"SASL CXC 138 11","2.3.4"},
{stdlib,"1.19.4"},
{kernel,"2.16.4"}]},
{os,{unix,linux}},
{erlang_version,
"Erlang R16B03-1 (erts-5.10.4) [source] [64-bit] [smp:4:4] [async-threads:64] [hipe] [kernel-poll:true]\n"},
{memory,
[{total,54096928},
{connection_readers,0},
{connection_writers,
{connection_channels,
{connection_other,
{queue_procs,2800},
{queue_slave_procs,
{plugins,
{other_proc,22582320},60912},
{metrics,132072},
{mgmt_db,
{msg_index,40536},
{other_ets,2084968},
{binary,740008},
{code,22700940},
{atom,842665},
{other_system,5038979}]},
{alarms,[]},
{listeners,[{clustering,25672,"::"},{amqp,5672,"::"}]},
{vm_memory_high_watermark,0.4},
{vm_memory_limit,3274466918},
{disk_free_limit,50000000},
{disk_free,47952224256},
{file_descriptors,
[{total_limit,924},{total_used,2},{sockets_limit,829},{sockets_used,0}]},
{processes,[{limit,1048576},{used,152}]},
{run_queue,
{uptime,155},
{kernel,{net_ticktime,60}}]
[root@contoso ~]#
[root@contoso ~]# 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@contoso... started 6 plugins.

[root@contoso ~]#

http://127.0.0.1:15672

一个是环境变量的配置文件 rabbitmq-env.conf
一个是配置信息的配置文件 rabbitmq.config
注意,这两个文件默认是没有的,如果需要必须自己创建。

rabbitmq-env.conf

这个文件的位置是确定和不能改变的,位于:/etc/rabbitmq目录下(这个目录需要自己创建)。
文件的内容包括了RabbitMQ的一些环境变量,常用的有:
#RABBITMQ_NODE_PORT= //端口号
#HOSTNAME=
RABBITMQ_NODENAME=mq
RABBITMQ_CONfig_FILE= //配置文件的路径
RABBITMQ_MnesIA_BASE=/rabbitmq/data //需要使用的MnesIA数据库的路径
RABBITMQ_LOG_BASE=/rabbitmq/log //log的路径
RABBITMQ_PLUGINS_DIR=/rabbitmq/plugins //插件的路径

rabbitmq 添加远程访问功能

[root@contoso ~]# cat > /etc/rabbitmq/rabbitmq.config
[{rabbit,[{loopback_users,[]}]}].
[root@contoso ~]# systemctl restart rabbitmq-server
[root@contoso ~]# systemctl status rabbitmq-server






http://127.0.0.1:15672/api/


RabbitMQ Management HTTP API
Introduction

Apart from this help page,all URIs will serve only resources of type application/json,and will require HTTP basic authentication (using the standard RabbitMQ user database). The default user is guest/guest.

Many URIs require the name of a virtual host as part of the path,since names only uniquely identify objects within a virtual host. As the default virtual host is called "/",this will need to be encoded as "%2f".

PUTing a resource creates it. The JSON object you upload must have certain mandatory keys (documented below) and may have optional keys. Other keys are ignored. Missing mandatory keys constitute an error.

Since bindings do not have names or IDs in AMQP we synthesise one based on all its properties. Since predicting this name is hard in the general case,you can also create bindings by POSTing to a factory URI. See the example below.

Many URIs return lists. Such URIs can have the query string parameters sort and sort_reverse added. sort allows you to select a primary field to sort by,and sort_reverse will reverse the sort order if set to true. The sort parameter can contain subfields separated by dots. This allows you to sort by a nested component of the listed items; it does not allow you to sort by more than one field. See the example below.

You can also restrict what information is returned per item with the columns parameter. This is a comma-separated list of subfields separated by dots. See the example below.

Most of the GET queries return many fields per object. See the separate stats documentation.
Examples

A few quick examples for Windows and Unix,using the command line tool curl:

Get a list of vhosts:

:: Windows
C:\> curl -i -u guest:guest http://localhost:15672/api/vhosts
# Unix
$ curl -i -u guest:guest http://localhost:15672/api/vhosts
HTTP/1.1 200 OK
Server: MochiWeb/1.1 WebMachine/1.10.0 (never breaks eye contact)
Date: Mon,16 Sep 2013 12:00:02 GMT
Content-Type: application/json
Content-Length: 30

[{"name":"/","tracing":false}]


Get a list of channels,fast publishers first,restricting the info items we get back:

:: Windows
C:\> curl -i -u guest:guest "http://localhost:15672/api/channels?sort=message_stats.publish_details.rate&sort_reverse=true&columns=name,message_stats.publish_details.rate,message_stats.deliver_get_details.rate"

# Unix
$ curl -i -u guest:guest 'http://localhost:15672/api/channels?sort=message_stats.publish_details.rate&sort_reverse=true&columns=name,message_stats.deliver_get_details.rate'

HTTP/1.1 200 OK
Server: MochiWeb/1.1 WebMachine/1.10.0 (never breaks eye contact)
Date: Mon,16 Sep 2013 12:01:17 GMT
Content-Type: application/json
Content-Length: 219
Cache-Control: no-cache

[{"message_stats":{"publish_details":{"rate" ... (remainder elided)

Create a new vhost:

:: Windows
C:\> curl -i -u guest:guest -H "content-type:application/json" ^
-XPUT http://localhost:15672/api/vhosts/foo


# Unix
$ curl -i -u guest:guest -H "content-type:application/json" \
-XPUT http://localhost:15672/api/vhosts/foo


HTTP/1.1 204 No Content
Server: MochiWeb/1.1 WebMachine/1.10.0 (never breaks eye contact)
Date: Mon,16 Sep 2013 12:03:00 GMT
Content-Type: application/json
Content-Length: 0

Note: you must specify application/json as the mime type.

Note: the name of the object is not needed in the JSON object uploaded,since it is in the URI. As a virtual host has no properties apart from its name,this means you do not need to specify a body at all!
Create a new exchange in the default virtual host:

:: Windows
C:\> curl -i -u guest:guest -H "content-type:application/json" ^
-XPUT -d"{""type"":""direct"",""durable"":true}" ^
http://localhost:15672/api/exchanges/%2f/my-new-exchange


# Unix
$ curl -i -u guest:guest -H "content-type:application/json" \
-XPUT -d'{"type":"direct","durable":true}' \
http://localhost:15672/api/exchanges/%2f/my-new-exchange


HTTP/1.1 204 No Content
Server: MochiWeb/1.1 WebMachine/1.10.0 (never breaks eye contact)
Date: Mon,16 Sep 2013 12:04:00 GMT
Content-Type: application/json
Content-Length: 0

Note: we never return a body in response to a PUT or DELETE,unless it fails.
And delete it again:

:: Windows
C:\> curl -i -u guest:guest -H "content-type:application/json" ^
-XDELETE http://localhost:15672/api/exchanges/%2f/my-new-exchange


# Unix
$ curl -i -u guest:guest -H "content-type:application/json" \
-XDELETE http://localhost:15672/api/exchanges/%2f/my-new-exchange


HTTP/1.1 204 No Content
Server: MochiWeb/1.1 WebMachine/1.10.0 (never breaks eye contact)
Date: Mon,16 Sep 2013 12:05:30 GMT
Content-Type: application/json
Content-Length: 0

Reference


[root@contoso ~]# python -V
Python 2.7.5
[root@contoso ~]#


[root@contoso ~]# wget https://raw.githubusercontent.com/rabbitmq/rabbitmq-management/rabbitmq_v3_6_10/bin/rabbitmqadmin

[root@contoso ~]# mv rabbitmqadmin /usr/local/bin/

[root@contoso ~]# chmod 755 /usr/local/bin/rabbitmqadmin
[root@contoso ~]# rabbitmqadmin --help Usage ===== rabbitmqadmin [options] subcommand Options ======= --help,-h show this help message and exit --config=CONfig,-c CONfig configuration file [default: ~/.rabbitmqadmin.conf] --node=NODE,-N NODE node described in the configuration file [default: 'default' only if configuration file is specified] --host=HOST,-H HOST connect to host HOST [default: localhost] --port=PORT,-P PORT connect to port PORT [default: 15672] --path-prefix=PATH_PREFIX use specific URI path prefix for the RabbitMQ HTTP API (default: blank string) [default: ] --vhost=VHOST,-V VHOST connect to vhost VHOST [default: all vhosts for list,'/' for declare] --username=USERNAME,-u USERNAME connect using username USERNAME [default: guest] --password=PASSWORD,-p PASSWORD connect using password PASSWORD [default: guest] --quiet,-q suppress status messages [default: True] --ssl,-s connect with ssl [default: False] --ssl-key-file=SSL_KEY_FILE PEM format key file for SSL --ssl-cert-file=SSL_CERT_FILE PEM format certificate file for SSL --ssl-ca-cert-file=SSL_CA_CERT_FILE PEM format CA certificate file for SSL --ssl-disable-hostname-verification disables peer hostname verification --format=FORMAT,-f FORMAT format for listing commands - one of [raw_json,long,pretty_json,kvp,tsv,table,bash] [default: table] --sort=SORT,-S SORT sort key for listing queries --sort-reverse,-R reverse the sort order --depth=DEPTH,-d DEPTH maximum depth to recurse for listing tables [default: 1] --bash-completion Print bash completion script [default: False] --version display version and exit More Help ========= For more help use the help subcommand: rabbitmqadmin help subcommands # For a list of available subcommands rabbitmqadmin help config # For help with the configuration file [root@contoso ~]#

在CentOS 7系统上安装RabbitMQ的更多相关文章

  1. ios – 如何处理退款/取消应用内购买

    我正在尝试处理iOS的退款应用内购买.但我找不到明确的指导方针来做到这一点.所以我有一个会员类型的应用程序内购买功能,其中用户凭据不一定与itunes帐户绑定.当有人进行购买时,我可以参考哪种标识符,并且当他们通过苹果申请退款时具有相同的标识符?我需要立即取消会员资格.谢谢!解决方法我最终存储了收据字符串并运行cron来完成事务并查找取消字段.

  2. 简析Swift和C的交互

    之前好像简单说过Swift和Objective-C的交互问题。其实我们也可以用Swift调用纯C代码或者基于C的第三方库。)Swift官方文档中,以及那本已经被迅速翻译为中文的ibooks书中,都提到了Swift调用Objective-C和C是有很好支持的。本内容包括Swift调用C和相应的C调用Swift,项目混编。对于C来说,最头疼的莫过于指针,而Swift是一门没有指针的语言。这些标准库函数表示为Darwin.C.HEADER.name。实际上由于Swift模块结构是平坦的,他们均位于Darwin中

  3. swift接口的使用

    swiftAPI的使用最近楼主要使用swift的API接口,楼主有一个习惯,不管开发需要用到什么知识,都喜欢看官方文档,虽然大部分是英文,但是用起来还是感觉可靠,不过对于openstack给的swiftAPI接口,可叫我吃了不少苦,所以写下这篇文章希望给有同样困惑的朋友帮助。获得的结果如下:%Total%Received%XferdAverageSpeedTimeTimeTimeCurrentDloadUploadTotalSpentLeftSpeed10013771001282100959382695-

  4. swift – 如果存在管道,则通过NSTask终止cURL

    我试图在Swift中为一个简单的命令行批处理脚本同步读取URL的内容.为了简单起见,我使用cURL–我知道如果必须的话,我可以使用NSURLSession.我也在使用OSX上的Swift开源版本进行swift构建.问题是,在某些URL上,如果stdout已重定向到管道,则NSTask永远不会终止.但是,如果删除管道或更改URL,则任务成功.使用来自终端的curl直接运行任何示例都会成功,因此在从特

  5. CentOS 8.2服务器上安装最新版Node.js的方法

    这篇文章主要介绍了CentOS 8.2服务器上安装最新版Node.js的方法,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下

  6. 浅谈php使用curl模拟多线程发送请求

    这篇文章主要介绍了php使用curl模拟多线程发送请求,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧

  7. PHP curl 或 file_get_contents 获取需要授权页面的方法

    本篇文章主要介绍了PHP curl 或 file_get_contents获取需要授权页面的方法,具有很好的参考价值。下面跟着小编一起来看下吧

  8. 可兼容php5与php7的cURL文件上传功能实例分析

    这篇文章主要介绍了可兼容php5与php7的cURL文件上传功能,结合实例形式分析了针对php5与php7版本在使用curl进行文件上传时的相关判定与具体操作技巧,需要的朋友可以参考下

  9. centos+php+coreseek+sphinx+mysql之一coreseek安装篇

    这篇文章主要介绍了centos+php+coreseek+sphinx+mysql之一coreseek安装篇的相关资料,非常不错具有参考借鉴价值,需要的朋友可以参考下

  10. python操作RabbitMq的三种工作模式

    这篇文章主要为大家介绍了python操作RabbitMq的三种工作模式,有需要的朋友可以借鉴参考下,希望能够有所帮助,祝大家多多进步早日升职加薪

随机推荐

  1. 在airgapped(离线)CentOS 6系统上安装yum软件包

    我有一个CentOS6系统,出于安全考虑,它已经被空气泄漏.它可能从未连接到互联网,如果有,它很长时间没有更新.我想将所有.rpm软件包放在一个驱动器上,这样它们就可以脱机安装而无需查询互联网.但是,我在测试VM上遇到的问题是,即使指定了本地路径,yum仍然会挂起并尝试从在线存储库进行更新.另外,有没有办法使用yum-utils/yumdownloader轻松获取该包的所有依赖项和所有依赖项?目前

  2. centos – 命名在日志旋转后停止记录到rsyslog

    CentOS6.2,绑定9.7.3,rsyslog4.6.2我最近设置了一个服务器,我注意到在日志轮换后,named已停止记录到/var/log/messages.我认为这很奇怪,因为所有日志记录都是通过rsyslog进行的,并且named不会直接写入日志文件.这更奇怪,因为我在更新区域文件后命名了HUPed,但它仍然没有记录.在我停止并重新启动命名后,记录恢复.这里发生了什么?

  3. centos – 显示错误的磁盘大小

    对于其中一个磁盘,Df-h在我的服务器上显示错误的空白区域:Cpanel表明它只有34GB免费,但还有更多.几分钟前,我删除了超过80GB的日志文件.所以,我确信它完全错了.fdisk-l/dev/sda2也显示错误:如果没有格式化,我该怎么做才能解决这个问题?并且打开文件描述符就是它需要使用才能做到这一点.所以…使用“lsof”并查找已删除的文件.重新启动写入日志文件的服务,你很可能会看到空间可用.

  4. 如何在centos 6.9上安装docker-ce 17?

    我目前正在尝试在centOS6.9服务器上安装docker-ce17,但是,当运行yuminstalldocker-ce时,我收到以下错误:如果我用跳过的标志运行它我仍然得到相同的消息,有没有人知道这方面的方法?

  5. centos – 闲置工作站的异常负载平均值

    我有一个新的工作站,具有不寻常的高负载平均值.机器规格是:>至强cpu>256GB的RAM>4x512GBSSD连接到LSI2108RAID控制器我从livecd安装了CentOS6.564位,配置了分区,网络,用户/组,并安装了一些软件,如开发工具和MATLAB.在启动几分钟后,工作站负载平均值的值介于0.5到0.9之间.但它没有做任何事情.因此我无法理解为什么负载平均值如此之高.你能帮我诊断一下这个问题吗?

  6. centos – Cryptsetup luks – 检查内核是否支持aes-xts-plain64密码

    我在CentOS5上使用cryptsetupluks加密加密了一堆硬盘.一切都很好,直到我将系统升级到CentOS6.现在我再也无法安装磁盘了.使用我的关键短语装载:我收到此错误:在/var/log/messages中:有关如何装载的任何想法?找到解决方案问题是驱动器使用大约512个字符长的交互式关键短语加密.出于某种原因,CentOS6中的新内核模块在由旧版本创建时无法正确读取512个字符的加密密钥.似乎只会影响内核或cryptsetup的不同版本,因为在同一系统上创建和打开时,512字符的密钥将起作用

  7. centos – 大量ssh登录尝试

    22个我今天登录CentOS盒找到以下内容这是过去3天内的11次登录尝试.WTF?请注意,这是我从我的提供商处获得的全新IP,该盒子是全新的.我还没有发布任何关于此框的内容.为什么我会进行如此大量的登录尝试?是某种IP/端口扫描?基本上有4名匪徒,其中2名来自中国,1名来自香港,1名来自Verizon.这只发生在SSH上.HTTP上没有问题.我应该将罪魁祸首子网路由吗?你们有什么建议?

  8. centos – kswap使用100%的CPU,即使有100GB的RAM也可用

    >Linux内核是否应该足够智能,只需从内存中清除旧缓存页而不是启动kswap?

  9. centos – Azure将VM从A2 / 3调整为DS2 v2

    我正在尝试调整前一段时间创建的几个AzureVM,从基本的A3和标准A3到标准的DS2v2.我似乎没有能力调整到这个大小的VM.必须从头开始重建服务器会有点痛苦.如果它有所不同我在VM中运行CentOS,每个都有一个带有应用程序和操作系统的磁盘.任何人都可以告诉我是否可以在不删除磁盘的情况下删除VM,创建新VM然后将磁盘附加到新VM?

  10. centos – 广泛使用RAM时服务器计算速度减慢

    我在非常具体的情况下遇到服务器速度下降的问题.事实是:>1)我使用计算应用WRF>2)我使用双XeonE5-2620v3和128GBRAM(NUMA架构–可能与问题有关!

返回
顶部