操作系统CentOS 7.4 64bit,以下操作需要root权限。
安装包下载:
wget https://dl.bintray.com/rabbitmq/all/rabbitmq-server/3.7.7/rabbitmq-server-3.7.7-1.el7.noarch.rpm
尝试用rpm包,安装
rpm -ivh rabbitmq-server-3.7.7-1.el7.noarch.rpm
需要以下的依赖
warning: rabbitmq-server-3.7.7-1.el7.noarch.rpm: Header V4 RSA/SHA1 Signature, key ID 6026dfca: NOKEY
error: Failed dependencies:
erlang >= 19.3 is needed by rabbitmq-server-3.7.7-1.el6.noarch
socat is needed by rabbitmq-server-3.7.7-1.el6.noarch
安装依赖
yum -y install socat
yum -y install erlang
erlang 就别安装了,yum的版本是Erlang R16B03-1
erl 编译安装下载
wget http://erlang.org/download/otp_src_21.0.tar.gz
先安装相关的依赖
yum -y install make gcc gcc-c++ m4 ncurses-devel openssl-devel
./configure --prefix=/usr/ --with-ssl --enable-threads --enable-smp-support --enable-kernel-poll --enable-hipe --without-javac
make && make install
安装rabbitmq-server,虽然已经安装了依赖,但是使用编译方式。所以要开启--nodeps进行编译。
rpm -ivh rabbitmq-server-3.7.7-1.el6.noarch.rpm
运行rabbitmq-server之前先,把对应的端口打开,否则启动仍然有可能失败
-A INPUT -p tcp -m tcp --dport 1883 -m state --state NEW,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m tcp --dport 4369 -m state --state NEW,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m tcp --dport 5671 -m state --state NEW,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m tcp --dport 5672 -m state --state NEW,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m tcp --dport 8100 -m state --state NEW,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m tcp --dport 8883 -m state --state NEW,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m tcp --dport 15672 -m state --state NEW,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m tcp --dport 25672 -m state --state NEW,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m tcp --dport 61613 -m state --state NEW,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m tcp --dport 61614 -m state --state NEW,ESTABLISHED -j ACCEPT
最后运行rabbitmq-server
启动rabberMQ
rabbitmq-server -detached
开启页面管理插件
rabbitmq-plugins enable rabbitmq_management
创建web访问账户(user1)
rabbitmqctl add_user user1 passwd1
user1增加管理员权限
rabbitmqctl set_user_tags user1 administrator
页面访问地址
http://ip:15672
网友评论