Cloud customer?
 Upgrade in MyJFrog >

Search





Overview

This page provides a guide for the different ways you can install and configure JFrog Distribution, single node and high availability. Additional information on high availability can be found here.

To install Distribution  2.x, you must first install JFrog Artifactory 7.x.

Before you install Distribution please refer to additional information on supported platforms, browsers and other requirements, and the system architecture.

Installation Steps

The installation procedure involves the following main steps:

  1. Download Distribution as per your required installer type (Docker Compose, RPM, Debian).
  2. Install Distribution either as a single node installation, or high availability cluster.
    1. Install third party dependencies (PostgreSQL and Redis database, included in the archive)
    2. Install Distribution
  3. Configure the service
    1. Connection to Artifactory (joinKey and jfrogUrl)
    2. Additional optional configuration including changing default credentials for databases
  4. Start the Service using the start scripts or OS service management.
  5. Check the Service Log to check the status of the service.


Once you have finished the set up of JFrog Distribution, continue to Configuring Distribution.


Page Contents

Default Home Directory / $JFROG_HOME

The default Distribution home directory is defined according to the installation type. For additional details see the Product Directory Structure page.

Note: This guide uses $JFROG_HOME to represent the JFrog root directory containing the deployed product.

Single Node Installation

The following installation methods are supported:

Interactive Script Installation (recommended)

All install types are supported, including: Docker Compose, RPM and Debian.

The installer script provides you an interactive way to install Distribution and its dependencies. All install types are supported.

  1. Download Distribution.
  2. Extract the contents of the compressed archive and go to the extracted folder.

    tar -xvf jfrog-distribution-<version>-<compose|rpm|deb>.tar.gz
    cd jfrog-distribution-<version>-<compose|rpm|deb>

    .env file included within the Docker-Compose archive

    This .env file is used by docker-compose and is updated during installations and upgrades.

    Notice that some operating systems do not display dot files by default. If you make any changes to the file, remember to backup before an upgrade.

    OS user permissions for Linux archive

    When running Distribution, 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.

    Linux archive
    mv jfrog-distribution-<version>-linux.tar.gz /opt/
    cd /opt
    tar -xf jfrog-distribution-<version>-linux.tar.gz
    mv jfrog-distribution-<version>-linux distribution
  3. Run the installer script.
    Note: the script will prompt you with a series of mandatory inputs, including the jfrogURL (custom base URL) and joinKey.

    Docker Compose
    ./config.sh
    RPM/DEB
    ./install.sh

    Prerequisites for Linux archive

    Refer to the prerequisites for Distribution in Linux Archive before running the install script. 

    Linux archive
    distribution/app/bin/install.sh --user <user name> --group <group name>
    
    -h | --help                                       : [optional] display usage
    -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



  4. Validate and customize the product configuration (optional), including the third party dependencies connection details and ports.
  5. Start and manage the Distribution service.

    systemd OS
    systemctl start|stop distribution.service
    systemv
    service distribution start|stop
    Docker Compose
    cd jfrog-distribution-<version>-compose
    
    # Starting from Distribution 2.5.x Redis has been moved to a compose file of its own, this needs to be started before starting other services
    docker-compose -p distribution -redis -f docker-compose-redis.yaml  up -d
    
    # Starting from 2.5.x, PostgreSQL needs to be started before starting the other services.
    docker-compose -p distribution ps -postgres -f docker-compose-postgres.yaml up -d
    
    docker-compose -p distribution up -d
    docker-compose -p distribution ps
    docker-compose -p distribution down

    Distribution can be installed and managed as a service in Linux archive installation. Refer to the Start Distribution section under Linux Archive Manual Installation for more details. 

    Linux archive
    distribution/app/bin/distribution.sh start|stop
  6. Access Distribution from your browser at: http://<jfrogUrl>/ui/, go the Distribution tab in the Application module in the UI.
  7. Check Distribution Log.

    tail -f $JFROG_HOME/distribution/var/log/console.log

    Configuring the Log Rotation of the Console Log

    The console.log file can grow quickly since all services write to it. This file is not log rotated for Darwin installations. Learn more on how to configure the log rotation.

Manual RPM Installation

