3月 012020
 

查看系统环境

[root@ip-172-31-39-22 ~]# cat /etc/redhat-release 
CentOS Linux release 7.6.1810 (Core) 
[root@ip-172-31-39-22 ~]# rpm -qa |wc -l
304
[root@ip-172-31-39-22 ~]#

安装Erlang运行环境

https://www.erlang-solutions.com/resources/download.html

安装YUM源配置文件并导入签名

[root@ip-172-31-39-22 ~]# yum -y install https://packages.erlang-solutions.com/erlang-solutions-2.0-1.noarch.rpm
[root@ip-172-31-39-22 ~]# rpm --import https://packages.erlang-solutions.com/rpm/erlang_solutions.asc

查看已安装的YUM源配置文件

[root@ip-172-31-39-22 ~]# cat /etc/yum.repos.d/erlang_solutions.repo 
[erlang-solutions]
name=Centos $releasever - $basearch - Erlang Solutions
baseurl=http://packages.erlang-solutions.com/rpm/centos/$releasever/$basearch
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg//erlang_solutions.asc
enabled=1
[root@ip-172-31-39-22 ~]#

查看Erlang版本信息(当前最新版本)

[root@ip-172-31-39-22 ~]# yum info erlang
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: d36uatko69830t.cloudfront.net
 * extras: d36uatko69830t.cloudfront.net
 * updates: d36uatko69830t.cloudfront.net
Available Packages
Name        : erlang
Arch        : x86_64
Version     : 22.2.7
Release     : 1.el7
Size        : 21 k
Repo        : erlang-solutions/7/x86_64
Summary     : General-purpose programming language and runtime environment
URL         : http://www.erlang.org
License     : ERPL
Description : Erlang is a general-purpose programming language and runtime
            : environment. Erlang has built-in support for concurrency, distribution
            : and fault tolerance. Erlang is used in several large telecommunication
            : systems from Ericsson.

[root@ip-172-31-39-22 ~]# 

安装EPEL源

[root@ip-172-31-39-22 ~]# yum -y install epel-release

登录Erlang控制台以确认可用性

[root@ip-172-31-39-22 ~]# erl
Erlang/OTP 22 [erts-10.6.4] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [hipe]

Eshell V10.6.4 (abort with ^G)
1> halt().
[root@ip-172-31-39-22 ~]#

安装RabbitMQ服务

https://www.rabbitmq.com/install-rpm.html

使用RMP包安装YUM源

curl -s https://packagecloud.io/install/repositories/rabbitmq/rabbitmq-server/script.rpm.sh | sudo bash

查看YUM源配置文件

[root@ip-172-31-39-22 ~]# cat /etc/yum.repos.d/rabbitmq_rabbitmq-server.repo 
[rabbitmq_rabbitmq-server]
name=rabbitmq_rabbitmq-server
baseurl=https://packagecloud.io/rabbitmq/rabbitmq-server/el/7/$basearch
repo_gpgcheck=1
gpgcheck=0
enabled=1
gpgkey=https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300

[rabbitmq_rabbitmq-server-source]
name=rabbitmq_rabbitmq-server-source
baseurl=https://packagecloud.io/rabbitmq/rabbitmq-server/el/7/SRPMS
repo_gpgcheck=1
gpgcheck=0
enabled=1
gpgkey=https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
[root@ip-172-31-39-22 ~]#

查看当前RabbitMQ版本信息

[root@ip-172-31-39-22 ~]# yum info rabbitmq-server
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: d36uatko69830t.cloudfront.net
 * extras: d36uatko69830t.cloudfront.net
 * updates: d36uatko69830t.cloudfront.net
Available Packages
Name        : rabbitmq-server
Arch        : noarch
Version     : 3.8.2
Release     : 1.el7
Size        : 12 M
Repo        : rabbitmq_rabbitmq-server/x86_64
Summary     : The RabbitMQ server
URL         : https://www.rabbitmq.com/
License     : MPLv1.1 and MIT and ASL 2.0 and BSD
Description : RabbitMQ is an open source multi-protocol messaging broker.

[root@ip-172-31-39-22 ~]#

安装RabbitMQ服务

[root@ip-172-31-39-22 ~]# yum -y install rabbitmq-server

注册并启动服务

[root@ip-172-31-39-22 ~]# rpm -lq rabbitmq-server|less
[root@ip-172-31-39-22 ~]# systemctl enable rabbitmq-server
Created symlink from /etc/systemd/system/multi-user.target.wants/rabbitmq-server.service to /usr/lib/systemd/system/rabbitmq-server.service.
[root@ip-172-31-39-22 ~]# systemctl start rabbitmq-server
[root@ip-172-31-39-22 ~]#

查看端口监听

[root@ip-172-31-39-22 ~]# netstat -lnt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 0.0.0.0:25672           0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:4369            0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN     
tcp6       0      0 :::5672                 :::*                    LISTEN     
tcp6       0      0 :::111                  :::*                    LISTEN     
tcp6       0      0 :::4369                 :::*                    LISTEN     
tcp6       0      0 :::22                   :::*                    LISTEN     
tcp6       0      0 ::1:25                  :::*                    LISTEN     
[root@ip-172-31-39-22 ~]#

启动管理插件

[root@ip-172-31-39-22 ~]# rabbitmq-plugins enable rabbitmq_management
Enabling plugins on node rabbit@ip-172-31-39-22:
rabbitmq_management
The following plugins have been configured:
  rabbitmq_management
  rabbitmq_management_agent
  rabbitmq_web_dispatch
Applying plugin configuration to rabbit@ip-172-31-39-22...
The following plugins have been enabled:
  rabbitmq_management
  rabbitmq_management_agent
  rabbitmq_web_dispatch

started 3 plugins.
[root@ip-172-31-39-22 ~]#

查看端口监听

[root@ip-172-31-39-22 ~]# netstat -lnt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 0.0.0.0:25672           0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:4369            0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:15672           0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN     
tcp6       0      0 :::5672                 :::*                    LISTEN     
tcp6       0      0 :::111                  :::*                    LISTEN     
tcp6       0      0 :::4369                 :::*                    LISTEN     
tcp6       0      0 :::22                   :::*                    LISTEN     
tcp6       0      0 ::1:25                  :::*                    LISTEN     
[root@ip-172-31-39-22 ~]#

使用浏览器访问Web控制台

默认账户信息(仅支持从本机登录)

Username:guest
Password:guest

使用命令行添加具有最高权限的管理用户

[root@ip-172-31-39-22 ~]# rabbitmqctl add_user admin 123465
Adding user "admin" ...
[root@ip-172-31-39-22 ~]# rabbitmqctl set_user_tags admin administrator
Setting tags for user "admin" to [administrator] ...
[root@ip-172-31-39-22 ~]#

登录Web控制台

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据