RabbitMQ New Installation Guide RPM/DEB

JFrog Installation & Setup Documentation

Content Type
Installation & Setup
ft:sourceType
Paligo
Installation Procedure

This process consists of two main stages: setting up the RabbitMQ cluster and configuring the Xray node cluster.

Stage 1: Setting Up the RabbitMQ Cluster

This stage focuses on configuring the RabbitMQ cluster. Since Xray relies on RabbitMQ for its operation, completing this step is crucial. Before proceeding, ensure that you are logged in as the root user.

  1. Download the Xray RPM/DEB-based installer(tar.gz) from the JFrog Xray Downloads page.

  2. Extract the tar.gz file:

    tar -xvf jfrog-xray-<version>-rpm/deb.tar.gz
    

    Note

    Note: From 3.107 onwards, JFrog Xray installers have organized files into designated subfolders. After extracting the tar.gz file, ensure you navigate to the xray directory.

    cd jfrog-xray-<version>-rpm/deb
  3. Run the install.sh

    ./install.sh -t rabbitmq
  4. Once you run the command, you will be prompted to confirm whether this node will join an existing cluster. Since this is a fresh installation on the first node, please type "N" to indicate no.

    1.png

    Note

    Note: If you wish to use a custom password for RabbitMQ, perform the following steps before proceeding to Step 5:

    1. Update the default_pass value in the rabbitmq.conf file with your desired password.

      vi /opt/jfrog/xray/app/bin/rabbitmq/rabbitmq.conf
      2.png
    2. Update the system.yaml file with the same password in rabbitmq.conf.

      vi /var/opt/jfrog/xray/etc/system.yaml
      
      3.png

      Important: Ensure this step is repeated on all RabbitMQ nodes, and verify that the custom password remains consistent across the cluster.

  5. Start RabbitMQ service.

    systemctl start xray-rabbitmq.service
  6. RabbitMQ service should start; you can verify it by checking the status.

    systemctl status xray-rabbitmq.service
    4.png
  7. Access the UI through a browser to verify if the management plugin is enabled.

    Note

    Note: The credentials provided below are the default ones. If you have customized the RabbitMQ password in ’/opt/jfrog/xray/app/bin/rabbitmq/rabbitmq.conf’, ensure you use the correct password when accessing the management UI.

    http://<your-node-ip>:15672
    
    Username:  guest
    Password:  JFXR_RABBITMQ_COOKIE

Adding Nodes to Form a RabbitMQ Cluster

Now that RabbitMQ is running on the first node, we need to install RabbitMQ on additional nodes and integrate them into the existing cluster. In this example, we will install RabbitMQ on two more nodes and join them in the cluster.

  1. Repeat steps 1 to 3 from the initial node setup to obtain the Xray files on the additional node.

  2. Run install.sh file

    ./install.sh -t rabbitmq
  3. Once you execute the command, you will be prompted to confirm whether this node will join an existing RabbitMQ cluster. Since we already have an active RabbitMQ node, type Y and press Enter. Next, you will be asked to provide the name of the active RabbitMQ node. Here, you should input the hostname of the active RabbitMQ node.

    5.png
  4. Start RabbitMQ service.

    systemctl start xray-rabbitmq.service
  5. RabbitMQ service should start; you can verify it by checking the status.

    systemctl status xray-rabbitmq.service

Repeat steps 1 through 5 to set up the additional RabbitMQ node and integrate it into the existing cluster.

Verify the RabbitMQ cluster status.

After installing and starting RabbitMQ on all required nodes, confirm that the cluster functions correctly and all nodes are properly joined.

Note

Note: Since the value of $HOME differs for each user, placing a copy of the cookie file for every user who will use the CLI tools, including both non-privileged users and root, is essential.The xray user, automatically created by the installer script, can execute the cluster_status command. To switch to the xray user, run:

su xray

Navigate to the RabbitMQ sbin directory and execute the cluster_status commands.

$ cd /opt/jfrog/xray/app/third-party/rabbitmq/sbin
$ ./rabbitmqctl cluster_status
6.png

