- Rabbitmq настройка сервера windows
- Установить Erlang
- Установить RabbitMQ
- Настроить папки
- Настроить переменные окружения
- Запуск сервера
- Installing on Windows Manually
- Overview
- Install Erlang/OTP
- Make Sure ERLANG_HOME is Set
- Install RabbitMQ Server
- Direct Downloads
- Synchronise the Erlang Cookie
- Locating CLI Tools and App Data
- CLI tools
- Node Data Directory
- Running RabbitMQ Server as an Application
- Customise RabbitMQ Environment Variables
- Start the Broker as an Application
- Running RabbitMQ Server as a Service
- Customise RabbitMQ Environment Variables
- Install the Service
- Managing the Service
- Start the Broker as a Service
- Upgrading Erlang VM
- Managing a RabbitMQ Node
- Managing the Service
- Stopping a Node
- Checking Node Status
- Log Files and Management
- Troubleshooting When Running as a Service
- Default User Access
- Port Access
- Windows-specific Issues
- Getting Help and Providing Feedback
- Help Us Improve the Docs <3
- Installing on Windows
- Overview
- Using chocolatey
- Using the Installer
- Dependencies
- Direct Downloads
- Run RabbitMQ Windows Service
- CLI Tools
- Cookie File Location
- Node Configuration
- Environment Variable Changes on Windows
- Managing a RabbitMQ Node
- Managing the Service
- Stopping a Node
- Checking Node Status
- Log Files and Management
- Firewalls and Security Tools
- Default User Access
- Port Access
- Upgrading Erlang VM
- Dump File Location When Running as a Service
- Getting Help and Providing Feedback
- Help Us Improve the Docs <3
Rabbitmq настройка сервера windows
ВАЖНО!
Имя компьютера в системе должно быть на латинице и в нижнем регистре. Иначе Erlang работать не будет.
Установить Erlang
Скачать и установить последнюю версию Erlang www.erlang.org
Желательно использовать файл с именем “Windows 64-bit Binary File”
Установить RabbitMQ
Скачать и установить последнюю версию RabbitMQ www.rabbitmq.com
Устанавливаем сам Erlang
Настроить папки
Идем в раздел с установленным RabbitMQ, пути могут быть такими
Где rabbitmq_server-3.3.5 — это вресия сервера и у вас она может отличатся.
В разделе с установленным RabbitMQ создаем две папки conf и base, должно получиться вот так
Из указанной папки берем файл конфига и переименовываем его в rabbitmq.config, затем кладем в папку
Настроить переменные окружения
Установка переменных окружения для windows находится вот по такому пути Свойства системы -> Перменные среды
- Конфиг файла
имя: RABBITMQ_CONFIG_FILE
путь: %ProgramFiles%\RabbitMQ Server\rabbitmq_server-3.3.5\conf\rabbitmq - Логи и базы данных
имя: RABBITMQ_BASE
путь: %ProgramFiles%\RabbitMQ Server\rabbitmq_server-3.3.5\base - Переменная Path
имя: Path
путь: %PATH%
Если она уже есть, то открываем на редактирование и в поле пути в самом начале (перед сущетвующим, текстом) добавляем %PATH%;
Запуск сервера
Запускаем консольное прихожение windows.
В поиске набираем CMD и из списка можно выбрать два варианта, консоль от RabbitMQ или консоль от windows
Запускаем консоль от Администратора
Если выбрали консоль от windows то выполняем код
запускаем установку сервера
проверяем статус сервера, если ошибки, то гуглим и исправляем их
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
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
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).
Synchronise the Erlang Cookie
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!
Installing on Windows
Overview
This guide covers RabbitMQ installation on Windows. It focuses on the two recommended installation options:
The guide also covers a few post-installation topics in the context of Windows:
and more. These topics are covered in more details in the rest of documentation guides.
A separate companion guide covers known Windows-specific issues and ways to mitigate them.
Using chocolatey
RabbitMQ packages are distributed via Chocolatey. New releases can take a while (sometimes weeks) to get through approvals, so this option is not guaranteed to provide the latest release. It does, however, manage the required dependencies.
To install RabbitMQ using Chocolatey, run the following command from the command line or from PowerShell:
For many use cases, Chocolatey is the optimal installation method.
The Chocolatey RabbitMQ package is open source and can be found on GitHub.
Using the Installer
The official RabbitMQ installer is produced for every RabbitMQ release.
Compared to installation via Chocolatey, this option gives Windows users the most flexibility but also requires them to be aware of certain assumptions and requirements in the installer:
- There must be only one Erlang version installed at a time
- Erlang must be installed using an administrative account
- It is highly recommended that RabbitMQ is also installed as an administrative account
- Installation path must only contain ASCII characters
- It may be necessary to manually copy the shared secret file used by CLI tools
- CLI tools require Windows console to operate in UTF-8 mode
When these conditions are not met, Windows service and CLI tools may require reinstallation or other manual steps to get them to function as expected.
This is covered in more detail in the Windows-specific Issues guide.
Dependencies
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.
Note that Erlang must be installed using an administrative account or it won’t be discoverable to the RabbitMQ Windows service.
Once a supported version of Erlang is installed, download the RabbitMQ installer, rabbitmq-server-
Direct Downloads
Description | Download | Signature |
---|---|---|
Installer for Windows systems (from GitHub) | rabbitmq-server-3.8.14.exe | Signature |
Run RabbitMQ Windows Service
Once both Erlang and RabbitMQ have been installed, a RabbitMQ node can be started as a Windows service. The RabbitMQ service starts automatically. RabbitMQ Windows service ca be managed from the Start menu.
CLI Tools
RabbitMQ nodes are often managed, inspected and operated using CLI Tools in PowerShell.
On Windows, CLI tools have a .bat suffix compared to other platforms. For example, rabbitmqctl on Windows is invoked as rabbitmqctl.bat .
In order for these tools to work they must be able to authenticate with RabbitMQ nodes using a shared secret file called the Erlang cookie.
The main CLI tools guide covers most topics related to command line tool usage.
In order to explore what commands various RabbitMQ CLI tools provide, use the help command:
To learn about a specific command, pass its name as an argument to help :
Cookie File Location
On Windows, the cookie file location depends on whether the HOMEDRIVE and HOMEPATH environment variables are set.
If RabbitMQ is installed using a non-administrative account, a shared secret file used by nodes and CLI tools will not be placed into a correct location, leading to authentication failures when rabbitmqctl.bat and other CLI tools are used.
One of these options can be used to mitigate:
- Re-install RabbitMQ using an administrative user
- Copy the file .erlang.cookie manually from %SystemRoot% or %SystemRoot%\system32\config\systemprofile to %HOMEDRIVE%%HOMEPATH% .
Node Configuration
The service starts using its default settings, listening for connections on default interfaces and ports.
Node configuration is primarily done using a configuration file. A number of available environment variables can be used to control node’s data location, configuration file path and so on.
This is covered in more detail in the Configuration guide
Environment Variable Changes on Windows
Important: after setting environment variables, it is necessary to re-install the Windows service. Restarting the service will not be sufficient.
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.
Stopping a Node
To stop the broker or check its status, use rabbitmqctl.bat in sbin (as an administrator).
Checking Node Status
The following CLI command runs a basic health check and displays some information about the node if it is running.
For it to work, two conditions must be true:
- The node must be running
- rabbitmqctl.bat must be able to authenticate with the node
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.
Firewalls and Security Tools
Firewalls and security tools can prevent RabbitMQ Windows service and CLI tools from operating correctly.
Such tools should be configured to whitelist access to ports used by RabbitMQ.
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)
Upgrading Erlang VM
If you have an existing installation and are planning to upgrade the Erlang VM from a 32-bit to a 64-bit 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.
Dump File Location When Running as a Service
In the event that the Erlang VM terminates when 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, defaulting to %APPDATA%\%RABBITMQ_SERVICENAME% — typically %APPDATA%\RabbitMQ otherwise.
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!