The RPM installation bundles Distribution and all its dependencies. It is provided as native RPM packages, where Distribution and its dependencies must be installed separately. Use this if you are automating installations.

  1. Download Distribution.

    tar -xvf jfrog-distribution-<version>-rpm.tar.gz
    cd jfrog-distribution-<version>-rpm
  2. Extract the contents of the compressed archive, and go to the extracted folder:

  3. Install PostgreSQL.

    Already have a PostgreSQL installation? Set your PostgreSQL connection details in the Shared Configurations section of the $JFROG_HOME/distribution/var/etc/system.yaml file.

  4. Install Redis.

  5. Install Distribution. You must run as a root user.

    rpm -Uvh --replacepkgs ./distribution/distribution.rpm
  6. Customize the product configuration.
    1. Set the Artifactory connection details.
    2. Customize the PostgreSQL Database connection details. (optional)
    3. Set any additional configurations (for example: ports, node id) using the Distribution system.yaml file.
  7. Start and manage the Distribution service.

    systemd OS
    systemctl start|stop distribution.service
    systemv OS
    service distribution start|stop|status|restart
  8. Access Distribution from your browser at: http://<jfrogUrl>/ui/, go the Distribution tab in the Application module in the UI.
  9. Check Distribution Log.

    Linux
    tail -f $JFROG_HOME/distribution/var/log/console.log

Manual Debian Installation

The Debian installation bundles Distribution and all its dependencies. It is provided as native Debian packages, where Distribution and its dependencies must be installed separately. Use this if you are automating installations.

  1. Download Distribution.
  2. Extract the contents of the compressed archive, and go to the extracted folder:

    tar -xvf jfrog-distribution-<version>-deb.tar.gz
    cd jfrog-distribution-<version>-deb
  3. Install PostgreSQL.

    Already have a PostgreSQL installation? Set your PostgreSQL connection details in the Shared Configurations section of the $JFROG_HOME/distribution/var/etc/system.yaml file.

  4. Install Redis.
  5. Install Distribution. You must run as a root user.

    dpkg -i ./distribution/distribution.deb
  6. Customize the product configuration.
    1. Set the Artifactory connection details.
    2. Customize the PostgreSQL Database connection details. (optional)
    3. Set any additional configurations (for example: ports, node id) using the Distribution system.yaml file.
  7. Start and manage the Distribution service.

    systemd OS
    systemctl start|stop distribution.service
    systemv OS
    service distribution start|stop|status|restart
  8. Access Distribution from your browser at: http://<jfrogUrl>/ui/, go the Distribution tab in the Application module in the UI.
  9. Check Distribution Log.

    Linux
    tail -f $JFROG_HOME/distribution/var/log/console.log

Manual Linux Archive Installation  

Prerequisites

The following prerequisites must be installed independently of the Distribution archive installation. Please make sure to install them before staring your Distribution service.

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. 

Install Steps

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

    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.

  2. Start PostgreSQL.

  3. Customize the product configuration.
    1. Set the Artifactory connection details.
    2. Customize the PostgreSQL Database connection details. (optional)
    3. Set any additional configurations (for example: ports, node id) using the Distribution system.yaml configuration file.
  4. Start and manage the Distribution service as the user who extracted the tar.
    As a process

    Daemon 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: 

    User and group can be passed through distribution/var/etc/system.yaml as shared.user and shared.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 will be stored in distribution/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> distribution.service
    Using init.d
    service distribution <start|stop|status>
  5. Access Distribution from your browser at: http://<jfrogUrl>/ui/, go to the Dashboard tab in the Application module in the UI.
  6. Check the Distribution Log.

    tail -f distribution/var/log/console.log

Helm Installation

Deploying Distribution for Small, Medium or Large Installations

