Rabbitmq windows config file

Installing on Windows Manually

Overview

This guide describes how RabbitMQ can be installed and configured manually on Windows. In general we recommend using one the more automation-friendly options for Windows when possible.

Install Erlang/OTP

RabbitMQ requires a 64-bit supported version of Erlang for Windows to be installed. Latest binary builds for Windows can be obtained from the Erlang/OTP Version Tree page.

Erlang will appear in the Start Menu, and \erl\bin\erl.exe will be in C:\Program Files for 64-bit Erlang installations

Important: your system should only have one version of Erlang installed. Please consult the Windows-specific Issues page.

Make Sure ERLANG_HOME is Set

In case there’s an existing RabbitMQ installation with the broker running as a service and you installed an Erlang VM with a different architecture then the service must be uninstalled before updating ERLANG_HOME .

Set ERLANG_HOME to where you actually put your Erlang installation, e.g. C:\Program Files\erl (full path). The RabbitMQ batch files expect to execute %ERLANG_HOME%\bin\erl.exe .

Go to Start > Settings > Control Panel > System > Advanced > Environment Variables . Create the system environment variable ERLANG_HOME and set it to the full path of the directory which contains bin\erl.exe .

Install RabbitMQ Server

After making sure a supported Erlang version is installed, download rabbitmq-server-windows-3.8.14.zip .

Direct Downloads

Description Download Signature
Installer for Windows systems (from GitHub) rabbitmq-server-windows-3.8.14.zip Signature

From the zip file, extract the folder named rabbitmq_server-3.8.14 into C:\Program Files\RabbitMQ (or somewhere suitable for application files).

The Erlang cookie is a shared secret used for authentication between RabbitMQ nodes and CLI tools. The value is stored in a file commonly referred to as the Erlang cookie file.

The cookie file used by the service account and the user running rabbitmqctl.bat must be synchronised for CLI tools such as rabbitmqctl.bat to function. All nodes in a cluster must have the same cookie value (cookie file contents).

Locating CLI Tools and App Data

CLI tools

Within the rabbitmq_server-3.8.14\sbin directory are some scripts which run commands to control the RabbitMQ server.

The RabbitMQ server can be run as either an application or service (not both).

  • rabbitmq-server.bat starts the broker as an application
  • rabbitmq-service.bat manages the service and starts the broker
  • rabbitmqctl.bat manages a running broker

Log in as an administrator. To see the output, run these from a Command Prompt in the sbin directory.

Note: On Windows Vista (and later) it is necessary to elevate privilege (e.g. right-click on the icon to select Run as Administrator).

Set up the system path so RabbitMQ server and CLI tools from the sbin directory can be executed without using fully qualified paths.

  • Create a system environment variable (e.g. RABBITMQ_SERVER ) for «C:\Program Files\RabbitMQ\rabbitmq_server-3.8.14» . Adjust this if you put rabbitmq_server-3.8.14 elsewhere, or if you upgrade versions.
  • Append the literal string » ;%RABBITMQ_SERVER%\sbin » to your system path (aka %PATH% ).

Now it should be possible to run rabbitmq commands from any (administrator) Command Prompt.

Navigate to rabbitmq_server-3.8.14\sbin to run commands if the system path does not contain the RabbitMQ sbin directory.

Node Data Directory

By default, the RabbitMQ logs and node’s data directory are stored in the current user’s Application Data directory e.g. C:\Documents and Settings\ %USERNAME% \Application Data or C:\Users\ %USERNAME% \AppData\Roaming .

Execute echo %APPDATA% at a Command Prompt to find this directory. Alternatively, Start > Run %APPDATA% will open this folder.

A node can be configured to use a different data directory using one of these environment variables: RABBITMQ_BASE , RABBITMQ_MNESIA_BASE or RABBITMQ_MNESIA_DIR . Please read the relocation guide for a description of how each of these variables works.

Running RabbitMQ Server as an Application

The application is started by the rabbitmq-server.bat script in sbin .

Customise RabbitMQ Environment Variables

The service will run fine using its default settings. It is possible to customise the RabbitMQ environment or edit configuration.

