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.
Download the Xray RPM/DEB-based installer(tar.gz) from the JFrog Xray Downloads page.
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
Run the install.sh
./install.sh -t rabbitmq
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.
Note
Note: If you wish to use a custom password for RabbitMQ, perform the following steps before proceeding to Step 5:
Update the default_pass value in the rabbitmq.conf file with your desired password.
vi /opt/jfrog/xray/app/bin/rabbitmq/rabbitmq.conf
Update the system.yaml file with the same password in rabbitmq.conf.
vi /var/opt/jfrog/xray/etc/system.yaml
Important: Ensure this step is repeated on all RabbitMQ nodes, and verify that the custom password remains consistent across the cluster.
Start RabbitMQ service.
systemctl start xray-rabbitmq.service
RabbitMQ service should start; you can verify it by checking the status.
systemctl status xray-rabbitmq.service
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.
Repeat steps 1 to 3 from the initial node setup to obtain the Xray files on the additional node.
Run install.sh file
./install.sh -t rabbitmq
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.
Start RabbitMQ service.
systemctl start xray-rabbitmq.service
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
You can verify the cluster from the Management UI; see the screenshot below.
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.
Download the Xray RPM/DEB-based installer(tar.gz) from the JFrog Xray Downloads page.
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
Run the install.sh
./install.sh -t xray
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.
Confirm the installation directory by pressing ENTER
Provide the URL of your JFrog Platform( Artifactory) instance in the format:<http://artifactory_node_ip:port>
Obtain the Join Key by navigating to Administration > Security > General > Connection Details in Artifactory.
Enter the platform password to access the details.
Copy the Join Key and use it when prompted.
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>].
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.
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:
Connection URL: postgres://<IP_ADDRESS>:<PORT>/<database name>?sslmode=disable
Database Username: <YOUR_DATABASE_USERNAME>
Database Password: <YOUR_DATABASE_PASSWORD>
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.
Start Xray service:
systemctl start xray.service
Once the Xray service is started successfully, you can access it via the user interface or APIs.
Adding Nodes to Form an Xray Cluster:
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.
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.
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
Uninstallation
Read about Uninstalling JFrog Xray.