RabbitMQ-Server:3.5.1
一、安装erlang
cd /car/local下 mkdir rabbitmq包
cd rabbitmq
1.安装准备,下载安装文件
wget https://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm
rpm -Uvh erlang-solutions-1.0-1.noarch.rpm
修改primary.xml.gz的sha的加密值
cd /var/cache/yum/x86_64/6/erlang-solutions
sha1sum primary.xml.gz
vim repomd.xml
修改
<data type="primary">
<checksum type="sha">结果为sha1sum命令结果</checksum>
2.安装erlang
yum install erlang
运行yum install erlang报错Error: Cannot retrieve metalink for repository:
epel. Please verify its path and try again
解决办法是编辑/etc/yum.repos.d/epel.repo
打开/etc/yum.repos.d/epel.repo,将
[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
修改为
[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
修改DNS,到/etc/resolv.conf下添加一下:
nameserver 8.8.8.8
search localdomain
然后重启network服务:service network restart
3.安装完成后可以用erl命令查看是否安装成功
erl -version
二、安装RabbitMQ Server
1.安装准备,下载RabbitMQ Server
wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.5.1/rabbitmq-server-3.5.1-1.noarch.rpm
2.安装RabbitMQ Server
rpm --import http://www.rabbitmq.com/rabbitmq-signing-key-public.asc
yum install rabbitmq-server-3.5.1-1.noarch.rpm
三、启动RabbitMQ
1.配置为守护进程随系统自动启动,root权限下执行:
chkconfig rabbitmq-server on
2.启动rabbitMQ服务
/sbin/service rabbitmq-server start
四、安装Web管理界面插件
1.安装命令
rabbitmq-plugins enable rabbitmq_management
2.安装成功后会显示如下内容
The following plugins have been enabled:
mochiweb
webmachine
rabbitmq_web_dispatch
amqp_client
rabbitmq_management_agent
rabbitmq_management
Plugin configuration has changed. Restart RabbitMQ for changes to take effect.
五、设置RabbitMQ远程ip登录
这里我们以创建个oldlu帐号,密码123456为例,创建一个账号并支持远程ip访问。
1.创建账号
rabbitmqctl add_user root 900627
2.设置用户角色
rabbitmqctl set_user_tags root administrator
3.设置用户权限
rabbitmqctl set_permissions -p "/" root ".*" ".*" ".*"
4.设置完成后可以查看当前用户和角色(需要开启服务)
rabbitmqctl list_users
浏览器输入:serverip:15672。其中serverip是RabbitMQ-Server所在主机的ip。
实践:安装过程中遇到Y/N,选Y,其中网不能中断,在rabbitmq包下执行了 yum install erlang,在catch包下就不用继续yum install erlang,通过erl -version查到版本证明安装成功。