CentOS 7 安装RabbitMQ

RabbitMQ基于Erlang开发,是一款实现了高级消息队列协议(AMQP)的开源消息代理软件。安装步骤具体如下:

安装 Erlang

为了安装方便,我们采用RabbitMQ团队提供的 Zero-dependency 64-bit Erlang RPM package来安装。

 在rabbitmq/erlang on Package Cloud 中复制命令行。

  • 创建erlang.repo仓库:
curl -s https://packagecloud.io/install/repositories/rabbitmq/erlang/script.rpm.sh | sudo bash
  • 安装erlang:
yum install erlang

安装 RabbitMQ Server

在 PackageCloud中复制命令行。

  • 创建rabbitmq-server.repo仓库:
curl -s https://packagecloud.io/install/repositories/rabbitmq/rabbitmq-server/script.rpm.sh | sudo bash
  • 安装rabbitmq-server:
yum install rabbitmq-server

运行 RabbitMQ Server

  • 设置开机默认启动rabbitmq-server守护进程:
# as an administrator run
chkconfig rabbitmq-server on
  • 启动或停止rabbitmq服务:
# run as an administrator
service rabbitmq-server start
# or
service rabbitmq-server stop
  • 启动管理插件(management plugin):
rabbitmq-plugins enable rabbitmq_management

管理插件提供一个web UI访问入口:http://localhost:15672/

注:这里需要在云服务器安全组里要打开端口15672


需要用到的端口:

  • 4369: epmd, a peer discovery service used by RabbitMQ nodes and CLI tools
  • 5672, 5671: used by AMQP 0-9-1 and 1.0 clients without and with TLS
  • 25672: used for inter-node and CLI tools communication (Erlang distribution server port) and is allocated from a dynamic range (limited to a single port by default, computed as AMQP port + 20000). Unless external connections on these ports are really necessary (e.g. the cluster uses federation or CLI tools are used on machines outside the subnet), these ports should not be publicly exposed. See networking guide for details.
  • 35672-35682: used by CLI tools (Erlang distribution client ports) for communication with nodes and is allocated from a dynamic range (computed as server distribution port + 10000 through server distribution port + 10010). See networking guide for details.
  • 15672: HTTP API clients, management UI and rabbitmqadmin (only if the management plugin is enabled)
  • 61613, 61614: STOMP clients without and with TLS (only if the STOMP plugin is enabled)
  • 1883, 8883: (MQTT clients without and with TLS, if the MQTT plugin is enabled)
  • 15674: STOMP-over-WebSockets clients (only if the Web STOMP plugin is enabled)
  • 15675: MQTT-over-WebSockets clients (only if the Web MQTT plugin is enabled)

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值