In the chart directory, includes three values files, one for each installation type--small/medium/large. These values files are recommendations for setting resources requests and limits for your installation. You can find the files in the corresponding chart directory.

  1. Add the ChartCenter Helm repository to your Helm client.

    helm repo add center https://repo.chartcenter.io
    
  2. Update the repository.

    helm repo update
  3. Initiate installation by providing a join key and JFrog url as a parameter to the Distribution chart installation.

    helm upgrade --install distribution --set distribution.joinKey=<YOUR_PREVIOUSLY_RETIREVED_JOIN_KEY> \
                 --set distribution.jfrogUrl=<YOUR_PREVIOUSLY_RETIREVED_BASE_URL> --namespace distribution center/jfrog/distribution

    Alternatively, you can create a secret containing the join key manually and pass it to the template during install/upgrade.

    # Create a secret containing the key. The key in the secret must be named join-key
    kubectl create secret generic my-secret --from-literal=join-key=<YOUR_PREVIOUSLY_RETIREVED_JOIN_KEY>
    
    # Pass the created secret to helm
    helm upgrade --install distribution --set distribution.joinKeySecretName=my-secret --namespace distribution center/jfrog/distribution

    In either case, make sure to pass the same join key on all future calls to helm install and helm upgrade. This means always passing --set distribution.joinKey=<YOUR_PREVIOUSLY_RETRIEVED_JOIN_KEY>. In the second, this means always passing --set distribution.joinKeySecretName=my-secret and ensuring the contents of the secret remain unchanged.

  4. Customize the product configuration (optional) including database, Java Opts, and filestore.

    Unlike other installations, Helm Chart configurations are made to the values.yaml and are then applied to the system.yaml.

    Follow these steps to apply the configuration changes.

    1. Make the changes to values.yaml. 
    2. Run the command.

      helm upgrade --install distribution --namespace distribution -f values.yaml

  5. Access Distribution from your browser at: http://<jfrogUrl>/ui/, then go to the Security & Compliance tab in the Application module in the UI.

  6. Check the status of your deployed Helm releases.

    helm status distribution

For advanced installation options, see Helm Charts Installers for Advanced Users.


HA Installation

The following describes how to set up an Distribution HA cluster with two or more nodes. For more information, see the System Architecture.

Prerequisites

All nodes within the same Distribution HA installation must be running the same Distribution version.

Database

Distribution HA requires an external PostgreSQL database. Make sure to install it before proceeding to install the first node. There are several ways to setup PostgreSQL for redundancy. Including: HA, Load Balancing and Replication. For more information, see the PostgreSQL documentation.

Network

  • All the Distribution HA components (Distribution cluster nodes and database server) must be within the same fast LAN.

  • All the HA nodes must communicate with each other through dedicated TCP ports.

The following installation methods are supported:

Linux Archive/RPM/Debian Installation

First node installation steps:

  1. Install the first node. The installation is identical to the single node installation. Important: make sure not to start Distribution.
  2. Configure the $JFROG_HOME/distribution/var/etc/system.yaml file with the database and first node configuration details. For example,

    First node system.yaml
    shared:
      database:
        type: postgresql
        driver: org.postgresql.Driver
        url: jdbc: postgresql://<PosgreSQL_Host_IP_address>:<postgres_port>/distribution?sslmode=disable
        username: distribution
        password: password
      security:
        joinKey: <join_key>
  3. Start and manage the Distribution service.

    systemd OS
    systemctl start|stop distribution.service
    Systemv OS
    service distribution start|stop
  4. Access Distribution from your browser at: http://<jfrogUrl>/ui/, go the Distribution tab in the Application module in the UI.
  5. Check Distribution Log.

    Linux
    tail -f $JFROG_HOME/distribution/var/log/console.log

Additional node installation steps:

In order for a node to join a cluster, the node must have the same database configuration and the Master Key. Install all additional nodes using the same steps described above, with the additional steps below:

  1. Configure the $JFROG_HOME/distribution/var/etc/system.yaml file for the additional node with master key, database and active node configurations. For example,

    Additional node system.yaml
    shared:
      database:
        type: postgresql
        driver: org.postgresql.Driver
        url: jdbc: postgresql://<PosgreSQL_Host_IP_address>:<postgres_port>/distribution?sslmode=disable
        username: distribution
        password: password
      security:
        joinKey: <join_key>
  2. Copy the master.key from the first node to the additional node located at $JFROG_HOME/distribution/var/etc/security/master.key.
  3. Start the additional node.

  4. Access Distribution from your browser at: http://<jfrogUrl>/ui/, go the Distribution tab in the Application module in the UI.
  5. Check Distribution Log.

    Linux
    tail -f $JFROG_HOME/distribution/var/log/console.log

Docker Compose Installation

