RabbitMQ的简易安装
前一篇博文的RabbitMQ安装有点复杂,经过搜索发现简单的安装方式如下。
1.Erlang Yum Repos 基于 SSL 高版本包含插件
rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
wget -O /etc/yum.repos.d/epel-erlang.repo http://repos.fedorapeople.org/repos/peter/erlang/epel-erlang.repo
基于Centos 安装 EPEL-6 yum repo 包含 Erlang R14B
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
2.安装Erlang
yum install erlang
3.RPM安装 RabbitMQ
rpm --import http://www.rabbitmq.com/rabbitmq-signing-key-public.asc
rpm -Uvh http://www.rabbitmq.com/releases/rabbitmq-server/v3.1.4/rabbitmq-server-3.1.4-1.noarch.rpm
4.配置 RabbitMQ SSL
git clone git://github.com/joemiller/joemiller.me-intro-to-sensu.git
cd joemiller.me-intro-to-sensu/
./ssl_certs.sh clean
./ssl_certs.sh generate
配置 RabbitMQ 启用ssl证书
mkdir /etc/rabbitmq/ssl
cp server_key.pem /etc/rabbitmq/ssl/
cp server_cert.pem /etc/rabbitmq/ssl/
cp testca/cacert.pem /etc/rabbitmq/ssl/
创建 配置文件 /etc/rabbitmq/rabbitmq.config
[
{rabbit, [
{ssl_listeners, [5671]},
{ssl_options, [{cacertfile,"/etc/rabbitmq/ssl/cacert.pem"},
{certfile,"/etc/rabbitmq/ssl/server_cert.pem"},
{keyfile,"/etc/rabbitmq/ssl/server_key.pem"},
{verify,verify_peer},
{fail_if_no_peer_cert,true}]}
]}
].
5 启用 rabbitmq_management
rabbitmq-plugins enable rabbitmq_management
6 启动RabbitMQ
/sbin/chkconfig rabbitmq-server on
/etc/init.d/rabbitmq-server start