Ubuntu系统上RabbitMQ的配置文件应该存储在/etc/rabbitmq/rabbitmq.conf
如果没有,在RabbitMQ的启动log里面会有如下的信息:
Starting RabbitMQ 3.7.7 on Erlang 21.0 Copyright (C) 2007-2018 Pivotal Software, Inc. Licensed under the MPL. See http://www.rabbitmq.com/ 2018-08-12 16:40:14.671 [info] <0.1409.0> node : rabbit@iZuf6cdovpqjj6q2xqxrjlZ home dir : /var/lib/rabbitmq config file(s) : (none) cookie hash : Q3TjDnUThEMjV/iOuMOw0w== log(s) : /var/log/rabbitmq/rabbit@iZuf6cdovpqjj6q2xqxrjlZ.log : /var/log/rabbitmq/rabbit@iZuf6cdovpqjj6q2xqxrjlZ_upgrade.log database dir : /var/lib/rabbitmq/mnesia/rabbit@iZuf6cdovpqjj6q2xqxrjlZ
这个时候可以复制RabbitMQ的example文件: https://github.com/rabbitmq/rabbitmq-server/blob/master/docs/rabbitmq.conf.example
如果系统不能识别, 试试在/etc/rabbitmq下面增加rabbitmq-env.conf, 内容如下:
root@iZuf6cdovpqjj6q2xqxrjlZ:/etc/rabbitmq# vim /etc/rabbitmq/rabbitmq-env.conf CONFIG_FILE=/etc/rabbitmq/rabbitmq
注意: 没有.conf后缀!
配置文件改动之后, 需要杀掉rabbitmq-server的进程重新启动。