Important: after setting environment variables, it is necessary to restart the node.

Start the Broker as an Application

Run the command

This will start a node in the background (not attached to the Command Prompt).

Alternatively, rabbitmq-server.bat can be executed in Windows Explorer to start a node in foreground.

When a node is started, a Command Prompt window opens, displays a short startup banner, indicating that the RabbitMQ broker has been started successfully.

If the node was started without the -detached option, e.g. using Windows Explorer, a second Command Prompt window will be necessary to control the application using CLI tools.

Important: closing the original Command Prompt window will forcefully shut down a server started this way.

Running RabbitMQ Server as a Service

The service will run in the security context of the system account without the need for a user to be logged in on a console. This is normally more appropriate for production use. The server should not be run as a service and application simultaneously.

The service runs using the rabbitmq-service.bat script in sbin .

Customise RabbitMQ Environment Variables

The service will run fine using its default settings. It is possible to customise the RabbitMQ environment or edit configuration.

Important: after setting environment variables, it is necessary to reinstall the service.

Install the Service

Install the service by running

A service with the name defined by RABBITMQ_SERVICENAME should now appear in the Windows Services control panel (Start > Run services.msc ).

Managing the Service

To manage the service (install, remove, start, stop, enable, disable), use rabbitmq-service.bat commands. Alternatively, the Windows Services panel ( services.msc ) can be used to perform some of the same functions as the service script.

Start the Broker as a Service

To start the broker, execute

If the output from this command is » Service RABBITMQ_SERVICENAME started «, then the service was started successfully.

Confirm the service named RABBITMQ_SERVICENAME reports a «Started» status in Services:
Start > Run services.msc .

Upgrading Erlang VM

If you have an existing installation and are planning to upgrade the Erlang VM from a 32bit to a 64bit version then you must uninstall the broker before upgrading the VM. The installer will not be able to stop or remove a service that was installed with an Erlang VM of a different architecture.

Managing a RabbitMQ Node

Managing the Service

Links to RabbitMQ directories can be found in the Start Menu.

There is also a link to a command prompt window that will start in the sbin dir, in the Start Menu. This is the most convenient way to run the command line tools. Note that CLI tools will have to authenticate to the RabbitMQ node running locally. That involves a shared secret file which has to be placed into the correct location for the user.

Stopping a Node

To stop the broker or check its status, use rabbitmqctl.bat in sbin (as an administrator).

Checking Node Status

The following command performs the most basic node health check and displays some information about the node if it is running:

Log Files and Management

Server logs are critically important in troubleshooting and root cause analysis. See Logging and File and Directory Location guides to learn about log file location, log rotation and more.

Troubleshooting When Running as a Service

In the event that the Erlang VM crashes whilst RabbitMQ is running as a service, rather than writing the crash dump to the current directory (which doesn’t make sense for a service) it is written to an erl_crash.dump file in the base directory of the RabbitMQ server (set by the RABBITMQ_BASE environment variable, defaulting to %APPDATA%\%RABBITMQ_SERVICENAME% — typically %APPDATA%\RabbitMQ otherwise).

Default User Access

The broker creates a user guest with password guest . Unconfigured clients will in general use these credentials. By default, these credentials can only be used when connecting to the broker as localhost so you will need to take action before connecting from any other machine.

See the documentation on access control for information on how to create more users and delete the guest user.

Port Access

RabbitMQ nodes bind to ports (open server TCP sockets) in order to accept client and CLI tool connections. Other processes and tools such as anti-virus software may prevent RabbitMQ from binding to a port. When that happens, the node will fail to start.