First node installation steps:

  1. Extract the contents of the compressed archive and go to the extracted folder.

    tar -xvf jfrog-distribution-<version>-compose.tar.gz
    cd jfrog-distribution-<version>-compose.tar.gz
  2. Run the config.sh script to setup folders with required ownership.

    ./config.sh
  3. Configure the system.yaml file with the database for the first node configuration details. For example,

    First node system.yaml
    shared:
      database:
        type: postgresql
        driver: org.postgresql.Driver
        url: jdbc: postgresql://<PosgreSQL_Host_IP_address>:<postgres_port>/distribution?sslmode=disable
        username: distribution
        password: password
      security:
        joinKey: <join_key>
  4. Validate and customize the product configuration (optional), including the third party dependencies connection details and ports.

  5. Start and manage Distribution using docker-compose commands.

    cd jfrog-distribution-<version>-compose
    
    # Starting from Distribution 2.5.x Redis has been moved to a compose file of its own, this needs to be started before starting other services
    docker-compose -p distribution-redis -f docker-compose-redis.yaml up -d
    
    # Starting from 2.5.x, PostgreSQL needs to be started before starting the other services.
    docker-compose -p distribution-postgres -f docker-compose-postgres.yaml up -d
    
    docker-compose -p distribution ps
    docker-compose -p distribution up -d
    docker-compose -p distribution down
  6. Access Distribution from your browser at: http://<jfrogUrl>/ui/, go the Distribution tab in the Application module in the UI.

  7. Check Distribution Log.

    docker-compose -p distribution logs

Additional node installation steps:

  1. Extract the contents of the compressed archive and go to the extracted folder.

    tar -xvf jfrog-distribution-<version>-compose.tar.gz
    cd jfrog-distribution-<version>-compose.tar.gz
  2. Run the config.sh script to setup folders with required ownership.

    ./config.sh
  3. Configure the system.yaml file for the secondary node with master key, database and active node configurations. For example,

    Additional node system.yaml
    shared:
      database:
        type: postgresql
        driver: org.postgresql.Driver
        url: postgresql://<PosgreSQL_Host_IP_address>:<postgres_port>/distribution?sslmode=disable
        username: distribution
        password: password
      security:
        joinKey: <join_key>
  4. Copy the master.key from the first node to the additional node located at $JFROG_HOME/distribution/var/etc/security/master.key.
  5. Validate and customize the product configuration (optional), including the third party dependencies connection details and ports.

  6. Start and manage Distribution using docker-compose commands.

    cd jfrog-distribution-<version>-compose# Starting from Distribution 2.5.x Redis has been moved to a compose file of its own, this needs to be started before starting other services
    docker-compose -p distribution -redis -f docker-compose-redis.yaml up -d
    
    docker-compose -p distribution ps
    docker-compose -p distribution up -d
    docker-compose -p distribution down
  7. Access Distribution from your browser at: http://<jfrogUrl>/ui/, go the Distribution tab in the Application module in the UI.

  8. Check Distribution Log.

    docker-compose -p distribution logs

Helm Installation 

Deploying Artifactory for Small, Medium or Large Installations

In the chart directory, includes three values files, one for each installation type--small/medium/large. These values files are recommendations for setting resources requests and limits for your installation. You can find the files in the corresponding chart directory.

High Availability

To set Distribution for high availability, set the replicaCount in the values.yaml file to >1 (the recommended is 3). It is highly recommended to also set RabbitMQ to run as an HA cluster.  Start Distribution with 3 replicas per service and 3 replicas for RabbitMQ.

