# yum -y install rabbitmq-server
# systemctl start rabbitmq-server  && systemctl enable rabbitmq-server

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

参考内容

参考https://computingforgeeks.com/installing-rabbitmq-on-centos-6-centos-7/

添加用户
# rabbitmqctl add_user admin NUaiMe0k
Adding user "admin" ...
# rabbitmqctl set_user_tags admin administrator
# rabbitmqctl list_users
Listing users ...
admin [administrator]
guest [administrator]

Delete User:

rabbitmqctl delete_user user

Change User Password:

rabbitmqctl change_password user strongpassword

Add virtualhost:

rabbitmqctl add_vhost /my_vhost

List virtualhosts:

rabbitmqctl list_vhosts

Delete virtualhost:

rabbitmqctl delete_vhost /my_vhost

Grant user permissions for vhost:

rabbitmqctl set_permissions -p /my_vhost user ".*" ".*" ".*"

List vhost permissions:

rabbitmqctl list_permissions -p /my_vhost

To list user permissions:

rabbitmqctl list_user_permissions user

Delete user permissions:

rabbitmqctl clear_permissions -p /my_vhost user

nable RabbitMQ UI

You can enable Management Plugin to use a web-based interface to administer RabbitMQ.

# rabbitmq-plugins enable rabbitmq_management
# systemctl restart rabbitmq-server
or for CentOS 6:
# service rabbitmq-server restart

Open ports on the firewall:

# firewall-cmd --add-port={4369/tcp,25672}/tcp --permanent

With Iptables:

# iptables -A INPUT -p tcp -m tcp --dport 4369 -j ACCEPT
# iptables -A INPUT -p tcp -m tcp --dport 25672 -j ACCEPT
==========================================================================
参考 https://www.howtoforge.com/tutorial/how-to-install-rabbitmq-server-on-centos-7/

In this tutorial, we will install RabbitMQ on CentOS 7 server.

Prerequisite

  • Minimal CentOS 7 server
  • Root privileges. This guide is written as the root user, if you are logged in as sudo user, run sudo -i.

Update Base System

Before installing any package it is recommended that you update the packages and repository using the following command.

 
yum -y update

Once your system is updated, proceed further to install Erlang.

Install Erlang

RabbitMQ is written in Erlang Language, in this tutorial we will install the latest version of Erlang into the server. Erlang is not available in default YUM repository, hence you will need to install EPEL repository. Run the following command for same.

yum -y install epel-release
yum -y update

Now install Erlang using following command.

yum -y install erlang socat

You can now check the Erlang version using the following command.

erl -version

You will get the following output.

[root@liptan-pc ~]# erl -version
Erlang (ASYNC_THREADS,HIPE) (BEAM) emulator version 5.10.4

To switch to Erlang shell, you can type the following command.

erl

The shell will change and you will get the following output.

Erlang R16B03-1 (erts-5.10.4) [source] [64-bit] [async-threads:10] [hipe] [kernel-poll:false]

Eshell V5.10.4  (abort with ^G)
1>

You can exit from the shell by pressing ctrl + C twice. Erlang is now installed on your system, you can now proceed to install RabbitMQ.

Install RabbitMQ

RabbitMQ provides RPM package for enterprise Linux systems which are precompiled and can be installed directly. The only required dependency was to install Erlang into the system. As we have installed Erlang we can proceed further to download RabbitMQ. Download the Erlang RPM package by running.

wget https://www.rabbitmq.com/releases/rabbitmq-server/v3.6.10/rabbitmq-server-3.6.10-1.el7.noarch.rpm

If you do not have wget installed, you can run yum -y install wget. You can always find the link to the latest version of RabbitMQ download page.

Import the GPG key by running:

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

Install the RPM package by running:

rpm -Uvh rabbitmq-server-3.6.10-1.el7.noarch.rpm

RabbitMQ is now installed on your system.

Starting RabbitMQ

You can start RabbitMQ server process by running the following command.

systemctl start rabbitmq-server

To automatically start RabbitMQ at boot time, run the following command.

systemctl enable rabbitmq-server

To check the status of RabbitMQ server, run:

systemctl status rabbitmq-server

You should get the following output if started successfully.

