通过本文centos7通过rpm方式安装成功后:http://blog.csdn.net/fuck487/article/details/77869039
创建用户,并创建权限后,依然无法远程连接
本人查找原因找了很久,通过命令查看rabbitmq的状态发现
./rabbitmqctl status
结果
Status of node rabbit@localhost
[{pid,4151},
{running_applications,
[{rabbitmq_management,"RabbitMQ Management Console","3.6.11"},
{rabbitmq_web_dispatch,"RabbitMQ Web Dispatcher","3.6.11"},
{rabbitmq_management_agent,"RabbitMQ Management Agent","3.6.11"},
{rabbit,"RabbitMQ","3.6.11"},
{os_mon,"CPO CXC 138 46","2.2.14"},
{cowboy,"Small, fast, modular HTTP server.","1.0.4"},
{ranch,"Socket acceptor pool for TCP protocols.","1.3.0"},
{ssl,"Erlang/OTP SSL application","5.3.3"},
{public_key,"Public key infrastructure","0.21"},
{cowlib,"Support library for manipulating Web protocols.","1.0.2"},
{crypto,"CRYPTO version 2","3.2"},
{amqp_client,"RabbitMQ AMQP Client","3.6.11"},
{rabbit_common,
"Modules shared by rabbitmq-server and rabbitmq-erlang-client",
"3.6.11"},
{inets,"INETS CXC 138 49","5.9.8"},
{mnesia,"MNESIA CXC 138 12","4.11"},
{compiler,"ERTS CXC 138 10","4.9.4"},
{xmerl,"XML parser","1.3.6"},
{syntax_tools,"Syntax tools","1.6.13"},
{asn1,"The Erlang ASN1 compiler version 2.0.4","2.0.4"},
{sasl,"SASL CXC 138 11","2.3.4"},
{stdlib,"ERTS CXC 138 10","1.19.4"},
{kernel,"ERTS CXC 138 10","2.16.4"}]},
{os,{unix,linux}},
{erlang_version,
"Erlang R16B03-1 (erts-5.10.4) [source] [64-bit] [smp:4:4] [async-threads:64] [hipe] [kernel-poll:true]\n"},
{memory,
[{connection_readers,0},
{connection_writers,0},
{connection_channels,0},
{connection_other,2800},
{queue_procs,82208},
{queue_slave_procs,0},
{plugins,406168},
{other_proc,23722384},
{metrics,142848},
{mgmt_db,139192},
{mnesia,65240},
{other_ets,2331656},
{binary,802256},
{msg_index,87440},
{code,26963978},
{atom,992409},
{other_system,19562285},
{total,75300864}]},
{alarms,[]},
{listeners,[{clustering,25672,"::"},{amqp,5672,"0.0.0.0"},{http,15672,"::"}]},
{vm_memory_calculation_strategy,rss},
{vm_memory_high_watermark,0.4},
{vm_memory_limit,1583901900},
{disk_free_limit,50000000},
{disk_free,10830860288},
{file_descriptors,
[{total_limit,924},{total_used,3},{sockets_limit,829},{sockets_used,0}]},
{processes,[{limit,1048576},{used,332}]},
{run_queue,0},
{uptime,11},
{kernel,{net_ticktime,60}}]
其中
{listeners,[{clustering,25672,"::"},{amqp,5672,"0.0.0.0"},{http,15672,"::"}]},
这是修改后的
{amqp,5672,"0.0.0.0"}
修改前
{amqp,5672,"127.0.0.1"}
通过修改rabbitmq-env.conf配置文件:/etc/rabbitmq/rabbitmq-env.conf
vim /etc/rabbitmq/rabbitmq-env.conf
NODENAME=rabbit@localhost
#NODE_IP_ADDRESS=127.0.0.1
NODE_IP_ADDRESS=0.0.0.0
NODE_IP_ADDRESS修改成0.0.0.0,也可以设置为空值,表示匹配所有ip