CLI tools, client libraries and RabbitMQ nodes also open connections (client TCP sockets). Firewalls can prevent nodes and CLI tools from communicating with each other. Make sure the following ports are accessible:

  • 4369: epmd, a peer discovery service used by RabbitMQ nodes and CLI tools
  • 5672, 5671: used by AMQP 0-9-1 and 1.0 clients without and with TLS
  • 25672: used for inter-node and CLI tools communication (Erlang distribution server port) and is allocated from a dynamic range (limited to a single port by default, computed as AMQP port + 20000). Unless external connections on these ports are really necessary (e.g. the cluster uses federation or CLI tools are used on machines outside the subnet), these ports should not be publicly exposed. See networking guide for details.
  • 35672-35682: used by CLI tools (Erlang distribution client ports) for communication with nodes and is allocated from a dynamic range (computed as server distribution port + 10000 through server distribution port + 10010). See networking guide for details.
  • 15672: HTTP API clients, management UI and rabbitmqadmin (only if the management plugin is enabled)
  • 61613, 61614: STOMP clients without and with TLS (only if the STOMP plugin is enabled)
  • 1883, 8883: MQTT clients without and with TLS, if the MQTT plugin is enabled
  • 15674: STOMP-over-WebSockets clients (only if the Web STOMP plugin is enabled)
  • 15675: MQTT-over-WebSockets clients (only if the Web MQTT plugin is enabled)

Windows-specific Issues

We aim to make RabbitMQ a first-class citizen on Windows. However, sometimes there are circumstances beyond our control. Please consult the Windows-specific Issues page.

Getting Help and Providing Feedback

If you have questions about the contents of this guide or any other topic related to RabbitMQ, don’t hesitate to ask them on the RabbitMQ mailing list.

Help Us Improve the Docs <3

If you’d like to contribute an improvement to the site, its source is available on GitHub. Simply fork the repository and submit a pull request. Thank you!

Установка и настройка кластера RabbitMQ на Windows

Иногда есть необходимость установить кластер RabbitMQ на Windows сервера, в этой статье мы рассмотрим как это можно сделать.

Установка будет проводится на 3 сервера, на каждом из них нужно выполнить операции указанные ниже.

Устанавливаем Erlang , переходим на страницу https :// www . rabbitmq . com / which – erlang . html и проверяем какая версия Erlang совместима с текущим RabbitMQ .

Скачиваем и устанавливаем необходимую версию Erlang по ссылке http :// www . erlang . org / download . html

После установки устанавливаем переменную окружения ERLANG _ HOME

Открываем Start > Settings > Control Panel > System > Advanced > Environment Variables

Создаем системную переменную ERLANG _ HOME , которая должна указывать на путь к установленному Erlang , например – C :\ Program Files \ erl 10.4

В настоящий момент последняя версия 3.7.15

Распаковываем архив в C :\ Program Files \ RabbitMQ

По аналогии создаем системную переменную RABBITMQ _ SERVER , которая должна содержать полный путь к серверу ( C :\ Program Files \ RabbitMQ )

Далее, в системную переменную Path добавляем значение ;% RABBITMQ _ SERVER %\ sbin

По аналогии создаем переменную с указанием пути к конфигу RABBITMQ

Переменная RABBITMQ _ CONFIG _ FILE , значение имя файла без расширения, например – c :\ rabbitmq \ rabbitmq

Создаем конфиг RABBITMQ – c :\ rabbitmq \ rabbitmq . config со следующим содержимым:

File and Directory Locations

Overview

Every RabbitMQ node uses a number of files and directories to load configuration; store data, metadata, log files, and so on. Their location can be changed.

This guide covers:

  • How to customise location of various directories and files used RabbitMQ nodes
  • Default locations for various operating systems
  • Other topics related to file and directory locations

This guide accompanies the main Configuration guide.

Overriding Locations

A number of environment variables specifies where RabbitMQ should locate certain things. In most environments default values should work just fine.

Path and Directory Name Restrictions

Some of the environment variable configure paths and locations (node’s base or data directory, plugin source and expansion directories, and so on). Those paths have must exclude a number of characters:

  • * and ? (on Linux, macOS, BSD and other UNIX-like systems)
  • ^ and !
  • [ and ]
  • <> and >

The above characters will render the node unable to start or function as expected (e.g. expand plugins and load their metadata).

When changing file or directory locations, it is important to make sure that they have sufficient permissions for RabbitMQ node OS process to read and write from. It’s best to assume that most directories and files used by RabbitMQ require read, write, and file creation permissions. Debian, RPM and Windows installer scripts will set up file system permissions suitable for most environments, however, when strict default permissions are used system-wide, it may be necessary to run additional configuration steps after installation to make sure RabbitMQ node file and directories have sufficient permissions

