Install the following prerequisites independently of the Distribution archive installation. Make sure to install them before starting your Xray service.
PostgreSQL
Redis
For more information, see Third Party Applications for Distribution.
From Distribution 2.5.x, you need to first install PostgreSQL separately as the PostgreSQL binaries are no longer bundled with the Linux archive installer for Distribution.
Before you proceed, see System Requirements for information on supported platforms, supported browsers, and other requirements.
Complete the following steps to install the product.
Extract the contents of the compressed archive and move it into distribution directory.
tar -xvf jfrog-distribution-<version>-linux.tar.gz mv jfrog-distribution-<version>-linux distribution
Note
PostgreSQL is required and must be installed before continuing with the next installation steps.
Set your PostgreSQL connection details in the Shared Configurations section of the
$JFROG_HOME/distribution/var/etc/system.yaml
file.Start PostgreSQL.
Customize the product configuration.
Set the Artifactory connection details.
Customize the PostgreSQL Database connection details. (optional)
Set any additional configurations (for example: ports, node id) using the Distribution
system.yam
l configuration file.
Start and manage the Distribution service as the user who extracted the tar.
As a process
distribution/app/bin/distribution.sh start
Manage the process.
distribution/app/bin/distribution.sh start|stop|status|restart
As a service
Distribution is packaged as an archive file and an install script that can be used to install it as a service running under a custom user. Currently supported on Linux systems.
OS User Permissions
When running Distribution as a service, the installation script creates a user called
distribution
(by default)which must have run and execute permissions on the installation directory.It is recommended to extract the Distribution download file into a directory that gives run and execute permissions to all users such as
/opt
.To install Distribution as a service, execute the following command as root:
Note
User and group can be passed through
distribution/var/etc/system.yaml
asshared.user
andshared.group
. This takes precedence over values passed through the command line on install.distribution/app/bin/installService.sh --user <enter user, default value is distribution> --group <enter group, default value is distribution> -u | --user : [optional] (default: distribution) user which will be used to run the product, it will be created if its unavailable-g | --group : [optional] (default: distribution) group which will be used to run the product, it will be created if its unavailable
The user and group is stored in
distribution/var/etc/system.yaml
at the end of installation.To manage the service, use
systemd
orinit.d
commands depending on your system.Using systemd
systemctl <start|stop|status> distribution.service
Using init.d
service distribution <start|stop|status>
Access Distribution from your browser at:
http://<jfrogUrl>/ui/
.Go to theDashboard tab in theApplicationmodule in the UI.
Check the Distribution Log.
tail -f distribution/var/log/console.log
Configure log rotation of the console log
The
console.log
file can grow quickly since all services write to it. For more information, see configure the log rotation.
Third Party Applications for Distribution
PostgreSQL for Distribution
You must install PostgreSQL before you proceed with the installation of Distribution.
PostgreSQL for RPM
Install PostgreSQL.
Run the following commands from the extracted
jfrog-distribution-<version>/rpm
directory.# Use PostgreSQL RPMs with el6 when installing on Centos 6 and RHEL 6 and use postgresql13-13.3-1 packages # Use PostgreSQL RPMs with el8 when installing on Centos 8 and RHEL 8 mkdir -p /var/opt/postgres/data rpm -ivh --replacepkgs ./third-party/postgresql/libicu-50.2-3.el7.x86_64.rpm (only AWS instance) rpm -ivh --replacepkgs ./third-party/postgresql/postgresql13-libs-13.3-5PGDG.rhel7.x86_64.rpm rpm -ivh --replacepkgs ./third-party/postgresql/postgresql13-13.3-5PGDG.rhel7.x86_64.rpm rpm -ivh --replacepkgs ./third-party/postgresql/postgresql13-server-13.3-5PGDG.rhel7.x86_64.rpm chown -R postgres:postgres /var/opt/postgres export PGDATA="/var/opt/postgres/data" export PGSETUP_INITDB_OPTIONS="-D /var/opt/postgres/data" # For centos 7&8 / rhel 7&8 sed -i "s~^Environment=PGDATA=.*~Environment=PGDATA=/var/opt/postgres/data~" /lib/systemd/system/postgresql-13.service systemctl daemon-reload /usr/pgsql-13/bin/postgresql-13-setup initdb # For centos 6 / rhel 6 sed -i "s~^PGDATA=.*~PGDATA=/var/opt/postgres/data~" /etc/init.d/postgresql-13 service postgresql-13 initdb Replace "ident" and "peer" with "trust" in postgres hba configuration files ie /var/opt/postgres/data/pg_hba.conf
Configure PostgreSQL to allow external IP connections.
By default, PostgreSQL will only allow localhost clients communications. To enable different IP's to communicate with the database, you need to
configure the pg_hba.conf
file.The file is available at
/var/opt/postgres/data
.To grant all IPs access, add the following entry under the IPv4 local connections section.
host all all 0.0.0.0/0 trust
Add the following entry to
/var/opt/postgres/data
/postgresql.conf
.listen_addresses='*' port=5432
Start PostgreSQL.
systemctl start postgresql-<version>.service or service postgresql-<version> start
Set up the database and user.
Run the following commands to seed the tables and schema needed by Distribution.
sudo -u postgres psql -c "CREATE USER distribution WITH PASSWORD 'password';" sudo -u postgres psql -c "CREATE DATABASE distribution WITH OWNER=distribution ENCODING='UTF8';" sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE distribution TO distribution;" cp -f ./third-party/postgresql/createPostgresUsers.sh /tmp source /etc/locale.conf cd /tmp && su postgres -c "POSTGRES_PATH=/usr/pgsql-13/bin PGPASSWORD=postgres DB_PASSWORD=password bash /tmp/createPostgresUsers.sh"
PostgreSQL for Debian
We recommended to get your apt-get
libraries up-to-date by using the following commands.
apt-get update apt-get install -f -y apt-get update
Create the file repository configuration to pull PostgreSQL dependencies.
cp -f /etc/apt/sources.list /etc/apt/sources.list.origfile sh -c 'echo "deb http://ftp.de.debian.org/debian/ $(lsb_release -cs) main non-free contrib" >> /etc/apt/sources.list' sh -c 'echo "deb-src http://ftp.de.debian.org/debian/ $(lsb_release -cs) main non-free contrib" >> /etc/apt/sources.list' cp -f /etc/apt/sources.list.d/pgdg.list /etc/apt/sources.list.d/pgdg.list.origfile sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" >> /etc/apt/sources.list.d/pgdg.list' sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" >> /etc/apt/sources.list.d/pgdg.list' wget --no-check-certificate --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
Install PostgreSQL.
Run the following commands from the extracted
jfrog-distribution-<version>-deb
directory.mkdir -p /var/opt/postgres/data
Ubuntu 18.04 (bionic)
dpkg -i ./third-party/postgresql/postgresql-13_13.2-1.pgdg18.04+1_amd64.deb
Ubuntu 20.04 (focal)
dpkg -i ./third-party/postgresql/postgresql-13_13.2-1.pgdg20.04+1_amd64.deb
Debian 9 (stretch)
dpkg -i ./third-party/postgresql/postgresql-13_13.2-1.pgdg90+1_amd64.deb
Debian 10 (buster)
apt update -y apt-get install wget sudo -y apt-get install -y gnupg gnupg1 gnupg2 dpkg -i ./third-party/postgresql/postgresql-13_13.2-1.pgdg100+1_amd64.deb
Stop the PostgreSQL service.
systemctl stop postgresql.service
Change permissions for the PostgreSQL folder.
chown -R postgres:postgres /var/opt/postgres sed -i "s~^data_directory =.*~data_directory = '/var/opt/postgres/data'~" "/etc/postgresql/13/main/postgresql.conf" sed -i "s~^hba_file =.*~hba_file = '/var/opt/postgres/data/pg_hba.conf'~" "/etc/postgresql/13/main/postgresql.conf" sed -i "s~^ident_file =.*~ident_file = '/var/opt/postgres/data/pg_ident.conf'~" "/etc/postgresql/13/main/postgresql.conf" su postgres -c "/usr/lib/postgresql/12/bin/initdb --pgdata=/var/opt/postgres/data"
Configure PostgreSQL to allow external IP connections.
By default PostgreSQL will only allow localhost clients communications. To enable different IPs to communicate with the database you need to configure the
pg_hba.conf
file.The file is available at
/var/opt/postgres/data
.To grant all IPs access add the following entry under the IPv4 local connections section:
host all all 0.0.0.0/0 trust
Add the following entry to
/etc/postgresql/13/main/postgresql.conf
.listen_addresses='*' port=5432
Start PostgreSQL.
systemctl start postgresql-<version>.service or service postgresql-<version> start
Set up the database and user.
Run the following commands to seed the tables and schemas needed by Distribution
sudo -u postgres psql -c "CREATE USER distribution WITH PASSWORD 'password';" sudo -u postgres psql -c "CREATE DATABASE distribution WITH OWNER=distribution ENCODING='UTF8';" sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE distribution TO distribution;" cp -f ./third-party/postgresql/createPostgresUsers.sh /tmp source /etc/default/locale cd /tmp && su postgres -c "POSTGRES_PATH=/usr/lib/postgresql/13/bin PGPASSWORD=postgres DB_PASSWORD=password bash /tmp/createPostgresUsers.sh"
Put back the original
pgdg.list.
mv /etc/apt/sources.list.d/pgdg.list /etc/apt/sources.list.d/pgdg.list.tmp && cp -f /etc/apt/sources.list.d/pgdg.list.origfile /etc/apt/sources.list.d/pgdg.list
Remove the backup files.
rm -f /etc/apt/sources.list.d/pgdg.list.tmp rm -f /etc/apt/sources.list.d/pgdg.list.origfile
Put back the original
sources.list
.
mv /etc/apt/sources.list /etc/apt/sources.list.tmp && cp -f /etc/apt/sources.list.origfile /etc/apt/sources.list
Remove the backup files.
rm -f /etc/apt/sources.list.tmp && rm -f /etc/apt/sources.list.origfile
PostgreSQL for Linux Archive
PostgreSQL binaries are no longer bundled with Linux archive installer. You need to install PostgreSQL manually.
Run the following commands to seed the tables and schema needed by Distribution.
<pgsql bin path>/psql template1 <postgres prompt>: CREATE DATABASE <user_name>; <postgres prompt>: \q ## run the script to seed the tables and schemas needed by Distribution POSTGRES_PATH=<pgsql bin path> distribution/app/third-party/postgresql/createPostgresUsers.sh
Redis for Distribution
Redis Password Restrictions
Redis password should contain only alphanumeric characters and should not contain any special characters.
Redis RPM Installation
Run the following commands from the extracted jfrog-distribution-<version>-rpm
directory.
Use Redis RPMs with el6 when installing on Centos 6 and RHEL 6 Use Redis RPMs with el8 when installing on Centos 8 and RHEL 8 semodule -i ./third-party/redis/distribution-redis.pp rpm -ivh --replacepkgs ./third-party/redis/jemalloc-3.6.0-1.el7.x86_64.rpm rpm -ivh --replacepkgs ./third-party/redis/redis-6.0.5-1.el7.remi.x86_64.rpm service redis start # To verify if Redis is working. The command should return PONG. redis-cli -a password ping sed -i "s|# requirepass foobared|requirepass password|g" /etc/redis.conf echo "appendonly yes" >> /etc/redis.conf echo "appendfsync everysec" >> /etc/redis.conf sysctl vm.overcommit_memory=1 service redis restart
Redis Debian Installation
Run the following commands from the extracted jfrog-distribution-<version>-deb
directory.
dpkg -i ./third-party/redis/redis-tools_6.0.5-1chl1_xenial1_amd64.deb dpkg -i ./third-party/redis/redis-server_6.0.5-1chl1_xenial1_amd64.deb service redis-server start # To verify if Redis is working. The command should return PONG. redis-cli -a password ping sed -i "s|# requirepass foobared|requirepass password|g" /etc/redis/redis.conf echo "appendonly yes" >> /etc/redis/redis.conf echo "appendfsync everysec" >> /etc/redis/redis.conf sysctl vm.overcommit_memory=1 service redis-server restart
Redis Linux Archive Installation
Redis binaries are available in jfrog-distribution-<version>-linux/app/third-party/redis/bin
. You must setup the Redis server before you install Distribution.