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 linux archive based installer(tar.gz) from the JFrog Xray Downloads page.
Extract the tar.gz file:
tar -xvf jfrog-xray-<version>-linux.tar.gz
OS user permissions for Linux archive
When running Xray, the installation script creates a user called xray by default, which must have run and execute permissions on the installation directory.
We recommend that you copy the Xray download file into a directory that gives run and execute permissions to all users such as /opt.
mkdir -p /opt/jfrog cp -r jfrog-xray-<version>-linux /opt/jfrog/ cd /opt/jfrog mv jfrog-xray-<version>-linux xray cd xray/app/bin
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 correct directory
Run the install.sh
Check prerequisites for Xray in Linux Archive before running install script.
./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.
Make sure to follow the instructions on the screen after the installation is completed regarding the below points
Xray directory should be owned by the xray usereg : `chown -R xray:xray /opt/jfrog/xray`
Switch to xray user, before you start the serviceeg: `su xray`
Note
Note: If you wish to use a custom password for RabbitMQ, perform the following steps before proceeding to Step 6:
Update the default_pass value in the rabbitmq.conf file with your desired password. Refer to this article for guidance.
vi xray/app/bin/rabbitmq/rabbitmq.conf
Update the system.yaml file with the same password in rabbitmq.conf.
vi 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:
xray/app/bin/xray.sh start|stop
RabbitMQ service should start; you can verify it by checking the status.
xray/app/bin/xray.sh status
(Optional) You can also install it as a service.
Xray is packaged as an archive file and you can use the install script to install it as a service running under a custom user. Currently supported on Linux systems.
Note
OS User Permissions
When running Xray as a service, the installation script creates a user called xray (by default)which must have run and execute permissions on the installation directory.
It is recommended to extract the Xray download file into a directory that gives run and execute permissions to all users such as /opt.
To install Xray as a service, execute the following command as root.
xray/app/bin/installService.sh -u | --user : [optional] (default: xray) user which will be used to run the product, it will be created if its unavailable -g | --group : [optional] (default: xray) group which will be used to run the product, it will be created if its unavailable
Note
Note
If you wish to change the user and group, it can be passed through xray/var/etc/system.yaml as shared.user and shared.group. This takes precedence over values passed through command line on install.
The user and group is stored in xray/var/etc/system.yaml at the end of installation. To manage the service, use systemd or init.d commands depending on your system.Using systemd
systemctl <start|stop|status> xray.service
Using init.d
service xray <start|stop|status>
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 for the fresh install node setup (step 1 and step 2) to obtain the Xray files on the additional node
Run install.sh fileCheck prerequisites for Xray in Linux Archive before running install script.
./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.
Make sure to follow the instructions on the screen after the installation is completed regarding the below points
Xray directory should be owned by the xray usereg : `chown -R xray:xray /opt/jfrog/xray`
Start rabbitmq as Xray usereg: `su xray`
If you are using a custom password, please follow the same steps done in first node
Start RabbitMQ service
xray/app/bin/xray.sh start|stop or via service systemctl <start|stop|status> xray.service
Verify the cluster status from the management UI. Access the UI through a browser
Note
Note: The credentials provided below are the default ones. If you have customized the RabbitMQ password in’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
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 linux archive based installer(tar.gz) from the JFrog Xray Downloads page.
Extract the tar.gz file:
tar -xvf jfrog-xray-<version>-linux.tar.gz
Note
OS user permissions for Linux archive
When running Xray, the installation script creates a user called xray by default, which must have run and execute permissions on the installation directory.
We recommend that you copy the Xray download file into a directory that gives run and execute permissions to all users such as /opt.
mkdir -p /opt/jfrog cp -r jfrog-xray-<version>-linux /opt/jfrog/ cd /opt/jfrog mv jfrog-xray-<version>-linux xray cd xray/app/bin
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 correct directory
Run the install.sh
Check prerequisites for Xray in Linux Archive before running install script.
./install.sh -t xray
Upon running the command, you will be prompted with a series of interactive installation questions.
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.
Provide the database connection details. Postgresql should be installed separately on a different 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>
Make sure to follow the instructions on the screen after the installation is completed regarding the below points
Xray directory should be owned by the xray usereg : `chown -R xray:xray /opt/jfrog/xray`
Switch to xray user, before you start the serviceeg: `su xray
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 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:
xray/app/bin/xray.sh start|stop or via service systemctl <start|stop|status> 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.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
Uninstallation
Read about Uninstalling JFrog Xray.