官网安装指导:
http://www.rabbitmq.com/install-rpm.html
一、使用yum安装rabbitmq
1、更新已安装的epel:(可参照:http://fedoraproject.org/wiki/EPEL/FAQ#howtouse)
- # wget -O /etc/yum.repos.d/epel-erlang.repo http://repos.fedorapeople.org/repos/peter/erlang/epel-erlang.repo
或者:(首选):
- 32位系统:
- rpm -Uvh http://mirrors.hustunique.com/epel/6/i386/epel-release-6-8.noarch.rpm
- CentOS6.x 64-bit(x64):
- 64位系统
- rpm -Uvh http://mirrors.hustunique.com/epel/6/x86_64/epel-release-6-8.noarch.rpm
*报错:GPG key retrieval failed: [Errno 14] Could not open/read file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
解决办法:
- rpm -Uvh http://mirrors.hustunique.com/epel/6/x86_64/epel-release-6-8.noarch.rpm
*报错:Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again
解决办法:
修改文件“/etc/yum.repos.d/epel.repo”, 将baseurl的注释取消, mirrorlist注释掉,即可。
*报错:rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
解决办法:rpm --import /etc/pki/rpm-gpg/RPM*(不太可靠)
2、安装erlang和rabbitmq-server
yum install erlang rabbitmq-server
或者:
#yum install erlang
rpm --import http://www.rabbitmq.com/rabbitmq-signing-key-public.asc
#yum install rabbitmq-server
如果在执行
#yum install erlang
报错:
- [root@localhost source]# yum install erlang
- Loaded plugins: fastestmirror, security
- Loading mirror speeds from cached hostfile
- * base: mirror.neu.edu.cn
- * extras: mirror.neu.edu.cn
- * updates: mirror.neu.edu.cn
- http://repos.fedorapeople.org/repos/peter/erlang/epel-6/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
- Trying other mirror.
- Setting up Install Process
- No package erlang available.
- Error: Nothing to do
解决办法:
cd /etc/yum.repos.d/ 看是否有epel.repo和epel-testing.repo
- -rw-r--r-- 1 root root 745 Dec 29 15:23 epel-erlang.repo
- -rw-r--r-- 1 root root 957 Dec 30 09:30 epel.repo
- -rw-r--r-- 1 root root 1056 Dec 30 09:30 epel-testing.repo
如果没有,可以从别的地方复制过来,或者创建文件并放入如下内容:
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
- failovermethod=priority
- enabled=1
- gpgcheck=1
- gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
- [epel-debuginfo]
- name=Extra Packages for Enterprise Linux 6 - $basearch - Debug
- #baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch/debug
- mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch=$basearch
- failovermethod=priority
- enabled=0
- gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
- gpgcheck=1
- [epel-source]
- name=Extra Packages for Enterprise Linux 6 - $basearch - Source
- #baseurl=http://download.fedoraproject.org/pub/epel/6/SRPMS
- mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-6&arch=$basearch
- failovermethod=priority
- enabled=0
- gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
- gpgcheck=1
epel-testing.repo内容:
- epel-testing]
- name=Extra Packages for Enterprise Linux 6 - Testing - $basearch
- #baseurl=http://download.fedoraproject.org/pub/epel/testing/6/$basearch
- mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=testing-epel6&arch=$basearch
- failovermethod=priority
- enabled=0
- gpgcheck=1
- gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
- [epel-testing-debuginfo]
- name=Extra Packages for Enterprise Linux 6 - Testing - $basearch - Debug
- #baseurl=http://download.fedoraproject.org/pub/epel/testing/6/$basearch/debug
- mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=testing-debug-epel6&arch=$basearch
- failovermethod=priority
- enabled=0
- gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
- gpgcheck=1
- [epel-testing-source]
- name=Extra Packages for Enterprise Linux 6 - Testing - $basearch - Source
- #baseurl=http://download.fedoraproject.org/pub/epel/testing/6/SRPMS
- mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=testing-source-epel6&arch=$basearch
- failovermethod=priority
- enabled=0
- gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
- gpgcheck=1
3、启动rabbitmq-server:
#service rabbitmq-server
如果启动时报错:ERROR: epmd error for host "yourhostname": timeout (timed out),原因是:主机名和ip不匹配了,需要更改hostname或者/etc/hosts文件
eg:修改主机名:#hostname yourhostname 要跟/etc/hosts文件中一致。
4、安装 rabbitmq_management 管理插件:
# mkdir /etc/rabbitmq/
在有rabbitmq-plugins命令的前提下:
# rabbitmq-plugins enable rabbitmq_management
在没有rabbitmq-plugins命令时:
#cd /usr/lib/rabbitmq/bin/ 下执行:
#./rabbitmq-plugins enable rabbitmq_management
5、重启rabbitmq-server:
#service rabbitmq-server restart
关闭防火墙:#service iptables stop
6、登录:
默认地址:http://192.168.0.xxx:15672/#/
默认用户名:guest
默认密码:guest
今天在测试环境使用yum安装,遇到一个问题:
Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again
处理很简单,修改文件“/etc/yum.repos.d/epel.repo”, 将baseurl的注释取消, mirrorlist注释掉。即可。