1、下载erlang安装包,下载rabbitmq安装包
wget https://github.com/erlang/otp/releases/download/OTP-23.1/otp_src_23.1.tar.gz
wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.8.9/rabbitmq-server-generic-unix-3.8.9.tar.xz
2、安装erlang
1、解压
tar -zxvf otp_src_23.1.tar.gz
2、安装
安装需要的相关依赖
yum -y install make gcc gcc-c++ kernel-devel m4 ncurses-devel openssl-devel unixODBC-devel libtool libtool-ltdl-devel
配置
cd otp
./configure –prefix=/usr/local/java_install/erlang –with-ssl -enable-threads -enable-smmp-support -enable-kernel-poll –enable-hipe –without-javac
编译并安装
make && make install
3、配置环境变量
vi /etc/profile
export PATH=$PATH:/usr/local/java_install/erlang/bin
source /etc/profile
4、测试是否安装成功,输入erl,如下图表示配置成功
3、安装rabbitmq
1、解压
tar xf rabbitmq-server-generic-unix-3.8.9.tar.xz
2、安装
3、配置环境变量
vi /etc/profile
export PATH=$PATH:/usr/local/java_install/rabbitmq_server-3.8.9/sbin
source /etc/profile
4、启动
rabbitmq-server start
在sbin目录下启动
./rabbitmq-server
./rabbitmq-server-detached
5、关闭,查看状态
rabbitmqctl stop
rabbitmqctl status
4、安装插件
1、安装web管理界面插件
rabbitmq-plugins enable rabbitmq_management
重新启动,浏览器输入ip:15672访问,默认账号:guest,密码:guest
登录时提示:User can only log in via localhost
解决方法:
添加账号并设置密码
rabbitmqctl add_user admin admin
给账号授予administrator角色
rabbitmqctl set_user_tags admin administrator
设置 admin 用户的权限,指定允许访问的vhost
rabbitmqctl set_permissions -p “/” admin “.*” “.*” “.*”
2、安装mqtt插件
rabbitmq-plugins enable rabbitmq_mqtt
3、安装stomp插件
rabbitmq-plugins enable rabbitmq_web_stomp rabbitmq_web_stomp_examples
看到下图,表示插件安装成功
切记,安装完成插件需要重启才能生效