Centos 6.5 下安装RabbitMQ-3.7.28 二进制版本
点此 直接进入 Erlang + rabbitmq 下载地址
## 安装依赖:
yum install -y ncurses-devel socat logrotatewxWidgets-devel wxBase fop.noarch gcc glibc-devel xmlto perl openssl openssl-devel xz wget make
## 安装Erlang-21.3
### 下载并安装Erlang-21.3:
wget http://erlang.org/download/otp_src_21.3.tar.gz
tar -zxf otp_src_21.3.tar.gz
cd otp_src_21.3
./configure --prefix=/data/soft/erlang --with-ssl --enable-threads --enable-smp-support --enable-sctp --enable-kernel-poll --enable-hipe
make -j 4 && make install
### 添加环境变量:
vim /etc/profile
export PATH=/data/soft/erlang/:/data/soft/erlang/bin:$PATH
source /etc/profile
### 查看版本是否正确:
[root@bj-dev-db ~]# erl -version
Erlang (SMP,ASYNC_THREADS,HIPE) (BEAM) emulator version 10.3
[root@bj-dev-db ~]# erl -v
Erlang/OTP 21 [erts-10.3] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]
......
## 安装启动 rabbitmq-server-generic-unix-3.7.28.tar.xz
## 安装 rabbitmq-server-generic-unix-3.7.28.tar.xz
cd /data/src/
wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.7.28/rabbitmq-server-generic-unix-3.7.28.tar.xz
xz -d rabbitmq-server-generic-unix-3.7.28.tar.xz
tar -xvf rabbitmq-server-generic-unix-3.7.28.tar
cp -rf rabbitmq_server-3.7.28 /data/soft/rabbitmq
### 环境变量:
vim /etc/profile
#set rabbitmq environment
export RABBITMQ_HOME=/data/soft/rabbitmq
export PATH=$PATH:/data/soft/rabbitmq/sbin
source /etc/profile
### 打开guest用户:
cd /data/soft/rabbitmq/rabbitmq/ebin/
vim rabbit.app
找到:{loopback_users, [<<"guest">>]},
改成:{loopback_users, [guest]},
保存退出.
### 启动rabbitmq-server:
cd ../sbin/
./rabbitmq-server -detached # 启动rabbitmq
netstat -tnlp|grep 5672 # 查看端口是否占用
rabbitmqctl status # 查看状态
/data/soft/rabbitmq/sbin/rabbitmq-server -detached # 添加开机启动命令
### 设置rabbitmq-server 用户和权限:
./rabbitmq-plugins enable rabbitmq_management # 打开web管理功能
./rabbitmqctl add_user admin 123456 # 添加admin 用户并设置密码123456
./rabbitmqctl set_permissions -p "/" admin ".*" ".*" ".*" # 设置admin 的权限
./rabbitmqctl set_user_tags admin administrator # 赋予admin 用户administrator身份
./rabbitmqctl change_password admin 123456 # 给admin 用户更改密码
./rabbitmqctl change_password guest 123456 # 给guest 用户更改密码
http://IP:15672 # 访问Web管理界面, 用户名密码上面已设置.
### 打开Mqtt插件支持:
./rabbitmq-plugins enable rabbitmq_mqtt
### 安装并开启 rabbitmq_delayed_message_exchange 插件:
wget https://dl.bintray.com/rabbitmq/community-plugins/3.7.x/rabbitmq_delayed_message_exchange/rabbitmq_delayed_message_exchange-20171201-3.7.x.zip
unzip rabbitmq_delayed_message_exchange-20171201-3.7.x.zip
cp rabbitmq_delayed_message_exchange-20171201-3.7.x.ez /data/soft/rabbitmq/plugs/
rabbitmq-plugins enable rabbitmq_delayed_message_exchange
### 端口介绍:
5672 # 通信端口
15672 # web 管理端口
25672 # cluster 通信端口