centos6.8安装RabbitMQ3.7.3

一. 安装wx

安装依赖插件

[root@iZ2zejbqrpwrmr4mjy0u9fZ wxWidgets-3.0.3]# yum -y install make gcc gcc-c++ kernel-devel m4 ncurses-devel openssl-devel unixODBC-devel

yum install bzip2 -y
yum -y install gtk2-devel binutils-devel
yum install libSM-devel
yum list pkgconfig
yum install  gtk+extra
yum install mesa-libGL-devel
yum install mesa-libGLU-devel

wget -c https://github.com/wxWidgets/wxWidgets/releases/download/v3.0.3/wxWidgets-3.0.3.tar.bz2
bzip2 -d wxWidgets-3.0.3.tar.bz2
tar -xvf wxWidgets-3.0.3.tar -C /usr/local/
cd wxWidgets-3.0.3
./configure

  Which GUI toolkit should wxWidgets use?                 GTK+ 2 with support for GTK+ printing libnotify
  Should wxWidgets be compiled into single library?       no
  Should wxWidgets be linked as a shared library?         yes
  Should wxWidgets support Unicode?                       yes (using wchar_t)
  What level of wxWidgets compatibility should be enabled?
                                       wxWidgets 2.6      no
                                       wxWidgets 2.8      yes
  Which libraries should wxWidgets use?
                                       STL                no
                                       jpeg               builtin
                                       png                sys
                                       regex              builtin
                                       tiff               builtin
                                       zlib               sys
                                       expat              builtin
                                       libmspack          no
                                       sdl                no

二.安装erlang 语言环境:

下载erlang http://erlang.org/download/

安装依赖插件

[root@iZ2zejbqrpwrmr4mjy0u9fZ opt]#yum -y install gcc glibc-devel make ncurses-devel openssl-devel xmlto perl wget

这里我们使用的是:otp_src_20.2.tar.gz

[root@iZ2zejbqrpwrmr4mjy0u9fZ opt]# tar -zxvf otp_src_20.2.tar.gz -C /usr/local/

[root@iZ2zejbqrpwrmr4mjy0u9fZ opt]# cd /usr/local/otp_src_20.2/

[root@iZ2zejbqrpwrmr4mjy0u9fZ otp_src_20.2]# ./configure --prefix=/usr/local/erlang

*********************************************************************
**********************  APPLICATIONS DISABLED  **********************
*********************************************************************
jinterface     : No Java compiler found
odbc           : ODBC library - link check failed
orber          : No C++ compiler found
*********************************************************************
*********************************************************************
**********************  APPLICATIONS INFORMATION  *******************
*********************************************************************
*********************************************************************
*********************************************************************
**********************  DOCUMENTATION INFORMATION  ******************
*********************************************************************
documentation  : 
                 fop is missing.
                 Using fakefop to generate placeholder PDF files.

[root@iZ2zejbqrpwrmr4mjy0u9fZ otp_src_20.2]# make && make install

测试一下是否安装成功,在控制台输入命令erl

erl  //如果进入erlang的shell则证明安装成功,退出即可。

安装rabbitmq

下载链接https://github.com/rabbitmq/rabbitmq-server/releases

这里我们使用的是rabbitmq-server-generic-unix-3.7.3.tar

[root@iZ2zejbqrpwrmr4mjy0u9fZ opt]# wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.7.3/rabbitmq-server-generic-unix-3.7.3.tar.xz
[root@iZ2zejbqrpwrmr4mjy0u9fZ opt]# xz -d rabbitmq-server-generic-unix-3.7.3.tar.xz 
[root@iZ2zejbqrpwrmr4mjy0u9fZ local]# mv rabbitmq_server  rabbitmq

配置erl rabbitmq环境变量

[root@iZ2zejbqrpwrmr4mjy0u9fZ ~]# vim /etc/profile  //在底部添加以下内容
#set rabbitmq environment
export export PATH=$PATH:/usr/local/rabbitmq/sbin
#set erlang environment
ERL_HOME=/usr/local/erlang
PATH=$ERL_HOME/bin:$PATH
export ERL_HOME PATH
[root@iZ2zejbqrpwrmr4mjy0u9fZ ~]# source  /etc/profile   

rabbitmq常用命令

启动服务:rabbitmq-server -detached【 /usr/local/rabbitmq/sbin/rabbitmq-server  -detached 】

查看状态:rabbitmqctl status【 /usr/local/rabbitmq/sbin/rabbitmqctl status  】

关闭服务:rabbitmqctl stop【 /usr/local/rabbitmq/sbin/rabbitmqctl stop  】

列出角色:rabbitmqctl list_users

配置网页插件

首先创建目录,否则可能报错:

[root@iZ2zejbqrpwrmr4mjy0u9fZ ~]# mkdir /etc/rabbitmq

然后启用插件:

[root@iZ2zejbqrpwrmr4mjy0u9fZ ~]# rabbitmq-plugins enable rabbitmq_management

在浏览器输入查看网页状态

http://60.205.226.102:15672/
可以正常打开

配置访问账号密码和权限:

默认网页是不允许访问的,需要增加一个用户修改一下权限,代码如下:

rabbitmqctl add_user superrd superrd  //添加用户,后面两个参数分别是用户名和密码,我这都用superrd了。
rabbitmqctl set_permissions -p / superrd "." "." ".*"  //添加权限
rabbitmqctl set_user_tags superrd administrator  //修改用户角色

打开可以正常访问 说明rabbitmq 已经正常部署完毕。