? rabbitmq-server.service - RabbitMQ broker
Loaded: loaded (/usr/lib/systemd/system/rabbitmq-server.service; enabled; vendor preset: disabled)
Active: active (running) since Sat 2017-07-15 18:59:14 UTC; 3min 22s ago
Main PID: 29006 (beam.smp)
Status: "Initialized"
CGroup: /system.slice/rabbitmq-server.service
??29006 /usr/lib64/erlang/erts-9.0/bin/beam.smp -W w -A 64 -P 1048576 -t 5000000 -stbt db -zdbbl 32000 -K tr...
??29149 /usr/lib64/erlang/erts-9.0/bin/epmd -daemon
??29283 erl_child_setup 1024
??29303 inet_gethost 4
??29304 inet_gethost 4 Jul 15 18:59:13 centos rabbitmq-server[29006]: Starting broker...
Jul 15 18:59:14 centos rabbitmq-server[29006]: systemd unit for activation check: "rabbitmq-server.service"
Jul 15 18:59:14 centos systemd[1]: Started RabbitMQ broker.
Jul 15 18:59:14 centos rabbitmq-server[29006]: completed with 0 plugins.

Modify Firewall and SELinux Rules

If you have firewalld installed and running, you will have to allow port 8161 through the firewall. Run the following command for same.

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

If you have SELinux enabled, you will have to run the following command to allow RabbitMQ service.

setsebool -P nis_enabled 1

Access Web Console

Enable RabbitMQ web management console by running:

rabbitmq-plugins enable rabbitmq_management

Provide ownership of RabbitMQ files to the RabbitMQ user by running:

chown -R rabbitmq:rabbitmq /var/lib/rabbitmq/

Now you will need to create an administrative user for RabbitMQ web management console. Run the following commands for same.

rabbitmqctl add_user admin StrongPassword
rabbitmqctl set_user_tags admin administrator
rabbitmqctl set_permissions -p / admin ".*" ".*" ".*"

Change admin to your preferred username for administrator user. Be sure to change StrongPassword to a very strong password.

To access the administrative panel of RabbitMQ, use your favourite web browser and open the following URL.

http://Your_Server_IP:15672/

You will see following login page.

Once you are logged in, you will see the administrative dashboard.

You can find the list of users, virtual hosts, policies at Admin tab of the dashboard. You should delete the Guest user for security considerations.

You can find the list of message queues at Queues tab. You can create a new queue or delete an existing one through this interface.

You can find the list of current connection on Connections tab

Similarly, you can find the channels and exchanges at their respective tabs.


//////////////整理

参考 https://www.howtoforge.com/tutorial/how-to-install-rabbitmq-server-on-centos-7/#install-erlang

安装erlang

yum -y update

yum -y install epel-release

yum -y update

yum -y install erlang socat

erl -version

[root@liptan-pc ~]# erl -version
Erlang (ASYNC_THREADS,HIPE) (BEAM) emulator version 5.10.4 输入 erl Erlang R16B03-1 (erts-5.10.4) [source] [64-bit] [async-threads:10] [hipe] [kernel-poll:false] Eshell V5.10.4  (abort with ^G)
1>
///////////////////////////////////////////////////////////////////////// 安装 RabbitMQ 1:
wget https://www.rabbitmq.com/releases/rabbitmq-server/v3.6.10/rabbitmq-server-3.6.10- 1.el7.noarch.rpm 2: Import the GPG key by running: rpm --import https://www.rabbitmq.com/rabbitmq-release-signing-key.asc 3:Install the RPM package by running: rpm -Uvh rabbitmq-server-3.6.10-1.el7.noarch.rpm Starting RabbitMQ systemctl start rabbitmq-server systemctl start rabbitmq-server systemctl status rabbitmq-server 调整防火墙 firewall-cmd --zone=public --permanent --add-port=4369/tcp
firewall-cmd --zone=public --permanent --add-port=25672/tcp
firewall-cmd --zone=public --permanent --add-port=5671-5672/tcp
firewall-cmd --zone=public --permanent --add-port=15672/tcp
firewall-cmd --zone=public --permanent --add-port=61613-61614/tcp
firewall-cmd --zone=public --permanent --add-port=1883/tcp
firewall-cmd --zone=public --permanent --add-port=8883/tcp firewall-cmd --reload setsebool -P nis_enabled 1 启用web Access Web Console rabbitmq-plugins enable rabbitmq_management chown -R rabbitmq:rabbitmq /var/lib/rabbitmq/ 添加用户
rabbitmqctl add_user admin StrongPassword
 rabbitmqctl set_user_tags admin administrator
 rabbitmqctl set_permissions -p / admin ".*" ".*" ".*" http://Your_Server_IP:15672/
////////////////////////////////////////////////////////////////////////////////////////////
删除erlang 如果yum install
 的就执行  yum list installed | grep erlang  yum remove erlang*    删除所有包 编译安装的需要删除 whereis erlang 找他然后删除
rm -rf /usr/local/erlang/

