RabbitMQ (Split) Fresh Installation Guide Docker Compose

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 docker compose-based installer(tar.gz) from the JFrog Xray Downloads page.

  2. Extract the tar.gz file:

    tar -xvf jfrog-xray-<version>-compose.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>-compose
  3. Run the config.sh

    ./config.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. This file is mounted inside the rabbitmq container. If you have changed the ROOT_DATA_DIR in the docker-compose env file, edit the rabbitmq.conf file in the right location

      vi /root/.jfrog/xray/app/third-party/rabbitmq/rabbitmq.conf
      2.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.

    docker-compose -p xray-rabbitmq -f docker-compose-rabbitmq.yaml up -d
  6. RabbitMQ service should start; you can verify it by checking the logs

    docker ps
    docker logs -f xray_rabbitmq
  7. Verify the cluster status from the management UI. Access the UI through a browser

    3.png

    Note

    Note: The credentials provided below are the default ones. If you have customized the RabbitMQ password in’/root/.jfrog/xray/app/third-party/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 2 from the initial node setup to obtain the Xray files on the additional node.

  2. Run install.sh file

    ./config.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 and also the IP of the active node name in the next step.

    4.png
  4. If you use a custom password, please follow the instructions mentioned in the initial node setup.

  5. Start RabbitMQ service.

    docker-compose -p xray-rabbitmq -f docker-compose-rabbitmq.yaml up -d
  6. RabbitMQ service should start. You can verify it by checking the logs.

    docker ps
    docker logs -f xray_rabbitmq
    
  7. Verify the cluster status from the management UI to confirm the nodes are connected to each other

    Note

    Note: The credentials provided below are the default ones. If you have customized the RabbitMQ password in’/root/.jfrog/xray/app/third-party/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

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

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 docker compose-based installer(tar.gz) from the JFrog Xray Downloads page.

  2. Extract the tar.gz file:

    tar -xvf jfrog-xray-<version>-compose.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>-compose
  3. Run the config.sh

    ./config.sh -t xray
  4. Upon running the command, you will be prompted with interactive installation questions.

    1. Before performing this upgrade, have you disconnected Artifactory Xray pairings, except one (Refer http://service.jfrog.org/wiki/Xray+and+Artifactory+One+to+One+Pairing for more details)? - You can choose y. This step was added for migrating from older 2.x to 3.x versions. If you are already on xray 3.x, type y.

    2. Installation Directory (Default: /root/.jfrog/xray) - Choose defaults or change if needed.

    3. Provide the URL of your JFrog Platform( Artifactory) instance in the format:<http://artifactory_node_ip:port>

    4. 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.

    5. 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>].

    6. 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.

    7. Provide the database connection details. Postgresql should be installed separately on a different 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>

        5.png
  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 /root/.jfrog/xray/var/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.

    6.png
  6. Start Xray service.

    docker-compose -p xray up -d
  7. Xray services should start; you can verify it by checking the logs.

    docker ps
    docker logs -f xray_router ## or any other xray services.
    

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.

7.png

After installing, modify the system.yml 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 xray/etc/system.yaml
8.png
Uninstallation

Read about Uninstalling JFrog Xray.