1. 要想安装rabbitmq,要先安装erlang
到http://erlang.org/download/下载安装包,如执行命令
# wget 'http://erlang.org/download/otp_src_20.1.tar.gz'
2. 安装erlang编译所依赖的环境,安装过的就不必再安装了
# yum install gcc gcc-c++ glibc-devel make ncurses-devel openssl-devel autoconf git
注: 如果不确定哪个安装过了那个没安装,可以运行如下命令进行排查:
# yum list installed | egrep 'gcc|gcc-c++|glibc-devel|make|ncurses-devel|openssl-devel|kernel-devel |autoconf|git '
3. 将按照包放到要安装的位置,执行命令
# chmod +x otp_src_20.1.tar.gz
# tar –zxvf otp_src_20.1.tar.gz
# cd otp_src_20.1
# ./otp_build autoconf
# ./configure && make && sudo make install
4. 验证是否安装正确
# whereis erl
5. 然后开始安装rabbitmq
# wget 'http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.12/rabbitmq-server-3.6.12-1.el7.noarch.rpm'
# rpm -ivh --nodeps rabbitmq-server-3.6.12-1.el7.noarch.rpm
6. 正常情况下RabbitMQ已经安装完成,最后启动一下
# systemctl start rabbitmq-server.service
7. 查看启动状态
# systemctl status rabbitmq-server.service
8. 添加开机启动
# systemctl enable rabbitmq-server.service
9. 添加管理用户并开启rabbitmq的web管理界面
# rabbitmqctl add_user admin admin
# rabbitmqctl set_user_tags admin administrator
# rabbitmqctl set_permissions -p / admin '.*' '.*' '.*'
# rabbitmq-plugins enable rabbitmq_management
访问http://ip:15672
登录账号密码:admin/admin
网友评论