文档章节

Install RabbitMQ server in CentOS 7

o
 osc_z1hvg4cu
发布于 2018/04/24 16:48
字数 808
阅读 0
收藏 0

精选30+云产品,助力企业轻松上云!>>>

About RabbitMQ

RabbitMQ is an open source message broker software, also sometimes known as message-oriented middleware, that implements the Advanced Message Queuing Protocol (AMQP). It is very easy to use, and runs almost on all modern operating systems. It is built on the Open Telecom Platform framework for clustering and failover. RabbitMQ is written in the Erlang programming language, and is actively being developed by Rabbit Technologies Ltd.

In this tutorial, we will see how to install RabbitMQ server in CentOS 7 minimal server.

Prerequisites

RabbitMQ is written using Erlang programming language. So, it is must to install Erlang before installing RabbitMQ.

To install and configure Erlang in CentOS 7 server, refer the following link.

 

http://www.cnblogs.com/weifeng1463/p/8931543.html

Install RabbitMQ

Once you install Erlang, head over to the RabbitMQ download page for RPM based installers, and download the latest version using command:

wget https://www.rabbitmq.com/releases/rabbitmq-server/v3.6.1/rabbitmq-server-3.6.1-1.noarch.rpm

Then, run the following command as root user to add rabbitmq signing key:

rpm --import https://www.rabbitmq.com/rabbitmq-signing-key-public.asc

Finally, install RabbitMQ server using command:

yum install rabbitmq-server-3.6.1-1.noarch.rpm

Sample output:

Loaded plugins: fastestmirror
Examining rabbitmq-server-3.6.1-1.noarch.rpm: rabbitmq-server-3.6.1-1.noarch
Marking rabbitmq-server-3.6.1-1.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package rabbitmq-server.noarch 0:3.6.1-1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package Arch Version Repository Size
================================================================================
Installing:
 rabbitmq-server noarch 3.6.1-1 /rabbitmq-server-3.6.1-1.noarch 5.5 M

Transaction Summary
================================================================================
Install 1 Package

Total size: 5.5 M
Installed size: 5.5 M
Is this ok [y/d/N]: y

root@server1:~_002

That’s it. We have installed RabbitMQ.

SELinux and Firewall configuration

We must allow the following ports via SELinux, and Firewall in order to access RabbitMQ remote management console from the remote systems.

Make sure the following ports can be opened:

  • 4369 (epmd), 25672 (Erlang distribution)
  • 5672, 5671 (AMQP 0-9-1 without and with TLS)
  • 15672 (if management plugin is enabled)
  • 61613, 61614 (if STOMP is enabled)
  • 1883, 8883 (if MQTT is enabled)

To allow the above ports in firewall, run the following commands one by one:

firewall-cmd --permanent --add-port=4369/tcp
firewall-cmd --permanent --add-port=25672/tcp
firewall-cmd --permanent --add-port=5671-5672/tcp
firewall-cmd --permanent --add-port=15672/tcp
firewall-cmd --permanent --add-port=61613-61614/tcp
firewall-cmd --permanent --add-port=8883/tcp

Restart firewall service:

firewall-cmd --reload

And then, run the following command to allow SELinux to enable RabbitMQ service:

setsebool -P nis_enabled 1

Run the following command to start and enable RabbitMQ service:

systemctl start rabbitmq-server
systemctl enable rabbitmq-server

Now, check the status of RabbitMQ server using the following commands:

rabbitmqctl status

Sample output:

Status of node rabbit@server1 ...
[{pid,26591},
 {running_applications,
 [{rabbitmq_management,"RabbitMQ Management Console","3.6.1"},
 {rabbitmq_web_dispatch,"RabbitMQ Web Dispatcher","3.6.1"},
 {webmachine,"webmachine","1.10.3"},
 {mochiweb,"MochiMedia Web Server","2.13.0"},
 {ssl,"Erlang/OTP SSL application","7.3"},
 {rabbitmq_management_agent,"RabbitMQ Management Agent","3.6.1"},
 {rabbit,"RabbitMQ","3.6.1"},
 {mnesia,"MNESIA CXC 138 12","4.13.3"},
 {amqp_client,"RabbitMQ AMQP Client","3.6.1"},
 {compiler,"ERTS CXC 138 10","6.0.3"},
 {os_mon,"CPO CXC 138 46","2.4"},
 {syntax_tools,"Syntax tools","1.7"},
 {inets,"INETS CXC 138 49","6.2"},
 {rabbit_common,[],"3.6.1"},
 {public_key,"Public key infrastructure","1.1.1"},
 {asn1,"The Erlang ASN1 compiler version 4.0.2","4.0.2"},
 {ranch,"Socket acceptor pool for TCP protocols.","1.2.1"},
 {crypto,"CRYPTO","3.6.3"},
 {xmerl,"XML parser","1.3.10"},
 {sasl,"SASL CXC 138 11","2.7"},
 {stdlib,"ERTS CXC 138 10","2.8"},
 {kernel,"ERTS CXC 138 10","4.2"}]},
 {os,{unix,linux}},
 {erlang_version,
 "Erlang/OTP 18 [erts-7.3] [source-d2a6d81] [64-bit] [async-threads:64] [hipe] [kernel-poll:true]\n"},
 {memory,
 [{total,54224944},
 {connection_readers,0},
 {connection_writers,0},
 {connection_channels,0},
 {connection_other,2680},
 {queue_procs,2680},
 {queue_slave_procs,0},
 {plugins,424296},
 {other_proc,19559456},
 {mnesia,58312},
 {mgmt_db,111720},
 {msg_index,32856},
 {other_ets,1358408},
 {binary,36944},
 {code,27354680},
 {atom,992409},
 {other_system,4290503}]},
 {alarms,[]},
 {listeners,[{clustering,25672,"::"},{amqp,5672,"::"}]},
 {vm_memory_high_watermark,0.4},
 {vm_memory_limit,258528051},
 {disk_free_limit,50000000},
 {disk_free,12428034048},
 {file_descriptors,
 [{total_limit,924},{total_used,2},{sockets_limit,829},{sockets_used,0}]},
 {processes,[{limit,1048576},{used,197}]},
 {run_queue,0},
 {uptime,55},
 {kernel,{net_ticktime,60}}]

root@server1:~_003

Access RabbitMQ management console

RabbitMQ management console will allow you to monitor the server processes via a web browser.

To enable the RabbitMQ management console, run the following command:

 rabbitmq-plugins enable rabbitmq_management
chown -R rabbitmq:rabbitmq /var/lib/rabbitmq/

Now. open your web browser and navigate to the following URL to access your RabbitMQ server management console.

  • http://ip-address:15672/

The default user name and password of RabbitMQ Management console is ‘guest’ and ‘guest’ .

However, you can create a new admin user if you want.

To do so, run:

rabbitmqctl add_user mqadmin mqadmin
rabbitmqctl set_user_tags mqadmin administrator
rabbitmqctl set_permissions -p / mqadmin ".*" ".*" ".*"

Enter the username and password to access RabbitMQ web console:

RabbitMQ Management - Google Chrome_005

Congratulations! Here is how my RabbitMQ web dashboard looks like.

RabbitMQ Management

That’s all for now. Start using your RabbitMQ server.

For further details, check the links given at the end of this guide.

Cheers!

Reference links:

参考文章:https://www.unixmen.com/install-rabbitmq-server-centos-7/

o
粉丝 0
博文 500
码字总数 0
作品 0
私信 提问
加载中
请先登录后再评论。

暂无文章

Kotlin Class「T」

fun <T> gotoMainPage( context: Activity, postId: String, mainActivity: Class<T> ) { val intent = Intent(context, ADSplash......

osc_qatrfv06
16分钟前
0
0
小赢科技2020年一季报:由盈转亏1.96亿,M3以下贷款逾期率翻倍达6.71%

来源 | 新金融一线 北京时间6月29日,美股上市互金平台小赢科技公布了今年一季报未经审计的财务业绩报告。财报显示,该公司2020财年第一财季净营收同比下降31.9%至5.29亿元(人民币,下同);...

镭射财经
16分钟前
5
0
kotlin实现单例

/** * 功能:单例实现 */class Singleton private constructor() { companion object { val instance by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) { Si......

osc_5nscij7v
17分钟前
7
0
七月算法机器学习 11 决策树、随机森林、 adaboost

目录 主要内容 决策树 信息增益 三种决策树学习算法 决策树的例子 决策树的过拟合 Bootstraping Bagging的策略 随机森林 提升的概念 Adaboost 举例 主要内容 决策树  决策树学习采用的是自...

osc_2718ydlo
18分钟前
10
0
支持千万人次毫秒级交易,360金融的系统性能如何做到?

提到“系统性能”问题,便立即联想到刚刚过去的“618”购物狂欢,电商公司在面对高密集度并发交易行为时,依托强大的系统性能以保持用户在网购与支付过程中平台的系统稳定性的极致案例。系统...

osc_jrhexi1r
19分钟前
0
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部