CentOS下安装RabbitMQ

安装Erlang

1.安装依赖环境

yum -y install make gcc gcc-c++ kernel-devel m4 ncurses-devel openssl-devel unixODBC-devel

2.下载Erlang

wget http://erlang.org/download/otp_src_21.3.tar.gz

3.解压&&构建

# 解压
tar -xvzf otp_src_21.0.tar.gz# 进入解压后的Erlang目录
cd otp_src_21.3# 构建
./otp_build autoconf
# 如果出现 ./otp_build: line 319: autoconf: command not found ,需要yum install -y autoconf

4.配置安装

./configure
make
make install

7.配置环境变量

vim /etc/profile# 末尾添加
export ERLANG_HOME=/usr/local/lib/erlang
export PATH=$PATH:$ERLANG_HOME/bin# 重新加载环境变量
source /etc/profile# 查看版本号
erl

安装RabbitMQ

1.下载RabbitMQ

RabbitMQ-server-3.7.15

wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.7.15/rabbitmq-server-3.7.15-1.el7.noarch.rpm

2.导入相关的秘钥

# Package Cloud signs distributed packages using their own GPG keys. As of late 2018 Package Cloud is undergoing a signing key migration. Instead of relying on a "master key", projects will migrate to use repository-specific signing keys. Before the migration is completed, both old and new key must be imported for forward compatibility:
# 包云使用它们自己的GPG密钥对分布式包进行签名。到2018年底,包云正在进行签名密钥迁移。项目将迁移到使用存储库特定的签名键,而不是依赖于“主键”。在迁移完成之前,为了向前兼容,必须同时导入新旧密钥:
# import the new PackageCloud key that will be used starting December 1st, 2018 (GMT)
# 导入将于2018年12月1日起使用的新PackageCloud密钥(GMT)
rpm --import https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey
# import the old PackageCloud key that will be discontinued on December 1st, 2018 (GMT)
# 进口将于2018年12月1日停产的旧PackageCloud密钥
rpm --import https://packagecloud.io/gpg.key

3.执行云存储库快速脚本

详情可到 云存储库https://packagecloud.io/rabbitmq/rabbitmq-server/install#bash-rpm

# quick install  快速安装
curl -s https://packagecloud.io/install/repositories/rabbitmq/rabbitmq-server/script.rpm.sh | sudo bash

以下提示安装成功:

Complete!
Generating yum cache for rabbitmq_rabbitmq-server...
Importing GPG key 0x4D206F89:Userid     : "https://packagecloud.io/rabbitmq/rabbitmq-server (https://packagecloud.io/docs#gpg_signing) <support@packagecloud.io>"Fingerprint: 8c69 5b02 19af deb0 4a05 8ed8 f4e7 8920 4d20 6f89From       : https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey
Generating yum cache for rabbitmq_rabbitmq-server-source...The repository is setup! You can now install packages.

4.安装RabbitMQ

# 安装
rpm -ivh rabbitmq-server-3.7.15-1.el7.noarch.rpm

遇到错误:

[root@haha installed]# rpm -ivh rabbitmq-server-3.7.15-1.el7.noarch.rpm
error: Failed dependencies:erlang >= 20.3 is needed by rabbitmq-server-3.7.15-1.el7.noarchsocat is needed by rabbitmq-server-3.7.15-1.el7.noarch

解决方式:

  1. erlang >= 20.3 is needed by rabbitmq-server-3.7.15-1.el7.noarch 问题

我已经安装了Erlang varsion21.3 了,还是给我报这个错误,这个时候可以使用 ++rpm -ivh --nodeps rabbitmq-server-3.5.7-1.noarch.rpm++ 命令。详情:stackoverflow

  1. socat is needed by rabbitmq-server-3.7.15-1.el7.noarch 问题

yum install socat

成功后:

[root@haha installed]# rpm -ivh --nodeps rabbitmq-server-3.7.15-1.el7.noarch.rpm
Preparing...                          ################################# [100%]
Updating / installing...1:rabbitmq-server-3.7.15-1.el7     ################################# [100%]
[root@haha installed]# [root@haha installed]# cd /etc/rabbitmq/
[root@haha rabbitmq]# ls
[root@haha rabbitmq]# cd ..
[root@haha etc]# cd /usr/share/doc/rabbitmq-server-3.7.15/
[root@haha rabbitmq-server-3.7.15]# ls
LICENSE                         LICENSE-ISC-cowboy           LICENSE-MIT-Sammy060
LICENSE-APACHE2                 LICENSE-MIT-EJS              LICENSE-MPL2
LICENSE-APACHE2-excanvas        LICENSE-MIT-EJS10            LICENSE-MPL-RabbitMQ
LICENSE-APACHE2-ExplorerCanvas  LICENSE-MIT-Erlware-Commons  LICENSE-rabbitmq_aws
LICENSE-APL2-Stomp-Websocket    LICENSE-MIT-Flot             rabbitmq.config.example
LICENSE-BSD-base64js            LICENSE-MIT-jQuery           README
LICENSE-BSD-recon               LICENSE-MIT-jQuery164        set_rabbitmq_policy.sh.example
LICENSE-erlcloud                LICENSE-MIT-Mochi
LICENSE-httpc_aws               LICENSE-MIT-Sammy
[root@haha rabbitmq-server-3.7.15]#
  • –nodeps就是安装时不检查依赖关系,比如你这个rpm需要A,但是你没装A,这样你的包就装不上,用了–nodeps你就能装上了。
  • –force就是强制安装,比如你装过这个rpm的版本1,如果你想装这个rpm的版本2,就需要用–force强制安装

5.然后来配置一下rabbitmq才能正式使用

把/usr/share/doc/rabbitmq-server-3.7.15/rabbitmq.config.example拷贝到/etc/rabbitmq/下并且重命名,去掉后缀 .example 就行:

移除前面的 %% 代表注释 以及 最后的 逗号,这个是代表运行 guest 默认用户可以在非本地环境登录

%% The default "guest" user is only permitted to access the server
%% via a loopback interface (e.g. localhost).
%% {loopback_users, [<<"guest">>]},
%%
%% Uncomment the following line if you want to allow access to the
%% guest user from anywhere on the network.
%%{loopback_users, []},修改为%% The default "guest" user is only permitted to access the server
%% via a loopback interface (e.g. localhost).
%% {loopback_users, [<<"guest">>]},
%%
%% Uncomment the following line if you want to allow access to the
%% guest user from anywhere on the network.
{loopback_users, []}

6.安装后相关配置

# 开机启动
systemctl enable rabbitmq-server.service# WEB插件
rabbitmq-plugins enable rabbitmq_management

7.到此配置全部结束,最后一步就是启动rabbitmq server了

# 启动
service rabbitmq-server start
# 停止
service rabbitmq-server stop
# 重新启动
service rabbitmq-server restart

访问地址:http://127.0.0.1:15672/

6.配置文件位置

home dir : /var/lib/rabbitmq
/etc/rabbitmq/advanced.config
/etc/rabbitmq/rabbitmq.conf