helm upgrade --install distribution --namespace distribution --set replicaCount=3  --set rabbitmq-ha.replicaCount=3 center/jfrog/distribution 
  1. Add the ChartCenter Helm repository to your Helm client.

    helm repo add center https://repo.chartcenter.io
    
  2. Update the repository.

    helm repo update
  3. Initiate installation by providing a join key and JFrog url as a parameter to the Distribution chart installation.

    helm upgrade --install distribution --set distribution.joinKey=<YOUR_PREVIOUSLY_RETIREVED_JOIN_KEY> \
                 --set distribution.jfrogUrl=<YOUR_PREVIOUSLY_RETIREVED_BASE_URL> --namespace distribution center/jfrog/distribution

    Alternatively, you can create a secret containing the join key manually and pass it to the template during install/upgrade.

    # Create a secret containing the key. The key in the secret must be named join-key
    kubectl create secret generic my-secret --from-literal=join-key=<YOUR_PREVIOUSLY_RETIREVED_JOIN_KEY>
    
    # Pass the created secret to helm
    helm upgrade --install distribution --set distribution.joinKeySecretName=my-secret --namespace distribution center/jfrog/distribution

    In either case, make sure to pass the same join key on all future calls to helm install and helm upgrade. This means always passing --set distribution.joinKey=<YOUR_PREVIOUSLY_RETIREVED_JOIN_KEY>. In the second, this means always passing --set distribution.joinKeySecretName=my-secret and ensuring the contents of the secret remain unchanged.

  4. Customize the product configuration (optional) including database, Java Opts, and filestore.

    Unlike other installations, Helm Chart configurations are made to the values.yaml and are then applied to the system.yaml.

    Follow these steps to apply the configuration changes.

    1. Make the changes to values.yaml. 
    2. Run the command.

      helm upgrade --install distribution --namespace distribution -f values.yaml

  5. Access Distribution from your browser at: http://<jfrogUrl>/ui/, then go to the Security & Compliance tab in the Application module in the UI.

  6. Check the status of your deployed Helm releases.

    helm status distribution

For advanced installation options, see Helm Charts Installers for Advanced Users.


Product Configuration

After installing and before running Distribution, you may set the following configurations.

Where to find the system configurations?

You can configure all your system settings using the system.yaml file located in the $JFROG_HOME/distribution/var/etc folder. For more information, see Distribution YAML Configuration.

If you don't have a System YAML file in your folder, copy the template available in the folder and name it system.yaml.

For the Helm charts, the system.yaml file is managed in the chart’s values.yaml.

Artifactory Connection Details

Distribution requires a working Artifactory server and a suitable license. The Distribution connection to Artifactory requires 2 parameters:

  • jfrogUrl - URL to the machine where JFrog Artifactory is deployed, or the load balancer pointing to it. It is recommended to use DNS names rather than direct IPs. For example: "http://jfrog.acme.com or http://10.20.30.40:8082"
    Set it in the Shared Configurations section of the $JFROG_HOME/distribution/var/etc/system.yaml file.
  • join.key - This is the "secret" key required by Artifactory for registering and authenticating the Distribution server.
    You can fetch the Artifactory joinKey (join Key) from the JPD UI in the Administration module | Security | Settings | Join Key
    Set the join.key used by your Artifactory server in the Shared Configurations section of the $JFROG_HOME/distribution/var/etc/system.yaml file.

Changing PostgreSQL Database Credentials

Distribution comes bundled with a PostgreSQL Database out-of-the-box, which comes pre-configured with default credentials

To change the default credentials:

# Access PostgreSQL as the Distribution user adding the optional -W flag to invoke the password prompt
$ psql -d distribution -U distribution -W
 
# Securely change the password for user "distribution". Enter and then retype the password at the prompt.
\password distribution
 
# Verify the update was successful by logging in with the new credentials
$ psql -d distribution -U distribution -W

Set your PostgreSQL connection details in the Shared Configurations section of the $JFROG_HOME/distribution/var/etc/system.yaml file.

Changing Redis Database Credentials

Compose

To change the default credentials:

  1. Set the new password in the  $JFROG_HOME/distribution/app/third-party/redis/redis.conf file.

    requirepass <new password>
  2. Set your Redis password in the Shared Configurations section of the $JFROG_HOME/distribution/var/etc/system.yaml file.
  3. Restart all the services.

    cd jfrog-distribution-<version>-compose 
    
     docker-compose -p distribution restart

RPM/DEB

To change the default credentials:

  1. Set the new password for RPM in the /etc/redis.conf file and for Debian in the /etc/redis/redis.conf file.

    requirepass <new password>
  2. Set your Redis password in the Shared Configurations section of the $JFROG_HOME/distribution/var/etc/system.yaml file.

  3. Restart all the services.

    service distribution restart / systemctl restart distribution.service

Archive

