Overview
By default when installing and configuring RabbitMQ, the BASEPATH for all config, logs, plugins, and instances are pointed to the %appdata% of the User that did the installation.
Using this article, the RABBITMQ_BASEPATH will be moved to a specific directory which avoids any dependency on a User.
Related Articles
Steps on Moving the RABBITMQ_BASEPATH
If any of the steps below have errors or if there are any issues, please stop the process and contact support@automate101.com immediately.
1. Prepare the existing RabbitMQ account username and password from the Primary Environment and Remove Environments (if any)
- Using PowerShell (Administrator), navigate to 'C:\Program Files\Automate101\Atria\ConfigService'
- Initiate a Get-AtriaComponent | FT to initialize a contact with the ConfigService
- Use the below script to decrypt the appSettings.Secret.json of the ConfigService component
- $encUtil = New-Object -TypeName 'Atria.Common.Utils.SymmetricEncryptionUtil'
- $ConfigDecryptor = New-Object -TypeName 'Atria.Common.Configuration.ConfigurationEncryptor' -ArgumentList $encUtil
- $configJson = ConvertFrom-Json ((Get-Content .\appsettings.secrets.json)-Join "")
- $configDict = New-Object 'System.Collections.Generic.Dictionary[String,String]'
- $configJson.PSobject.Properties | %{$configDict.Add($_.Name, $_.Value)}
- $ConfigDecryptor.DecryptConfig($configDict)
- Take note of the username and password of the RabbitMQ account from the secret:messaging values
Sample from Remote Environment:
Do these on the Provisioning Server of the Primary Environment and Remove Environments
2. Once the username and password details are noted, proceed with navigating to the RabbitMQ sbin directory in PowerShell. Folder version might differ depending on what was installed.
(i.e. C:\Program Files\RabbitMQ\rabbitmq_server-3.8.18\sbin)
3. Check the status of RabbitMQ to determine where the directory path of the config, logs, plugins, etc. are located
.\rabbitmqctl.bat status
4. Create a directory to where RabbitMQ_BASEPATH will be pointed going forward (i.e. C:\AtriaRabbitMQ)
5. From Step 3, get the information to where the config files are located. Navigate to the %appdata% of that user profile and then copy the advanced.config, RabbitMQ.conf, and plugin files going to the new directory location in Step 4.
6. On the Windows Menu, navigate to RabbitMQ Server and select STOP and then REMOVE. (Note: this does not remove the RabbitMQ service but rather the configuration and settings only)
7. Open PowerShell (admin) then run the commands:
$rabbitdir = 'C:\AtriaRabbitMQ' (depending on the directory that was created on Step 4)
[Environment]::SetEnvironmentVariable("RABBITMQ_BASE", $rabbitdir, "Machine")
8. Restart the PowerShell session, then list to check the RABBITMQ_BASEPATH Environment Variable. If the environment variable is missing, a restart of machine might be needed.
[Environment]::GetEnvironmentVariables()
9. Navigate to the RabbitMQ sbin folder. This depends also on the RabbitMQ version.
cd 'C:\Program Files\RabbitMQ Server\rabbitmq_server-3.10.2\sbin\'
Set the RABBITMQ_BASEPATH
SET RABBITMQ_BASE=C:\AtriaRabbitMQ
10. On the Windows Menu, navigate to RabbitMQ Server and select RE(INSTALL) and then START.
11. Check the status of RabbitMQ, this should now show that the paths have been changed to the new one.
.\rabbitmqctl.bat status
12. Add back the RabbitMQ accounts and passwords that came from the Primary and Remote Environments.
Primary Environment Account (the only account tagged as administrator):
.\rabbitmqctl add_user '<username>' '<password>'
.\rabbitmqctl set_permissions -p / '<username>' ".*" ".*" ".*"
.\rabbitmqctl set_user_tags '<username>' administrator
.\rabbitmqctl delete_user guest
Remote Environment Account (if any Remote Shared or Dedicated Customer)
.\rabbitmqctl add_user '<username>' '<password>'
.\rabbitmqctl set_permissions -p / '<username>' ".*" ".*" ".*"
14. Start the Atria Services on the Primary Environment
15. Restart the Atria Services for each of the Remote Environments
16. When all services are started/restarted, the queues in RabbitMQ will be generated
17. Once services are all started and queues are ready, you can run a Provisioning request to validate.