淘先锋技术网

首页 1 2 3 4 5 6 7
1:前置环境安装
yum install unixODBC-devel
yum install openssl-devel
yum install gcc-c++

2:erlang安装

wget http://www.rabbitmq.com/releases/erlang/erlang-18.1-1.el6.x86_64.rpm

yum -y localinstall erlang-18.1-1.el6.x86_64.rpm


3:rq安装

wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.5.4/rabbitmq-server-generic-unix-3.5.4.tar.gz

tar zxf rabbitmq-server-generic-unix-3.5.4.tar.gz

mv rabbitmq_server-3.5.4/ /data/software/

ln -s /data/software/rabbitmq_server-3.5.4/ /usr/local/rabbitmq

cd /usr/local/rabbitmq/

cp etc/rabbitmq/rabbitmq.config.example  etc/rabbitmq/rabbitmq.config

ln -s /usr/local/rabbitmq/etc/rabbitmq/ /etc/

ln -s /usr/local/rabbitmq/var/log/rabbitmq/ /var/log/

echo '[ -d /usr/local/rabbitmq/sbin ] && export PATH="/usr/local/rabbitmq/sbin:$PATH"' >> /etc/profile

source /etc/profile


4:配置

①配置hosts

如果是集群,则每个机器的hosts都要保持一致

②配置文件

echo "[rabbitmq_management]." > /etc/rabbitmq/enabled_plugins
echo "[{rabbit, [{loopback_users, []}]}]." > /etc/rabbitmq/rabbitmq.config
echo "RABBITMQ_NODE_IP_ADDRESS=10.66.66.66" >  /etc/rabbitmq/rabbitmq-env.conf

(其中10.66.66.66替换成你的ip即可)


5:修改.erlang.cookie

如果是集群,则几台机器的的cookie值是一样的

位置:

/root/.erlang.cookie

或者是

/var/lib/rabbitmq/.erlang.cookie


6:界面查看

执行命令

rabbitmq-plugins enable rabbitmq_management

启动服务

rabbitmq-server -detached

防火墙相关操作

sudo iptables -I INPUT -p tcp -m tcp --dport 15672 -j ACCEPT

sudo iptables -I INPUT -p tcp -m tcp --dport 5672 -j ACCEPT

sudo service iptables save

sudo service iptables restart

访问

浏览器输入

http://10.66.66.66:15672,之后进入到登录界面,用户名和密码都是guest