每个RabbitMQ节点使用许多文件和目录来加载配置;存储数据、元数据、日志文件等。文件和目录的位置可以改变。
在更改文件或目录位置时,重要的是确保它们具有足够的权限,以便RabbitMQ节点OS进程可以从中读写。最好假设RabbitMQ使用的大多数目录和文件都需要读、写和文件创建权限。Debian、RPM和Windows安装程序脚本将设置适用于大多数环境的文件系统权限,但是,当系统范围内使用严格的默认权限时,可能需要在安装之后运行额外的配置步骤,以确保RabbitMQ节点文件和目录具有足够的权限。
您可以设置以下环境变量来指定RabbitMQ应该在何处定位某些内容。在大多数环境中,默认值应该可以正常工作。
Name
Description
RABBITMQ_BASE
This base directory contains sub-directories for the RabbitMQ server’s database and log files. Alternatively, set RABBITMQ_MNESIA_BASE and RABBITMQ_LOG_BASE individually.这个基本目录包含RabbitMQ服务器的数据库和日志文件的子目录。或者,单独设置RABBITMQ_MNESIA_BASE和RABBITMQ_LOG_BASE。
RABBITMQ_CONFIG_FILE
The path to the configuration file, without the .config extension. If the configuration file is present it is used by the server to configure RabbitMQ components. See Configuration guide for more information.配置文件的路径,没有.config扩展名。如果配置文件存在,服务器将使用它来配置RabbitMQ组件。默认值是${SYS_PREFIX}/etc/rabbitmq/rabbitmq
RABBITMQ_MNESIA_BASE
This base directory contains sub-directories for the RabbitMQ server’s node database, message store and cluster state files, one for each node, unless RABBITMQ_MNESIA_DIR is set explicitly. It is important that effective RabbitMQ user has sufficient permissions to read, write and create files and subdirectories in this directory at any time.这个基本目录包含RabbitMQ服务器节点数据库、消息存储和集群状态文件的子目录,每个节点一个,除非显式设置RABBITMQ_MNESIA_DIR。重要的是,有效的RabbitMQ用户有足够的权限随时读写和创建该目录中的文件和子目录。默认值是${SYS_PREFIX}/var/lib/rabbitmq/mnesia
RABBITMQ_MNESIA_DIR
The directory where this RabbitMQ node’s Mnesia database files are placed. (In addition to Mnesia files this location also contains message storage and index files as well as schema and cluster details.)
RABBITMQ_LOG_BASE
This base directory contains the RabbitMQ server’s log files, unless RABBITMQ_LOGS or RABBITMQ_SASL_LOGS are set explicitly.默认值是${SYS_PREFIX}/var/log/rabbitmq
RABBITMQ_LOGS
The path of the RabbitMQ server’s Erlang log file. This variable cannot be overridden on Windows.
RABBITMQ_SASL_LOGS
The path of the RabbitMQ server’s Erlang SASL (System Application Support Libraries) log file. This variable cannot be overridden on Windows.
RABBITMQ_PLUGINS_DIR
The list of directories where plugins are found and loaded from. This is PATH-like variable, where different paths are separated by an OS-specific separator (: for Unix, ; for Windows). Plugins can be installed to any of the directories listed here.默认值是 “${RABBITMQ_HOME}/plugins”
RABBITMQ_PLUGINS_EXPAND_DIR
Working directory used to expand enabled plugins when starting the server. It is important that effective RabbitMQ user has sufficient permissions to read and create files and subdirectories in this directory.用于在启动服务器时展开启用插件的工作目录。重要的是,有效的RabbitMQ用户有足够的权限来读取和创建这个目录中的文件和子目录。
RABBITMQ_ENABLED_PLUGINS_FILE
This file records explicitly enabled plugins. When a plugin is enabled or disabled, this file will be recreated. It is important that effective RabbitMQ user has sufficient permissions to read, write and create this file at any time.这个文件显式地记录了启用的插件。当插件被启用或禁用时,将重新创建该文件。重要的是,有效的RabbitMQ用户有足够的权限随时读取、写入和创建此文件。
RABBITMQ_PID_FILE
File in which the process id is placed for use by rabbitmqctl wait.将进程id放置在其中以供rabbitmqctl等待使用的文件。
下表中${install_prefix}默认是/usr/local。Deb / RPM package installations use an empty ${install_prefix}.
Name
Location
RABBITMQ_BASE
(Not used)
RABBITMQ_CONFIG_FILE
${install_prefix}/etc/rabbitmq/rabbitmq
RABBITMQ_MNESIA_BASE
${install_prefix}/var/lib/rabbitmq/mnesia
RABBITMQ_MNESIA_DIR
R A B B I T M Q _ M N E S I A _ B A S E / RABBITMQ\_MNESIA\_BASE/ RABBITMQ_MNESIA_BASE/RABBITMQ_NODENAME
RABBITMQ_LOG_BASE
${install_prefix}/var/log/rabbitmq
RABBITMQ_LOGS
R A B B I T M Q _ L O G _ B A S E / RABBITMQ\_LOG\_BASE/ RABBITMQ_LOG_BASE/RABBITMQ_NODENAME.log
RABBITMQ_SASL_LOGS
R A B B I T M Q _ L O G _ B A S E / RABBITMQ\_LOG\_BASE/ RABBITMQ_LOG_BASE/RABBITMQ_NODENAME-sasl.log
RABBITMQ_PLUGINS_DIR
/usr/lib/rabbitmq/plugins:$RABBITMQ_HOME/plugins
Note that /usr/lib/rabbitmq/plugins is used only when RabbitMQ is installed into the standard (default) location.
RABBITMQ_PLUGINS_EXPAND_DIR
R A B B I T M Q _ M N E S I A _ B A S E / RABBITMQ\_MNESIA\_BASE/ RABBITMQ_MNESIA_BASE/RABBITMQ_NODENAME-plugins-expand
RABBITMQ_ENABLED_PLUGINS_FILE
${install_prefix}/etc/rabbitmq/enabled_plugins
RABBITMQ_PID_FILE
$RABBITMQ_MNESIA_DIR.pid
Name
Location
RABBITMQ_BASE
%APPDATA%RabbitMQ
RABBITMQ_CONFIG_FILE
%RABBITMQ_BASE% abbitmq
RABBITMQ_MNESIA_BASE
%RABBITMQ_BASE%db
RABBITMQ_MNESIA_DIR
%RABBITMQ_MNESIA_BASE%%RABBITMQ_NODENAME%
RABBITMQ_LOG_BASE
%RABBITMQ_BASE%log
RABBITMQ_LOGS
%RABBITMQ_LOG_BASE%%RABBITMQ_NODENAME%.log
RABBITMQ_SASL_LOGS
%RABBITMQ_LOG_BASE%%RABBITMQ_NODENAME%-sasl.log
RABBITMQ_PLUGINS_DIR
Installation-directory/plugins
RABBITMQ_PLUGINS_EXPAND_DIR
%RABBITMQ_MNESIA_BASE%%RABBITMQ_NODENAME%-plugins-expand
RABBITMQ_ENABLED_PLUGINS_FILE
%RABBITMQ_BASE%enabled_plugins
RABBITMQ_PID_FILE
(Not currently supported)
这些是在解包Generic Unix tar文件并在不进行修改的情况下运行服务器时获得的默认值。在这个表中,$RABBITMQ_HOME引用解压下载文件时生成的目录rabbitmq_server-3.6.14。
Name
Location
RABBITMQ_BASE
(Not used)
RABBITMQ_CONFIG_FILE
$RABBITMQ_HOME/etc/rabbitmq/rabbitmq
RABBITMQ_MNESIA_BASE
$RABBITMQ_HOME/var/lib/rabbitmq/mnesia
RABBITMQ_MNESIA_DIR
R A B B I T M Q _ M N E S I A _ B A S E / RABBITMQ\_MNESIA\_BASE/ RABBITMQ_MNESIA_BASE/RABBITMQ_NODENAME
RABBITMQ_LOG_BASE
$RABBITMQ_HOME/var/log/rabbitmq
RABBITMQ_LOGS
R A B B I T M Q _ L O G _ B A S E / RABBITMQ\_LOG\_BASE/ RABBITMQ_LOG_BASE/RABBITMQ_NODENAME.log
RABBITMQ_SASL_LOGS
R A B B I T M Q _ L O G _ B A S E / RABBITMQ\_LOG\_BASE/ RABBITMQ_LOG_BASE/RABBITMQ_NODENAME-sasl.log
RABBITMQ_PLUGINS_DIR
$RABBITMQ_HOME/plugins
RABBITMQ_PLUGINS_EXPAND_DIR
R A B B I T M Q _ M N E S I A _ B A S E / RABBITMQ\_MNESIA\_BASE/ RABBITMQ_MNESIA_BASE/RABBITMQ_NODENAME-plugins-expand
RABBITMQ_ENABLED_PLUGINS_FILE
$RABBITMQ_HOME/etc/rabbitmq/enabled_plugins
RABBITMQ_PID_FILE
$RABBITMQ_MNESIA_DIR.pid