Installing RabbitMQ-3.10.2 on CentOS 7.9

  • Installing RabbitMQ-3.10.2 on CentOS 7.9已关闭评论
  • 162 次浏览
  • A+
所属分类:linux技术
摘要

1 地址 https://www.rabbitmq.com https://github.com/rabbitmq/rabbitmq-server https://github.com/rabbitmq/rabbitmq-server/archive/refs/tags/v3.10.2.tar.gz


一、Installing RabbitMQ-3.10.2 on CentOS 7.9

1 地址

2 下载页面

Installing RabbitMQ-3.10.2 on CentOS 7.9

Installing RabbitMQ-3.10.2 on CentOS 7.9

Installing RabbitMQ-3.10.2 on CentOS 7.9

Installing RabbitMQ-3.10.2 on CentOS 7.9

 

二、下载解压 Erlang

RabbitMQ是Erlang语言编写的,安装RabbitMQ之前,需要先安装Erlang,用Erlang的源码进行安装。

1 wget 下载

cd /opt/software wget https://github.com/erlang/otp/releases/download/OTP-23.2/otp_src_23.2.tar.gz

2 解压Erlang安装文件

tar -zxvf /opt/software/otp_src_23.2.tar.gz -C /opt/ && cd /opt/otp_src_23.2 && ls

Installing RabbitMQ-3.10.2 on CentOS 7.9

 

三、安装 Erlang

1 配置安装路径

cd /opt/otp_src_23.2/ ./configure --prefix=/usr/local/erlang

2 报错 library

Installing RabbitMQ-3.10.2 on CentOS 7.9

3 安装依赖

yum install -y ncurses-devel # 接着执行 ./configure --prefix=/usr/local/erlang

4 报错 wx-config

Installing RabbitMQ-3.10.2 on CentOS 7.9

5 安装依赖

yum install -y wxWidgets-devel wxBase unixODBC-devel cd /usr/bin ln -s wx-config-3.0 wx-config # 接着执行 ./configure --prefix=/usr/local/erlang  # 安装 wxWidgets 没有找到报错 [root@localhost ~]# yum install -y wxWidgets-devel wxBase Last metadata expiration check: 0:15:37 ago on Tue 08 Nov 2022 12:36:48 PM CST. No match for argument: wxWidgets-devel No match for argument: wxBase Error: Unable to find a match: wxWidgets-devel wxBase

6 安装依赖 wxWidgets

Installing wxWidgets-3.2.1 on CentOS 8.3:https://www.cnblogs.com/huaxiayuyi/p/16868003.html

 

7 没有报错信息,执行安装命令

make && make install

Installing RabbitMQ-3.10.2 on CentOS 7.9

 

四、检验Erlang安装是否成功

ls /usr/local/erlang/bin /usr/local/erlang/bin/erl -version /usr/local/erlang/bin/erl # 退出 halt().

Installing RabbitMQ-3.10.2 on CentOS 7.9

 

五、配置Erlang环境变量

vim /etc/profile export PATH=$PATH:/usr/local/erlang/bin # 使配置文件生效 source /etc/profile

 

六、RabbitMQ下载解压

wget 下载

cd /opt/software wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.10.2/rabbitmq-server-generic-unix-3.10.2.tar.xz

 解压

tar -xvf rabbitmq-server-generic-unix-3.10.2.tar -C /opt/

进入目录

cd /opt/rabbitmq_server-3.10.2/sbin

Installing RabbitMQ-3.10.2 on CentOS 7.9

 

七、开启管理页面插件

/opt/rabbitmq_server-3.10.2/sbin/rabbitmq-plugins enable rabbitmq_management

Installing RabbitMQ-3.10.2 on CentOS 7.9

 

八、启动节点

# 在sbin目录启动命令,该命令ctrl+c后会关闭服务 /opt/rabbitmq_server-3.10.2/sbin/rabbitmq-server    # 在后台启动Rabbit /opt/rabbitmq_server-3.10.2/sbin/rabbitmq-server -detached    # 关闭服务 /opt/rabbitmq_server-3.10.2/sbin/rabbitmqctl stop    # 关闭服务(kill) 找到rabbitmq服务的pid ps -ef| grep rabbitmq kill -9 ****

 

九、启动应用

# 启动应用 /opt/rabbitmq_server-3.10.2/sbin/rabbitmqctl start_app   # 关闭整个节点(包括应用) /opt/rabbitmq_server-3.10.2/sbin/rabbitmqctl stop   # 关闭应用 /opt/rabbitmq_server-3.10.2/sbin/rabbitmqctl stop_app

 

十、查看当前账号

# 进入目录 cd /opt/rabbitmq_server-3.10.2/sbin/   # 查看当前已有用户列表 /opt/rabbitmq_server-3.10.2/sbin/rabbitmqctl start_app /opt/rabbitmq_server-3.10.2/sbin/rabbitmqctl list_users

Installing RabbitMQ-3.10.2 on CentOS 7.9

 

十一、添加管理员账号

/opt/rabbitmq_server-3.10.2/sbin/rabbitmqctl start_app   # 添加用户 #rabbitmqctl add_user Username Password /opt/rabbitmq_server-3.10.2/sbin/rabbitmqctl add_user iyuyixyz iyuyixyz   # 授予 admin 超级管理员权限 /opt/rabbitmq_server-3.10.2/sbin/rabbitmqctl set_user_tags iyuyixyz administrator  # 查看刚才添加的账号 /opt/rabbitmq_server-3.10.2/sbin/rabbitmqctl list_users  # 修改密码 /opt/rabbitmq_server-3.10.2/sbin/rabbitmqctl change_password iyuyixyz iyuyixyz  # 删除用户 /opt/rabbitmq_server-3.10.2/sbin/rabbitmqctl delete_user iyuyixyz

注意:你与此网站的连接不是私密连接的问题 重启就行了

 

十二、访问

服务器地址:15672

使用 iyuyixyz/iyuyixyz 登录即可

 Installing RabbitMQ-3.10.2 on CentOS 7.9

 

十三、配置rabbitmq环境变量

vim /etc/profile export PATH=$PATH:/opt/rabbitmq_server-3.10.2/sbin # 使配置文件生效 source /etc/profile

 

十四、防火墙放通

  • 15672:管理页面端口
  • 5672:消息队列通信端口
# 关闭防火墙 systemctl stop firewalld  firewall-cmd --zone=public --add-port=5672/tcp --permanent firewall-cmd --zone=public --add-port=15672/tcp --permanent  # 配置立即生效 firewall-cmd --reload  # 重启防火墙生效 systemctl restart firewalld

云主机配置安全组

在入方向规则,允许15672放行

 

N、报错

1 ODBC library - link check failed:安装 unixODBC

yum list|grep unixODBC   yum install unixODBC unixODBC-devel

2 No usable OpenSSL found:安装 openssl
yum install -y openssl-devel

3 No C++ compiler found:安装gcc c++ 编译器 
yum install -y gcc-c++

4 wx-config: command not found:这个库须要安装下
yum install -y wxWidgets-devel wxBase cd /usr/bin ln -s wx-config-3.0 wx-config