CentOS7下使用rpm安装RabbitMQ相关推荐

  1. mysql-5.7在CentOS-7下的rpm安装

    0.安装MySQL前准备 安装MySQL依赖包 systemctl stop postfix systemctl disable postfix yum remove postfixyum insta ...

  2. Centos7下使用rpm包安装mysql5.6数据库

    Centos7下使用rpm包安装mysql5.6数据库 环境 [root@mysql01 ~]# uname -r 3.10.0-514.el7.x86_64 [root@mysql01 ~]# ca ...

  3. linux防火墙安装httpd配置,CentOS7下 Apache的安装配置方法

    前些天安装了Nginx,为了好玩我就又安装Apache,Apache的安装还算顺利.在此做一下学习记录和经验分享. 一.安装httpd 1.先查看一下系统有没有已经安装了httpd的,如果啥都没查到, ...

  4. 第一篇:centos7下svn的安装与卸载

    2019独角兽企业重金招聘Python工程师标准>>> 第一篇:centos7下svn的安装与卸载 2017年11月29日 00:10:53 独家记忆ly 阅读数:6108 这是我的 ...

  5. Centos7 下nexus的安装和使用

    文章目录 Centos7 下nexus的安装和使用 1.安装JDK 1.1查看当前linux是否安装java 1.2 上传jdk到linux文件目录 1.3 配置环境变量 (1)修改/etc/prof ...

  6. CentOS7下的软件安装方法及策略详解

    CentOS7下的软件安装方法及策略详解 互联网   01-24 15:15:09   作者:佚名   我要评论 今天小编为大家带来的是CentOS7下的软件安装方法及策略详解:希望对大家安装Cent ...

  7. CentOS7下通过yum安装p7zip

    CentOS7下通过yum安装p7zip 现象 云ECS主机上,没有装p7zip,然后通过yum安装,发现也没有这样包.再仔细检查了下,发现本机环境中,没有启用epel源,致使通过yum无法安装p7z ...

  8. Centos7下 Redis的安装、配置开机自启动、开放远程连接

    一.Centos7下 Redis的安装: 1.下载安装包: wget http://download.redis.io/releases/redis-4.0.2.tar.gz 2.解压安装包并安装: ...

  9. java 1.7 linux rpm,linux下用rpm 安装jdk 7的jdk-7u79-linux-x64.rpm

    linux下用rpm 安装jdk 7的jdk-7u79-linux-x64.rpm 步骤一.下载jdk的rpm安装包 步骤二.如果linux是centos的话,请先卸载openjdk,参考文档:使用r ...

最新文章

  1. 梯度中心化,一行代码加速训练并提升泛化能力
  2. 腾讯获赔 475 万!首例“微信自动抢红包”不正当竞争案宣判
  3. java 网络爬虫 正则表达式_【干货】Java网络爬虫基础知识
  4. javascript之parseInt的用法分析
  5. 理解RTMP、HttpFlv和HLS的正确姿势
  6. MySQL的表类型和存储引擎
  7. BZOJ 1007 水平可见直线
  8. cenos7部署samba
  9. Java开源内容管理CMS系统J4CMS的几个样式
  10. 全国、省、地级市、区县乡镇级矢量地图2021年(最新)
  11. python5个标准库,列出5个python标准库
  12. 使用uboot + minicom串口协议下载镜像文件
  13. html将数据永久保存起来,数据保存(永久保存)方式(示例代码)
  14. JIRA 6.3.6 详细安装图解
  15. 【LaTeX笔记12】Latex分栏布局及模板使用
  16. ubuntu系统开机显示BusyBox v1.22.1(Ubuntu 1:1.22.0-15ubuntu1) built-in shell(ash) 问题的解决办法
  17. 整个世界都是你的绿幕:这个视频抠图换背景的方法太惊艳了!
  18. p5.js创意绘图(1)动态图形
  19. 模拟电子技术/国外电子与通信教材系列
  20. 对接阿里云短信平台报错

热门文章

  1. 来一份Android动画全家桶(下篇)
  2. 最新最全的非常有趣的逻辑推理题目大全
  3. NO PAPER COWBOYS【翻译】
  4. 梦幻手游服务器维护摆摊公示时间,梦幻西游手游5月27日维护公告
  5. 【05】2.1 程序语言特征
  6. 小U管家如何加入联盟?
  7. Huffman编码文件压缩
  8. 传真故障排除示例--传真CED信号断续导致传真失败
  9. 软件测试类工具大全2009版
  10. 【Vue3+vite+Element-UI Plus 】