Cloud customer?
Start for Free>
Upgrade in MyJFrog >
What's New in Cloud >





Overview

这个页面提供了一个指南的不同方式you can install and configure JFrog Distribution, single node and high availability. You can find additional information on high availabilityhere.


Before You Begin

System Requirements

Before installing Distribution, seeSystem Requirementsfor information on supported platforms, supported browsers, and other requirements.

When installing Distribution, you must run the installation as a root user or providesudo access to a non-root user.

Admin Permissions

You will need to have admin permissions on the installation machine in the following cases

  • Native installer - always requires admin permissions
  • Archive installer - requires admin permissions only during installation
  • Docker installer - does not require admin permissions

Use a dedicated server for Distribution with no other software running to alleviate performance bottlenecks, avoid port conflicts, and avoid setting uncommon configurations.

System Architecture

To learn about the JFrog Platform Deployment, refer toSystem Architecture.

Installing Distribution

Before installingDistribution 2.x,你必须先安装JFrog Artifactory 7.x.

Installation Steps

The installation procedure involves the following main steps:

  1. Download Distributionas per your required installer type (Docker Compose, RPM, Debian).
  2. Install Distributioneither as asingle node installation, orhigh 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 (joinKeyandjfrogUrl)
    2. Additional optional configuration including changing default credentials for databases
  4. Start the Serviceusing the start scripts or OS service management.
  5. Check the Service Logto check the status of the service.


Once you have finished the setting up Distribution, continue toConfiguring Distribution.

To begin using Distribution, seeDistributing Release Bundles.

JFrog Subscription Levels

SELF-HOSTED
ENTERPRISE+
Page Contents

Default Home Directory / $JFROG_HOME

The default Distribution home directory is defined according to the installation type. For additional details see theProduct Directory Structurepage.

