rabbitmq的安裝依賴erlang,首先應該先安裝erlang,而後安裝rabbitmq;html
erlang-rpm安裝教程
選擇在Centos7 上安裝:
git
To use Erlang 20.x on CentOS 7:github
# In /etc/yum.repos.d/rabbitmq-erlang.repo [rabbitmq-erlang] name=rabbitmq-erlang baseurl=https://dl.bintray.com/rabbitmq/rpm/erlang/20/el/7 gpgcheck=1 gpgkey=https://www.rabbitmq.com/rabbitmq-release-signing-key.asc repo_gpgcheck=0 enabled=1
而後執行:web
yum install erlang
參考連接
centos
wget https://github.com/rabbitmq/rabbitmq-server/releases/download/rabbitmq_v3_6_12/rabbitmq-server-3.6.12-1.el7.noarch.rpm
rpm --import https://www.rabbitmq.com/rabbitmq-release-signing-key.asc yum install rabbitmq-server-3.6.12-1.el7.noarch.rpm
chkconfig rabbitmq-server on /sbin/service rabbitmq-server stop/start/
開啓Web管理插件瀏覽器
rabbitmq-plugins enable rabbitmq_management output: The following plugins have been enabled: mochiweb webmachine rabbitmq_web_dispatch amqp_client rabbitmq_management_agent rabbitmq_management Applying plugin configuration to rabbit@PC-201602152056... started 6 plugins.
瀏覽器訪問:
http://localhost:15672
,
默認用戶名和密碼: guest/guest;
須要注意的是:guest用戶僅僅提供localhost做爲ip登陸;
若是遠程登陸,如:http://192.168.35.129:15672/
, 則會提示錯誤,登陸不了:app
# 以下是日誌輸出 =WARNING REPORT==== 21-Oct-2017::23:31:33 === HTTP access denied: user 'guest' - User can only log in via localhost
訪問控制可參考:
Access Control (Authentication, Authorisation) in RabbitMQ
爲了讓guest可遠程訪問,須要修改rabbitmq.config
中的loopback_users
參數,設置爲oop
[{rabbit, [{loopback_users, []}]}].
官網文檔描述以下,可參考官方文檔:RabbitMQ Configuration:this
loopback_users參數: List of users which are only permitted to connect to the broker via a loopback interface (i.e. localhost). If you wish to allow the default guest user to connect remotely, you need to change this to []. Default: [<<"guest">>]
默認安裝時,rabbitmq.config
配置文件可能不存在,有兩種方式能夠設置配置文件;url
RABBITMQ_CONFIG_FILE
指定 rabbitmq.config
文件位置;If rabbitmq.config doesn't exist, it can be created manually. Set the RABBITMQ_CONFIG_FILE environment variable if you change the location. The Erlang runtime automatically appends the .config extension to the value of this variable.
修改完配置文件後,重啓,就能夠使用guest用戶遠程訪問了;