Xray Single Node Interactive Script Installation
Install Xray single-node using interactive script supporting RPM, archive, Debian, and Docker Compose methods.
Prerequisites
Check and follow the prerequisites before proceeding with the installation.
Follow these steps to install the product:
-
Download the Xray Compressed Archive, extract its contents, and go to the extracted folder. Visit the Download page to get the Xray compressed archive.
Alternatively, if you are working on a VM without access to the UI, you can download the archive directly using
curl. Replace[RELEASE]with the desired Xray version, for example3.143.32.Docker Compose
curl -L -J -O "https://releases.jfrog.io/artifactory/jfrog-xray/xray-compose/[RELEASE]/jfrog-xray-[RELEASE]-compose.tar.gz" tar -xvf jfrog-xray-<version>-compose.tar.gz cd jfrog-xray-<version>-composeRPM
curl -L -J -O "https://releases.jfrog.io/artifactory/jfrog-xray/xray-rpm/[RELEASE]/jfrog-xray-[RELEASE]-rpm.tar.gz" tar -xvf jfrog-xray-<version>-rpm.tar.gz cd jfrog-xray-<version>-rpmDebian
curl -L -J -O "https://releases.jfrog.io/artifactory/jfrog-xray/xray-deb/[RELEASE]/jfrog-xray-[RELEASE]-deb.tar.gz" tar -xvf jfrog-xray-<version>-deb.tar.gz cd jfrog-xray-<version>-debLinux Archive
curl -L -J -O "https://releases.jfrog.io/artifactory/jfrog-xray/xray-linux/[RELEASE]/jfrog-xray-[RELEASE]-linux.tar.gz" tar -xvf jfrog-xray-<version>-linux.tar.gz cd jfrog-xray-<version>-linux -
Run the installer script.
The script prompts you with a series of mandatory inputs, including the jfrogURL (custom base URL) and joinKey
Recommended installer script
Use
installV2.sh/configV2.sh— this is the recommended installer script.Use
install.sh/config.shonly if you were already using it previously. If you're already oninstallV2.sh/configV2.sh, continue using it for future upgrades and for fresh installations.For a fresh setup, always use Quorum Queues and RabbitMQ 4.x.
RPM or Debian
./installV2.shDocker Compose
./configV2.sh.env file included within the Docker-Compose archive
The .env file is used by docker-compose and is updated during installations and upgrades.
Some operating systems do not display dot files by default. If you make any changes to the file, remember to backup before an upgrade.
Linux archive
Check prerequisites before running install script.
curl -L -J -O "https://releases.jfrog.io/artifactory/jfrog-xray/xray-linux/[release]/jfrog-xray-[release]-linux.tar.gz"You can extract the file at any folder of your choice, but we recommend that you extract the Xray download file into a directory that gives run and execute permissions to all users such as /opt.
mv jfrog-xray-[release]-linux xray
sudo mkdir -p /opt/jfrog
sudo mv xray /opt/jfrog/
sudo ./opt/jfrog/xray/app/bin/installV2.shNote
installV2.shalso accepts the following options:./installV2.sh --user <user name> --group <group name> -h | --help : [optional] display usage -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
- The installer script will prompt you to select the installation combination between RabbitMQ and Xray. For the split architecture of RabbitMQ and Xray, please refer to this section.
- The script will prompt you for the selection of RabbitMQ version and the Quorum Queue selection.
- You will be prompted to enter a custom RabbitMQ username and password.
- The installer script will prompt the
JFrog URLand theJoinKeyof the Artifactory to join the JFrog Platform cluster. Find the join key in the JPD UI under the Administration module | Security | General | Connection Details. Enter your login password in the Current Password field and click Unlock.
-
Start and manage the Xray service.
Important
If you want the script to perform stop and restart action on RabbitMQ, set shared.rabbitMq.autoStop as true in the system.yaml. This flag is not consumed in docker-compose installation.
Initialize the service
When running Xray, the installation script creates a user called xray by default, which must have run and execute permissions on the installation directory.
Linux Archive
tar -xvf jfrog-xray-<version>-linux.tar.gz
cd jfrog-xray-<version>-linuxsudo chown -R xray:xray /opt/jfrog/xray
sudo su xray
/opt/jfrog/xray/app/bin/xray.sh startNote
Additionally, you can install Xray as a system service using the install script
installService.sh.
systemd OS (Debian/RPM/Linux Archive)
systemctl start|stop xray.servicesystemv (Debian/RPM/Linux Archive)
service xray start|stopDocker Compose
cd jfrog-xray-<version>-compose
# Starting from Xray 3.8x RabbitMQ has been moved to a compose file of its own, this needs to be started before starting other services
docker-compose -p xray-rabbitmq -f docker-compose-rabbitmq.yaml up -d
# Starting from 3.8.x, PostgreSQL needs to be started before starting the other services.
docker-compose -p xray-postgres -f docker-compose-postgres.yaml up -d
docker-compose -p xray up -d
docker-compose -p xray ps
docker-compose -p xray down-
Check the Xray log.
tail -f $JFROG_HOME/xray/var/log/console.log tail -f $JFROG_HOME/xray/var/log/xray-server-service.log -
Access Xray from your browser at:
http://<jfrogUrl>/ui/:port.Go to the Xray Security & Compliance tab in the Administration module in the UI.
After installing and before running Xray, you may set the following configurations.
You can configure all your system settings using the system.yaml file located in the $JFROG_HOME/xray /var/etc folder. For more information, see Xray System YAML.
For the Helm charts, the system.yaml file is managed in the chart’s values.yaml.
Xray requires a working Artifactory server and a suitable license. The Xray connection to Artifactory requires the following parameters.
-
jfrogUrl
URL to the machine where JFrog Artifactory is deployed, or the load balancer pointing to it. We recommend using DNS names rather than direct IPs. For example:
http://jfrog.acme.comorhttp://10.20.30.40:8082. Note that/artifactorycontext is not longer required.Set it in the Shared Configurations section of the
$JFROG_HOME/xray/var/etc/system.yamlfile. -
join.key
This is the "secret" key required by Artifactory for registering and authenticating the Xray server.
You can fetch the Artifactory
joinKey(join Key) from the JPD UI in the User Management | Settings | Join Key.Set the join.key used by your Artifactory server in the Shared Configurations section of the
$JFROG_HOME/xray/var/etc/system.yamlfile.
Xray comes bundled with a PostgreSQL database out-of-the-box, which come pre-configured with the default credentials.
To change the default credentials:
# Access PostgreSQL as the Xray user adding the optional -W flag to invoke the password prompt
$ psql -d xraydb -U xray -W
# Securely change the password for user "xray". Enter and then retype the password at the prompt.
\password xray
# Verify the update was successful by logging in with the new credentials
$ psql -d xraydb -U xray -WSet your PostgreSQL connection details in the Shared Configurations section of the $JFROG_HOME/xray/var/etc/system.yaml file.
Xray comes pre-installed with RabbitMQ, by setting the Erlang cookie value as the RabbitMQ password for guest users.
Configuring RabbitMQ to Use Fully Qualified Domain Names (FQDN)
By default, RabbitMQ uses the short hostnames of other nodes in the cluster for communication. However, it be can be configured to use a fully qualified domain name (FQND) host name (a long hostname).
To configure RabbitMQ to use FQDN, follow these steps.
-
Install Xray , but do not start the services.
-
Modify the following files according to the installer type.
- Docker-Compose
In docker-compose-rabbitmq.yaml:
environment:
- RABBITMQ_USE_LONGNAME=true
In .env:
HOST_ID=<long hostname>
## For secondary nodes only, provide the hostname of any of the active nodes where RabbitMQ service is running.
#JF_SHARED_RABBITMQ_ACTIVE_NODE_NAME=<long hostname of active node>-
Linux and Native Installers
In JFROG_HOME/app/bin/xray.default: export RABBITMQ_USE_LONGNAME=true -
Common Change in All Installers
In system.yaml: shared: node: id: <long hostname> name: <long hostname> ## For secondary nodes only, provide the hostname of any of the active nodes where RabbitMQ service is running. # shared: # rabbitMq: # active: # node: # name: <long hostname of active node>
- Start RabbitMQ and the Xray services.
Related Topics
Updated about 1 month ago