Note:This guide uses$JFROG_HOMEto 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--.tar.gz cd jfrog-distribution--

    .env file included within the Docker-Compose archive

    This .env file is used bydocker-composeand 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 calleddistributionby defaultwhich 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--linux.tar.gz /opt/ cd /opt tar -xf jfrog-distribution--linux.tar.gz mv jfrog-distribution--linux distribution
  3. Run the installer script.
    Note: the script will prompt you with a series of mandatory inputs, including thejfrogURL(custom base URL)andjoinKey.

    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  --group  -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--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 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 theStart Distribution section under Linux Archive Manual Installationfor more details.

    Linux archive
    distribution/app/bin/distribution.sh start|stop
  6. Access Distribution from your browser at:http:///ui/: go to theDistributiontab in theApplicationmodule in the UI.
  7. Check the Distribution log.

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

    Configuring the Log Rotation of the Console Log

    Theconsole.logfile can grow quickly since all services write to it. This file is not log rotated for Darwin installations. Learn more on how toconfigure 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--rpm.tar.gz cd jfrog-distribution--rpm
  2. Extract the contents of the compressed archive, and go to the extracted folder:

  3. InstallPostgreSQL.

    Already have a PostgreSQL installation?Set your PostgreSQL connection details in theShared Configurationssection of the$JFROG_HOME/distribution/var/etc/system.yamlfile.

  4. InstallRedis.

  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 theDistributionsystem.yamlfile.
  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:///ui/: go to theDistributiontab in theApplicationmodule in the UI.
  9. Check the 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--deb.tar.gz cd jfrog-distribution--deb
  3. InstallPostgreSQL.

    Already have a PostgreSQL installation?Set your PostgreSQL connection details in theShared Configurationssection of the$JFROG_HOME/distribution/var/etc/system.yamlfile.

  4. InstallRedis.
  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 theDistribution 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:///ui/: go to theDistributiontab in theApplicationmodule in the UI.
  9. Check the 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--linux.tar.gz mv jfrog-distribution--linux distribution

    PostgreSQL is required and must be installed before continuing with the next installation steps.

    Set your PostgreSQL connection details in theShared Configurationssection of the$JFROG_HOME/distribution/var/etc/system.yamlfile.

  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 theDistributionsystem.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 calleddistribution(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 throughdistribution/var/etc/system.yamlasshared.userandshared.group. This takes precedence over values passed through the command line on install.

    distribution/app/bin/installService.sh --user  --group  -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 indistribution/var/etc/system.yamlat the end of installation.

    To manage the service, usesystemdorinit.dcommands depending on your system.

    Using systemd
    systemctl  distribution.service
    Using init.d
    service distribution 
  5. Access Distribution from your browser at:http:///ui/: go to theDashboardtab in theApplicationmodule 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

在图表目录,包括三个值文件s, 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 thecorresponding chart directory.

  1. Add theChartCenter Helm repositoryto your Helm client.

    helm repo add jfrog https://charts.jfrog.io
  2. Update the repository.

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

    helm upgrade --install distribution --set distribution.joinKey= \ --set distribution.jfrogUrl= --namespace distribution jfrog/distribution

    或者,您可以创建一个包含秘密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= # Pass the created secret to helm helm upgrade --install distribution --set distribution.joinKeySecretName=my-secret --namespace distribution jfrog/distribution

    In either case, make sure to pass the same join key on all future calls tohelm installandhelm upgrade.This means always passing--set distribution.joinKey=. In the second, this means always passing--set distribution.joinKeySecretName=my-secretand 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 thevalues.yamland are then applied to thesystem.yaml.

    Follow these steps to apply the configuration changes.

    1. Make the changes tovalues.yaml.
    2. Run the command.

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

  5. AccessDistribution from your browser at:http:///ui/: go to theDashboardtab in theApplicationmodule in the UI.

  6. Check the status of your deployed Helm releases.

    helm status distribution

For advanced installation options, seeHelm 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 theSystem Architecture.

Prerequisites

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

Database

Distribution HA requires an externalPostgreSQLdatabase.Make sure you havecompleted setting up your external databasebefore proceeding to install the cluster nodes. The database connection details are used for each node installation.There are several ways to setup PostgreSQL for redundancy. Including: HA, Load Balancing and Replication. For moreinformation, see thePostgreSQL 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 thesingle node installation.Important: make sure not to start Distribution.
  2. Configure the$JFROG_HOME/distribution/var/etc/system.yamlfile withthedatabase and first node configuration details. For example,

    First node system.yaml
    shared: database: type: postgresql driver: org.postgresql.Driver url: jdbc: postgresql://:/distribution?sslmode=disable username: distribution password: password security: joinKey: 
  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:///ui/: go to theDistributiontab in theApplicationmodule in the UI.
  5. Check the Distribution log.

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

Additional node installation steps:

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.yamlfile 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://:/distribution?sslmode=disable username: distribution password: password security: joinKey: 
  2. Copy themaster.keyfrom 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:///ui/: go to theDistributiontab in theApplicationmodule in the UI.
  5. Check the 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--compose.tar.gz cd jfrog-distribution--compose.tar.gz
  2. Run theconfig.shscript to setup folders with required ownership.

    ./config.sh
  3. Configure thesystem.yamlfile withthe database for the first node configuration details. For example,

    First node system.yaml
    shared: database: type: postgresql driver: org.postgresql.Driver url: jdbc: postgresql://:/distribution?sslmode=disable username: distribution password: password security: joinKey: 
  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--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:///ui/: go to theDistributiontab in theApplicationmodule in the UI.

  7. Check the 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--compose.tar.gz cd jfrog-distribution--compose.tar.gz
  2. Run theconfig.shscript to setup folders with required ownership.

    ./config.sh
  3. Configure thesystem.yamlfile 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://:/distribution?sslmode=disable username: distribution password: password security: joinKey: 
  4. Copy themaster.keyfrom the first node to the additional node located at $JFROG_HOME/distribution/var/etc/security/master.key.
  5. 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--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:///ui/: go to theDistributiontab in theApplicationmodule in the UI.

  8. Check the Distribution log.

    docker-compose -p distribution logs

Helm Installation


Important

Currently, it is not possible to connect a JFrog product (e.g., Distribution) that is within a Kubernetes cluster with another JFrog product (e.g., Artifactory) that is outside of the cluster, as this is considered a separate network. Therefore, JFrog products cannot be joined together if one of them is in a cluster.

Deploying Artifactory for Small, Medium or Large Installations

在图表目录,包括三个值文件s, 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 thecorresponding chart directory.

High Availability

For an HA Distribution installation, set thereplicaCount in the values.yaml file to >1(the recommended is3).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 jfrog/distribution
  1. Add thehttps://charts.jfrog.ioto your Helm client.

    helm repo add jfrog https://charts.jfrog.io
  2. Update the repository.

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

    helm upgrade --install distribution --set distribution.joinKey= \ --set distribution.jfrogUrl= --namespace distribution jfrog/distribution

    或者,您可以创建一个包含秘密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= # Pass the created secret to helm helm upgrade --install distribution --set distribution.joinKeySecretName=my-secret --namespace distribution jfrog/distribution

    In either case, make sure to pass the same join key on all future calls tohelm installandhelm upgrade.This means always passing--set distribution.joinKey=. In the second, this means always passing--set distribution.joinKeySecretName=my-secretand 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 thevalues.yamland are then applied to thesystem.yaml.

    Follow these steps to apply the configuration changes.

    1. Make the changes tovalues.yaml.
    2. Run the command.

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

  5. AccessDistribution from your browser at:http:///ui/: go to theDashboardtab in theApplicationmodule in the UI.

  6. Check the status of your deployed Helm releases.

    helm status distribution

For advanced installation options, seeHelm 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 thesystem.yamlfile located in the$JFROG_HOME/distribution/var/etcfolder.For more information, seeDistribution YAML Configuration.

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

For theHelm charts, thesystem.yamlfile is managed in the chart’svalues.yaml.

Artifactory Connection Details

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

  • jfrogUrl- URL的机器JFrog Artifactory deployed, or the load balancer pointing to it. It is recommended to use DNS names rather than direct IPs. For example:"http://jfrog.acme.comorhttp://10.20.30.40:8082"
    Set it in theShared Configurationssectionof the$JFROG_HOME/distribution/var/etc/system.yamlfile.
  • join.key- This is the "secret" key required by Artifactory for registering and authenticating the Distribution server.
    You can fetch the ArtifactoryjoinKey(join Key) from the JPD UI in theAdministration module | User Management | Settings | Join Key.
    Set thejoin.keyused by your Artifactory server in theSharedConfigurationssection of the$JFROG_HOME/distribution/var/etc/system.yamlfile.

Adding Signing Keys to JFrog Distribution

The JFrog Platform supports signing keys to establish trust with your clients for downloading your packages from Artifactory. Signing keys consist of a public and a private key pair, which are used for signing and verifying release bundles. When installing a new Edge, you will need to propagate the public keys to the new Edge. To learn about how to add and propagate keys, seeGPG Signing.

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 theShared Configurationssection of the$JFROG_HOME/distribution/var/etc/system.yamlfile.

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

    requirepass 
  2. Set your Redis password in theShared Configurationssection of the$JFROG_HOME/distribution/var/etc/system.yamlfile.
  3. Restart all the services.

    cd jfrog-distribution--compose docker-compose -p distribution restart

RPM/DEB

To change the default credentials:

  1. Set the new password forRPM in the /etc/redis/redis.conffile and for Debian in the/etc/redis/redis.conffile.

    requirepass 
  2. Set your Redis password in theShared Configurationssection of the$JFROG_HOME/distribution/var/etc/system.yamlfile.

  3. Restart all the services.

    service distribution restart / systemctl restart distribution.service

Archive

To change the default credentials:

  1. Set the new password in thedistribution/app/third-party/redis/redis.conffile.

    requirepass 
  2. Set your Redis password in theShared Configurationssection of thedistribution/var/etc/system.yamlfile.
  3. Restart all the services.

    distribution/app/bin/distribution.sh restart



Installing Third Party Applications

PostgreSQL Installation

RPM

  1. Install PostgreSQL.

    Up to Distribution v 2.7.x
    从提取的摩根富林明#运行以下命令rog-distribution--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 toconfigure thepg_hba.conffile.

    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-.service or service postgresql- start
  5. Set up the database anduser.

    ## run the script 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/locale.conf cd /tmp && su postgres -c "POSTGRES_PATH=/usr/pgsql-13/bin PGPASSWORD=postgres DB_PASSWORD=password bash /tmp/createPostgresUsers.sh"

Debian

Prerequisites

It is recommended to ensure yourapt-getlibraries are up-to-date, using the following commands.

Install Any Missing Dependencies

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 extractedjfrog-distribution--debdirectory.

    mkdir -p /var/opt/postgres/data

    Ubuntu 16.04 (xenial)

    dpkg -i ./third-party/postgresql/postgresql-13_13.2-1.pgdg16.04+1_amd64.deb

    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 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-13_13.2-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-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 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/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"
  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 toconfigure thepg_hba.conffile.

    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/13/main/postgresql.conf.

    listen_addresses='*'
  4. Start PostgreSQL.

    systemctl start postgresql.service or service postgresql start
  5. Set up the database anduser.

    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;" ## 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/13/bin PGPASSWORD=postgres DB_PASSWORD=password bash /tmp/createPostgresUsers.sh"

    Put back the originalpgdg.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 originalsources.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. Install PostgreSQL manually.

    # Create the psql database (the script "distribution/app/third-party/postgresql/createPostgresUsers.sh" , responsible for seeding Postgres assumes this database exists) /psql template1 : CREATE DATABASE ; : \q ## run the script to seed the tables and schemas needed by Distribution POSTGRES_PATH= distribution/app/third-party/postgresql/createPostgresUsers.sh

Redis Installation

RPM
从提取的摩根富林明#运行以下命令rog-distribution--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-5.2.1-2.el8.x86_64.rpm rpm -ivh --replacepkgs ./third-party/redis/redis-6.2.6-1.el8.remi.x86_64.rpm service redis start 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 restart # verify if redis is working - should return PONG redis-cli -a password ping
Debian
从提取的摩根富林明#运行以下命令rog-distribution--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 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 # verify if redis is working - should return PONG redis-cli -a password ping

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--compose.tar.gz

    .env file included within the Docker-Compose archive

    This .env file is used bydocker-composeand 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 underJFROG_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 asdocker-compose.yaml.

    Requirement Template
    Distribution with externalised databases

    docker-compose.yaml

    Distribution with PostgreSQL docker-compose-postgres.yaml

    Docker for Mac

    When you use Docker Compose in Mac,/etc/localtimemight not work as expected since it might not be a shared location in the docker-for-mac settings.

    You can remove the following line from the selecteddocker-compose.yamlfile to avoid installation issues.

    - /etc/localtime:/etc/localtime:ro
  4. Update the.envfile.

    ## 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 theDistributionsystem.yamlfile.

      Ensure the host's ID and IP are added to thesystem.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

    Theconsole.logfile can grow quickly since all services write to it. The installation scripts add a cron job to log rotate theconsole.logfile every hour.

    This isnotdone for manual Docker Compose installations. Learn more on how toconfigure the log rotation.


  • No labels
Copyright © 2022 JFrog Ltd.