You can verify the cluster from the Management UI; see the screenshot below.

7.png

Stage 2: Setting Up the Xray Node Cluster

Once the RabbitMQ cluster is successfully configured, set up the Xray node cluster, which will integrate with the previously configured RabbitMQ cluster.

  1. Download the Xray RPM/DEB-based installer(tar.gz) from the JFrog Xray Downloads page.

  2. Extract the tar.gz file:

    tar -xvf jfrog-xray-<version>-rpm/deb.tar.gz

    Note

    Note: From 3.107 onwards, JFrog Xray installers have organized files into designated subfolders. After extracting the tar.gz file, ensure you navigate to the xray directory.

    cd jfrog-xray-<version>-deb
  3. Run the install.sh

    ./install.sh -t xray
  4. Upon running the command, you will be prompted with a series of interactive installation questions; refer to the screenshot attached for details about the mentioned steps.

    1. Confirm the installation directory by pressing ENTER

    2. Provide the URL of your JFrog Platform( Artifactory) instance in the format:&lt;http://artifactory_node_ip:port&gt;

    3. Obtain the Join Key by navigating to Administration > Security > General > Connection Details in Artifactory.

      1. Enter the platform password to access the details.

      2. Copy the Join Key and use it when prompted.

    4. Specify the machine's IP address:  You can manually input the current node's IP address or press ENTER to use the default, as the system automatically detects the current node's IP address. For IPv6, ensure the address is enclosed in square brackets: [<ipv6_address>].

    5. Are you adding an additional node to the existing product cluster? For the first node of Xray, select N (No), as this will set up a new cluster. For subsequent nodes, select Y (Yes). The process for adding additional nodes is detailed in later steps.

    6. Do you want to install Postgresql? Select N (No) and press ENTER, as we use a PostgreSQL instance installed on a separate node. Provide the following database connection details:

      1. Connection URL: postgres://<IP_ADDRESS>:<PORT>/<database name>?sslmode=disable

      2. Database Username: <YOUR_DATABASE_USERNAME>

      3. Database Password: <YOUR_DATABASE_PASSWORD>

    8.jpg
  5. Before starting the Xray service, update the system.yaml file with the RabbitMQ cluster URLs and credentials for all nodes in the cluster. Ensure that all RabbitMQ node URLs are correctly listed and include the appropriate username and password for authentication. This configuration ensures Xray can communicate effectively with the RabbitMQ cluster and save the changes.

    vi /var/opt/jfrog/xray/etc/system.yaml
    

    Note

    Note: If using a custom RabbitMQ password, ensure the same password is configured in Xray’s system.yaml file under the RabbitMQ section to maintain consistency.

    9.png
  6. Start Xray service:

    systemctl start xray.service
  7. Once the Xray service is started successfully, you can access it via the user interface or APIs.

Adding Nodes to Form an Xray Cluster:

  1. Install Xray on a new node by repeating the initial Xray node setup steps. During the installation, you will be prompted to ask, "Are you adding an additional node to an existing product cluster? [y/N]?" At this point, select Y to confirm that this is an additional node for the X-ray cluster.

  2. In the next step, you will be prompted to provide the master_key. You can retrieve this key from the first node by executing the following command:

    cat /var/opt/jfrog/xray/etc/security/master.key

The remaining installation steps for the new node should be carried out like for the first node.

10.png

After installing, modify the system.yaml file to update the RabbitMQ URLs. Change the order of the URLs to optimize load balancing and prevent all Xray nodes from connecting to the same RabbitMQ node. For example, if the RabbitMQ node URL order in the first Xray node is 1,2,3, then in the second node, it should be 2,3,1, and in the third node, it could be 3,1,2. This ensures that each Xray node connects to different RabbitMQ nodes, improving fault tolerance and distributing the load efficiently.

vi /var/opt/jfrog/xray/etc/system.yaml
11.png
Uninstallation

Read about Uninstalling JFrog Xray.