安装前先更新rabbitmq的专用源

echo 'deb http://www.rabbitmq.com/debian/ testing main' |     sudo tee /etc/apt/sources.list.d/rabbitmq.list
wget -O- https://www.rabbitmq.com/rabbitmq-release-signing-key.asc |     sudo apt-key add -
sudo apt-get update

sudo apt-get install rabbitmq-server

安装mqtt和websocket-mqtt

sudo rabbitmq-plugins enable rabbitmq_web_mqtt
sudo rabbitmq-plugins enable rabbitmq_mqtt
sudo rabbitmq-plugins enable rabbitmq_manager

访问http://127.0.0.1:15672/#/, 使用guest/guest登录, 可以GUI形式查看.

guest是默认用户, 默认只能从127.0.0.1上登录. 开放任意登录, 在/etc/rabbitmq/下新建rabbitmq.config文件. 这个文件据说是标准的erlang config形式文件. 形式如下:

[{Application1, [{Par11, Val11}, ...]},
 ...
 {ApplicationN, [{ParN1, ValN1}, ...]}].

只是开放guest登录权限, rabbitmq.config文件如下:

[
  {
        rabbit, [{loopback_users, []}]
  }
].

之后重启服务即可.
sudo service rabbitmq-server restart

标签: none 阅读量: 1262

添加新评论