Lanyiyun: Linux installation and uninstallation RabbitMQ tutorial

Installing and uninstalling RabbitMQ is a critical step in using this message queue middleware on Linux systems. Here is a tutorial for installing and uninstalling RabbitMQ:

Install RabbitMQ tutorial:

  1. Add RabbitMQ source:
    Open the terminal and execute the following command to add RabbitMQ APT source (applicable to Debian/Ubuntu):
echo 'deb http://www.rabbitmq.com/debian/ testing main' | sudo tee /etc/apt/sources.list.d/rabbitmq.list
  1. Import RabbitMQ public key:
    Import RabbitMQ's public key for verification:
wget -O- https://www.rabbitmq.com/rabbitmq-release-signing-key.asc | sudo apt-key add -
  1. Update the APT cache:
    Execute the following command to update the APT cache:
sudo apt update
  1. Install RabbitMQ:
    Execute the following commands to install the RabbitMQ server and management plug-in:
sudo apt install rabbitmq-server
  1. Start the RabbitMQ service:
    Execute the following command to start the RabbitMQ service:
sudo systemctl start rabbitmq-server
  1. Set the RabbitMQ service to start automatically at boot:
    Execute the following command to set the RabbitMQ service to start automatically at boot:
sudo systemctl enable rabbitmq-server

Tutorial on uninstalling RabbitMQ:

  1. Stop the RabbitMQ service:
    Open the terminal and execute the following command to stop the RabbitMQ service:
sudo systemctl stop rabbitmq-server
  1. Remove the RabbitMQ software package:
    Execute the following command to remove the RabbitMQ software package:
sudo apt remove rabbitmq-server
  1. Delete the RabbitMQ data directory:
    Execute the following command to delete the RabbitMQ data directory (use with caution, all data will be cleared):
sudo rm -rf /var/lib/rabbitmq/
  1. Delete the RabbitMQ configuration file:
    Execute the following command to delete the RabbitMQ configuration file (use with caution, it will clear all configurations):
sudo rm -rf /etc/rabbitmq/

Through the above steps, you have successfully installed and uninstalled RabbitMQ on your Linux system. After installation, the RabbitMQ service will automatically start and be set to start at boot. After uninstallation, related software packages and configuration information will be removed to ensure the cleanliness of the system.

Guess you like

Origin blog.csdn.net/tiansyun/article/details/133279419