Updating a RabbitMQ Password
Updating a RabbitMQ Password
Update a RabbitMQ Password – Linux
Overview
If you install the instance of RabbitMQ provided with the Platform Analytics installer, the password is encrypted by default during installation. If, at some point, you need reset the RabbitMQ password, it must be updated in both ThingWorx and the Property Transform microserver. Follow the procedures below to complete all the necessary tasks.
Update the Password in RabbitMQ
To update a RabbitMQ password, make all of the following updates:
1. Open a terminal window as the root user.
2. Navigate to the following location in your Platform Analytics installation directory:
<platform_analytics_install>/RabbitMQ/rabbitmq_server-3.7.7/sbin
For example:
/opt/ThingWorxAnalytics/PlatformAnalytics/RabbitMQ/rabbitmq_server-3.7.7/sbin
3. Run the following command:
./rabbitmqctl change_password <RabbitMQ username> <new password>
4. Use the following commands to restart the RabbitMQ and Flink services:
systemctl restart twpas-rabbitmq.service
systemctl restart twpas-flink.service
Update the Password in ThingWorx
1. Open a terminal window as the root user.
2. Navigate to the bin directory of the Security Management Tool.
* 
The Security Management Tool was downloaded and configured the first time you manually encrypted the RabbitMQ password. To review that procedure, see the Configure Property Transform Settings in ThingWorx and navigate to the Encrypt the RabbitMQ Password section.
3. Run the following command:
./security-common-cli keystore.conf set encrypt.propertytransform.password "<new RabbitMQ password>"
4. Restart ThingWorx.
Update the Password in the Property Transform Microserver – Scripted Process
This scripted procedure is available for Platform Analytics version 8.4.4 or later. The encryption script automates most of the steps involved in updating an encrypted password. It eliminates the manual work of copying randomly generated Key Store directory and file names and plugging them into a complex Java encryption command. The encryption script is stored in the install bin directory and is launched with a simple command that requires two parameters.
If you are using a Platform Analytics version earlier than 8.4.4, use the Manual Process.
1. Open a terminal window and navigate, as the root user, to the bin directory where your Platform Analytics is installed:
/opt/ThingWorxAnalytics/PlatformAnalytics/bin
2. Execute the following command to run a script that will update the encryption of your new RabbitMQ password:
./update-encrypted-password.sh r <new RabbitMQ password>
A message is displayed when the encryption process is complete and the command prompt returns.
3. Use the following command to restart the PropertyTransform microserver:
systemctl restart twpas-property–transform.service
Update the Password in the Property Transform Microserver – Manual Process
Use the procedure below to manually update and encrypt the RabbitMQ password in the Property Transform microserver. If you are using Platform Analytics version 8.4.4 or later, you can use an easier scripted process to encrypt the new password. For more information, see the Scripted Process.
1. Open the terminal window as root user.
2. Locate the randomly-assigned key store folder names for Property Transform as follows:
Navigate to the /opt/ThingWorxAnalytics/PlatformAnalytics directory.
Open the platform-analytics-environment.properties file.
In the #keyStore section, make note of the following alphanumeric folder names that are randomly assigned during Property Transform installation:
key.store.directory
key.store.password.directory
key.store.password.file
key.store.file
Example folder names:
3. Run the following command, replacing the angle brackets with the randomly assigned alphanumeric folder names:
java -cp ccc-platform-bin.jar com.thingworx.analytics.ccc.platform.encryption.Encryptor <new_rabbit_mq_password> <key.store.password.directory> <key.store.directory> <key.store.password.file folder> <key.store.file folder> rabbitMQKey
Example command:
java -cp ccc-platform-bin.jar com.thingworx.analytics.ccc.platform.encryption.Encryptor updatedRabbitMQPassword /opt/ThingWorxAnalytics/PlatformAnalytics/988f188b /opt/ThingWorxAnalytics/PlatformAnalytics/d18429a3 2e3bb250 cd0e1544 rabbitMQKey
4. Use the following command to restart the PropertyTransform microserver:
systemctl restart twpas-property–transform.service
Was this helpful?