centos7 只需两步安装rabbitmq的更多相关文章

  1. 【代码更新】单细胞分析实录(21): 非负矩阵分解(NMF)的R代码实现,只需两步,啥图都有

    1. 起因 之前的代码(单细胞分析实录(17): 非负矩阵分解(NMF)代码演示)没有涉及到python语法,只有4个python命令行,就跟Linux下面的ls grep一样的.然鹅,有几个小伙伴不 ...

  2. 只需两步!Eclipse+Maven快速构建第一个Spring Boot项目

     随着使用Spring进行开发的个人和企业越来越多,Spring从一个单一简介的框架变成了一个大而全的开源软件,最直观的变化就是Spring需要引入的配置也越来越多.配置繁琐,容易出错,让人无比头疼, ...

  3. CentOS安装Yarn只需两步就搞定

    Yarn 是一个依赖管理工具.它能够管理你的代码,并与全世界的开发者分享代码.Yarn 是高效.安全和可靠的,你完全可以安心使用.代码是通过包(有时也被称为组件). 在每一个包中会定义一个 packa ...

  4. 只需两步在Linux系统安装百度网盘--Ubuntu20

    Linux Ubuntu系统安装百度网盘 百度网盘已支持Linux系统下载和使用.使用Linux系统下载并安装一个百度网盘是非常简单的,只需要以下两个步骤: 第一步 进入官网下载.deb类型的百度网盘 ...

  5. LoTVideo:只需两步,让HTML5原生态的Video茁壮成长

    开源地址:https://github.com/dunitian/LoTHTML5/tree/master/LoTVideo 第一步引入lotvideo.js(先确认在这个前面引入了jq包) 第二步: ...

  6. 如何将cordova导入Android studio,只需两步即可

    Cordova的技术交流新群 微信公众号:

  7. cordova 实现拨打电话-只需两步(H5)

    cordova 实现拨打电话: 第一步配置conf.xml在cordova中所有的URL Schemes 都是服从于白名单的,所以a tel 在这无法正常使用.解决方法是在项目config.xml中添 ...

  8. vue 使用font-awesome 只需两步

    npm 安装font-awesome 以及需要的所有依赖 cnpm install less less-loader css-loader style-loader file-loader font- ...

  9. eolinker——分享项目只需两步

    登陆后打开项目概况 然后进入到分享项目界面,可根据自己的需求进行设置

随机推荐

  1. 0057 Spring MVC如何获取HTTP请求头信息--URL中的动态参数--@RequestHeader--@CookieValue--@PathVariable

    获取HTTP请求头信息 一个HTTP请求除了有参数和实体内容外还有HTTP请求头信息,Spring MVC也可以获取这部分信息 @RequestHeader解可以将请求头信息映射到处理方法的形参上 @ ...

  2. 基于ffmpeg 直播推流和播放rtmp (IOS源码)

    ios直播推流每秒能达到30帧,比安卓要强,视频采用软编码的话手机会发烫,得采用码编码,播放视频采用opengl渲染. ffmpeg初始化代码如下: int init_Code(int width, ...

  3. flutter开发目录

    1>环境 2>设计 3>登录 4>主页面 5>主页面明细 6>详情 7>商品明细 8>购物车 9>订单页 10>个人关于 11>搜索页

  4. hdu 3836 Equivalent Sets(强连通分量--加边)

    Equivalent Sets Time Limit: 12000/4000 MS (Java/Others)    Memory Limit: 104857/104857 K (Java/Other ...

  5. Java与.NET机制比较分析

    一.概述 不管是什么语言开发的web应用程序,都是在解决一个问题,那就是用户输入url怎么把对应的页面响应出来,如何通过url映射到响应的类,由于自己做asp.net的时间也不短了,还算是对asp.n ...

  6. !KMP算法完整教程

      KMP算法完整教程 全称:                               Knuth_Morris_Pratt Algorithm(KMP算法) 类型:                ...

  7. 禁用LinkButton的方法

    1.服务器端,使用Enabled属性即可 <asp:LinkButton ID="lbtn" runat="server" Enabled="f ...

  8. MemoryStream类读写内存

    和FileStream一样,MemoryStream和BufferedStream都派生自基类Stream,因此它们有很多共同的属性和方法,但是每一个类都有自己独特的用法.这两个类都是实现对内存进行数 ...

  9. eclipse 下安装 lombok.jar

    lombok是一个java 开发插件,可以用来简化代码, 1. 下载lombok.jar https://projectlombok.org/download 2 将lombok.jar文件放在ecl ...

  10. 网络协议之p2p---一个简单的nat 穿透demo

    http://www.pudn.com/downloads64/sourcecode/p2p/detail228131.html http://www.pudn.com/downloads15/sou ...