To change the default credentials:

  1. Set the new password in the  distribution/app/third-party/redis/redis.conf file.

    requirepass <new password>
  2. Set your Redis password in the Shared Configurations section of the distribution/var/etc/system.yaml file.
  3. Restart all the services.

     distribution/app/bin/distribution.sh restart 



Installing Third Party Applications

PostgreSQL Installation

RPM

  1. Install PostgreSQL.

    # Run the following commands from the extracted jfrog-distribution-<version>-rpm directory.
    # Note : Use postgreSQL rpms with el6 when installing on Centos 6 and RHEL 6 and use postgresql12-12.3-1 packages
    # Note : 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/postgresql12-libs-12.3-5PGDG.rhel7.x86_64.rpm
    rpm -ivh --replacepkgs ./third-party/postgresql/postgresql12-12.3-5PGDG.rhel7.x86_64.rpm
    rpm -ivh --replacepkgs ./third-party/postgresql/postgresql12-server-12.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-12.service
    systemctl daemon-reload
    /usr/pgsql-12/bin/postgresql-12-setup initdb
     
    # For centos 6 / rhel 6
    sed -i "s~^PGDATA=.*~PGDATA=/var/opt/postgres/data~" /etc/init.d/postgresql-12
    service postgresql-12 initdb
     
    Replace "ident" and "peer" with "trust" in postgres hba configuration files ie /var/opt/postgres/data/pg_hba.conf
  2. Configure PostgreSQL to allow external IP connections. 

  3. By default, PostgreSQL will only allow localhost clients communications. To enable different IP's to communicate with the database, you will need to configure the pg_hba.conf file.

    File location according to installation type

    • Docker-compose$JFROG_HOME/distribution/var/data/postgres/data
    • Native installations/var/opt/postgres/data

    To grant all IPs access you may add the below, under the IPv4 local connections section.

    host    all             all             0.0.0.0/0               trust

    Add the following line to /var/opt/postgres/data/postgresql.conf.

    listen_addresses='*'
    port=5432
  4. Start PostgreSQL.

    systemctl start postgresql-12.service 
     
    or 
     
    service postgresql-12 start
  5. Set up the database and user.

    ## run the script to seed the tables and schemas needed by Distribution
    cp -f ./third-party/postgresql/createPostgresUsers.sh /tmp
    source /etc/locale.conf
     
    cd /tmp && su postgres -c "POSTGRES_PATH=/usr/pgsql-12/bin PGPASSWORD=postgres DB_PASSWORD=password bash /tmp/createPostgresUsers.sh"

Debian   

Prerequisites

It is recommended to ensure your apt-get libraries are up-to-date, using the following commands.

