install rabbitMQ

[RabbitMQ 安装和使用]

4369 (epmd), 25672 (Erlang distribution)

5672, 5671 (AMQP 0-9-1 without and with TLS)

15672 (if management plugin is enabled)

61613, 61614 (if STOMP is enabled)

1883, 8883 (if MQTT is enabled)

   

[安装 erlang]

安装依赖环境

yum -y install make gcc gcc-c++ kernel-devel m4 ncurses-devel openssl-devel unixODBC-devel

   

下载最新 Erlang 20.1

wget http://erlang.org/download/otp_src_20.1.tar.gz

解压

tar -xvzf otp_src_20.1.tar.gz

配置

./configure --prefix=/usr/local/erlang --with-ssl -enable-threads -enable-smmp-support -enable-kernel-poll --enable-hipe --without-javac

make

make install

配置profile

ERLANG_HOME=/usr/local/erlang

PATH=$PATH:$JAVA_HOME/bin:$ERLANG_HOME/bin

source /etc/profile

检验erl

[root@iZ25sabz8p5Z sbin]# erl

Erlang/OTP 19 [erts-8.0] [source] [64-bit] [async-threads:10] [hipe] [kernel-poll:false]

   

[安装 rabbitmq]

cd /usr/local/ (重要)

wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.3/rabbitmq-server-generic-unix-3.7.2.tar.xz

xz -d rabbitmq-server-generic-unix-3.7.2.tar.xz

tar -xvf rabbitmq-server-generic-unix-3.6.3.tar

cd ./rabbitmq_server-3.6.3

cd sbin/

启用web管理界面

./rabbitmq-plugins enable rabbitmq_management

   

启动

./rabbitmq-server -detached

添加用户

./rabbitmqctl add_user admin 123456

设置权限

./rabbitmqctl set_user_tags admin administrator
 

浏览器访问

http://192.168.1.233:15672/

   

install rabbitMQ_第1张图片

  

   

[rabbitMQ 问题]

Caused by: com.rabbitmq.client.ShutdownSignalException: connection error; protocol method: #method(reply-code=530, reply-text=NOT_ALLOWED - access to vhost '/' refused for user 'mq', class-id=10, method-id=40)


列出用户权限

[rabbitmq@redis sbin]$ rabbitmqctl list_users

Listing users ...

admin        [administrator]

guest        [administrator]

[rabbitmq@redis sbin]$

   

[rabbitmq@redis sbin]$ rabbitmqctl set_permissions -p / admin '.*' '.*' '.*'

Setting permissions for user "admin" in vhost "/" ...

该命令使用户mq具有'/'这个virtual host中所有资源的配置、写、读权限以便管理其中的资源

  

   

   

   

   

[Author Information 作者信息]

github: https://github.com/MiniPa

website: https://minipachengjs.wordpress.com/

csdn: http://blog.csdn.net/snsmbnsr?ref=toolbar

email: [email protected]

===============================================================================

   

你可能感兴趣的:(install rabbitMQ)