Environment Variables

Name Description
RABBITMQ_BASE Note: Windows only. 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_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.
RABBITMQ_GENERATED_CONFIG_DIR The directory where RabbitMQ writes its generated configuration files.
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. This variable is typically not overridden. Usually RABBITMQ_MNESIA_DIR is overridden instead.
RABBITMQ_MNESIA_DIR The directory where this RabbitMQ node’s data is stored. This s a schema database, message stores, cluster member information and other persistent node state.
RABBITMQ_SCHEMA_DIR The directory where RabbitMQ keeps its configuration schema used by the new style configuration file.
RABBITMQ_LOG_BASE This base directory contains the RabbitMQ server’s log files, unless RABBITMQ_LOGS is set.
RABBITMQ_LOGS The path of the RabbitMQ server’s Erlang log file. This variable cannot be overridden on Windows.
RABBITMQ_PLUGINS_DIR The list of directories where plugin archive files are located and extracted 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_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_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_PID_FILE File in which the process id is placed for use by rabbitmqctl wait .

Default Locations on Linux, macOS, BSD

In the following table the $ to some paths is indicated. Homebrew installations use the installation-prefix (Homebrew Cellar) when installed. By default this is /usr/local .

Debian and RPM package installations use an empty $ .

Name Location
RABBITMQ_BASE (Not used — Windows only)
RABBITMQ_CONFIG_FILE $ /etc/rabbitmq/rabbitmq
RABBITMQ_MNESIA_BASE $ /var/lib/rabbitmq/mnesia
RABBITMQ_MNESIA_DIR $RABBITMQ_MNESIA_BASE / $RABBITMQ_NODENAME
RABBITMQ_LOG_BASE $ /var/log/rabbitmq
RABBITMQ_LOGS $RABBITMQ_LOG_BASE / $RABBITMQ_NODENAME .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 $RABBITMQ_MNESIA_BASE / $RABBITMQ_NODENAME -plugins-expand
RABBITMQ_ENABLED_PLUGINS_FILE $ /etc/rabbitmq/enabled_plugins
RABBITMQ_PID_FILE $RABBITMQ_MNESIA_DIR .pid

Default Locations on Windows

Name Location
RABBITMQ_BASE %APPDATA% \RabbitMQ
RABBITMQ_CONFIG_FILE %RABBITMQ_BASE% \rabbitmq
RABBITMQ_MNESIA_BASE %RABBITMQ_BASE% \db
RABBITMQ_MNESIA_DIR %RABBITMQ_MNESIA_BASE% \ %RABBITMQ_NODENAME% -mnesia
RABBITMQ_LOG_BASE %RABBITMQ_BASE% \log
RABBITMQ_LOGS %RABBITMQ_LOG_BASE% \ %RABBITMQ_NODENAME% .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 Binary Build Defaults

These are the defaults obtained when unpacking the Generic Unix tar-file and running the server without modification. In this table $RABBITMQ_HOME refers to the directory produced when extracting the archive.

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 $RABBITMQ_MNESIA_BASE / $RABBITMQ_NODENAME
RABBITMQ_LOG_BASE $RABBITMQ_HOME /var/log/rabbitmq
RABBITMQ_LOGS $RABBITMQ_LOG_BASE / $RABBITMQ_NODENAME .log
RABBITMQ_PLUGINS_DIR $RABBITMQ_HOME /plugins
RABBITMQ_PLUGINS_EXPAND_DIR $RABBITMQ_MNESIA_BASE / $RABBITMQ_NODENAME -plugins-expand
RABBITMQ_PID_FILE $RABBITMQ_MNESIA_DIR .pid

Getting Help and Providing Feedback

If you have questions about the contents of this guide or any other topic related to RabbitMQ, don’t hesitate to ask them on the RabbitMQ mailing list.

Help Us Improve the Docs <3

If you’d like to contribute an improvement to the site, its source is available on GitHub. Simply fork the repository and submit a pull request. Thank you!

Читайте также:  Windows server настроить vlan
Оцените статью