Install Any Missing dependancies

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 Steps
  1. Install PostgreSQL.
    Run the following commands from the extracted jfrog-distribution-<version>-deb directory.

    mkdir -p /var/opt/postgres/data

    Ubuntu 16.04 (xenial)

    dpkg -i ./third-party/postgresql/postgresql-12_12.3-1.pgdg16.04+1_amd64.deb

    Ubuntu 18.04 (bionic)

    dpkg -i ./third-party/postgresql/postgresql-12_12.3-1.pgdg18.04+1_amd64.deb

    Ubuntu 20.04 (focal)

    dpkg -i ./third-party/postgresql/postgresql-12_12.3-1.pgdg20.04+1_amd64.deb

    Debian 8 (jessie)

    ## Before installing Postgres dependencies
    mv /etc/apt/sources.list.d/backports.list /etc/apt >/dev/null
    apt-get update
    dpkg -i ./third-party/postgresql/postgresql-12_12.3-1.pgdg80+1_amd64.deb
     
    # After installing Postgres dependencies
    mv /etc/apt/backports.list /etc/apt/sources.list.d/backports.list >/dev/null
    apt-get update

    Debian 9 (stretch)

    dpkg -i ./third-party/postgresql/postgresql-12_12.3-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-12_12.3-1.pgdg100+1_amd64.deb

    Stop the Xray service.

    systemctl stop postgresql.service

    Change permissions for the postGres folder.

    chown -R postgres:postgres /var/opt/postgres
     
    sed -i "s~^data_directory =.*~data_directory = '/var/opt/postgres/data'~" "/etc/postgresql/12/main/postgresql.conf"
    sed -i "s~^hba_file =.*~hba_file = '/var/opt/postgres/data/pg_hba.conf'~" "/etc/postgresql/12/main/postgresql.conf"
    sed -i "s~^ident_file =.*~ident_file = '/var/opt/postgres/data/pg_ident.conf'~" "/etc/postgresql/12/main/postgresql.conf"
     
    su postgres -c "/usr/lib/postgresql/12/bin/initdb --pgdata=/var/opt/postgres/data"
  2. Configure PostgreSQL to allow external IP connections. 

  3. By default PostgreSQL will only allow localhost clients communications. To enable different IPs to communicate with the database you will need to configure the pg_hba.conf file.

    File Location According to Installation Type

    • Docker-compose$JFROG_HOME/distribution/var/data/postgres/data
    • Native installations/var/opt/postgres/data

    To grant all IPs access you may add the below, under the IPv4 local connections section:

    host    all             all             0.0.0.0/0               trust

    Add the following line to /etc/postgresql/12/main/postgresql.conf.

    listen_addresses='*'
  4.  Start PostgreSQL.

    systemctl start postgresql.service 
     
    or 
     
    service postgresql start
  5. Set up the database and user.

    ## run the script to seed the tables and schemas needed by Distribution
    cp -f ./third-party/postgresql/createPostgresUsers.sh /tmp
    source /etc/default/locale
     
    cd /tmp && su postgres -c "POSTGRES_PATH=/usr/lib/postgresql/12/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

    Linux Archive

    Postgres binaries are no longer bundled with linux archive installer for Distribution. Please install PostgreSQL manually.      

    # Create the psql database (the script "distribution/app/third-party/postgresql/createPostgresUsers.sh" , responsible for seeding Postgres assumes this database exists)
    <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 Installation

RPM
# Run the following commands from the extracted jfrog-distribution-<version>-rpm directory.
  
# Note : Use redis rpms with el6 when installing on Centos 6 and RHEL 6
# Note : 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
  
# verify if redis is working - 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
Debian
# 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
   
# verify if redis is working - 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

For Advanced Users

Manual Docker Compose Installation

  1. Extract the contents of the compressed archive and go to the extracted folder.

    tar -xvf jfrog-distribution-<version>-compose.tar.gz

    .env file included within the Docker-Compose archive

    This .env file is used by docker-compose and is updated during installations and upgrades.

    Notice that some operating systems do not display dot files by default. If you make any changes to the file, remember to backup before an upgrade.

  2. Create the following folder structure under JFROG_HOME.

    `-- [1020    1020  ]  var
        |-- [1020    1020  ]  data
        |   |-- [999      999  ]  postgres
        |   |   `-- [999      999  ]  data
        |   `-- [999      999  ]  redis
        |-- [1020    1020  ]  etc
  3. Copy the appropriate docker-compose templates from the templates folder to the extracted folder. Rename it as docker-compose.yaml.

    RequirementTemplate
    Distribution with externalised databasesdocker-compose.yaml
    Distribution with PostgreSQLdocker-compose-postgres.yaml
  4. Update the .env file.

    ## The Installation directory for Distribution. IF not entered, the script will prompt you for this input. Default [$HOME/.jfrog/distribution]
    ROOT_DATA_DIR=
  5. Customize the product configuration.
    1. Set the Artifactory connection details.
    2. Customize the PostgreSQL Database connection details. (optional)
    3. Set any additional configurations (for example: ports, node id) using the Distribution system.yaml file.

      Ensure the host's ID and IP are added to the system.yaml. This is important to ensure that other products and Platform Deployments can reach this instance

  6. Start Distribution using docker-compose commands.

    docker-compose -p distribution logs
    docker-compose -p distribution ps
    docker-compose -p distribution up -d
    docker-compose -p distribution down
  7. Access Artifactory from your browser at: http://SERVER_HOSTNAME/ui/. For example, on your local machine: http://localhost/ui/.

  8. Check the Distribution log.

    docker-compose -p distribution logs

    Configuring the Log Rotation of the Console Log

    The console.log file can grow quickly since all services write to it. The installation scripts add a cron job to log rotate the console.log file every hour.

    This is not  done for manual Docker Compose installations. Learn more on how to configure the log rotation.


  • No labels
Copyright © 2020 JFrog Ltd.