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_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.
- Download Distribution.
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 called
distribution
by 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 archivemv jfrog-distribution-
-linux.tar.gz /opt/ cd /opt tar -xf jfrog-distribution- -linux.tar.gz mv jfrog-distribution- -linux distribution 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 archivedistribution/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 - Validate and customize the product configuration(optional), including the third party dependencies connection details and ports.
Start and manage the Distribution service.
systemd OSsystemctl start|stop distribution.service
systemvservice distribution start|stop
Docker Composecd 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 archivedistribution/app/bin/distribution.sh start|stop
- Access Distribution from your browser at:
http://
: go to theDistributiontab in theApplicationmodule in the UI./ui/ Check the 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 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.
-
tar -xvf jfrog-distribution-
-rpm.tar.gz cd jfrog-distribution- -rpm Extract the contents of the compressed archive, and go to the extracted folder:
InstallPostgreSQL.
Already have a PostgreSQL installation?Set your PostgreSQL connection details in theShared Configurationssection of the
$JFROG_HOME/distribution/var/etc/system.yaml
file.InstallRedis.
Install Distribution. You must run as a root user.
rpm -Uvh --replacepkgs ./distribution/distribution.rpm
- 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 theDistribution
system.yaml
file.
- Set the Artifactory connection details.
Start and manage the Distribution service.
systemd OSsystemctl start|stop distribution.service
systemv OSservice distribution start|stop|status|restart
- Access Distribution from your browser at:
http://
: go to theDistributiontab in theApplicationmodule in the UI./ui/ Check the Distribution log.
Linuxtail -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.
- Download Distribution.
Extract the contents of the compressed archive, and go to the extracted folder:
tar -xvf jfrog-distribution-
-deb.tar.gz cd jfrog-distribution- -deb InstallPostgreSQL.
Already have a PostgreSQL installation?Set your PostgreSQL connection details in theShared Configurationssection of the
$JFROG_HOME/distribution/var/etc/system.yaml
file.- InstallRedis.
Install Distribution.You must run as a root user.
dpkg -i ./distribution/distribution.deb
- 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 theDistribution system.yaml file.
- Set the Artifactory connection details.
Start and manage the Distribution service.
systemd OSsystemctl start|stop distribution.service
systemv OSservice distribution start|stop|status|restart
- Access Distribution from your browser at:
http://
: go to theDistributiontab in theApplicationmodule in the UI./ui/ Check the Distribution log.
Linuxtail -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
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.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 theDistribution
system.yam
l configuration file.
- Set the Artifactory connection details.
Start and manage the Distribution service as the user who extracted the tar.
As a processDaemon Processdistribution/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
asshared.user
andshared.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 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 systemdsystemctl
distribution.service Using init.dservice distribution
- Access Distribution from your browser at:
http://
: go to theDashboardtab in theApplicationmodule in the UI./ui/ 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.
Add theChartCenter Helm repositoryto your Helm client.
helm repo add jfrog https://charts.jfrog.io
Update the repository.
helm repo update
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 to
helm install
andhelm upgrade.
This means always passing--set distribution.joinKey=
. In the second, this means always passing--set distribution.joinKeySecretName=my-secret
and ensuring the contents of the secret remain unchanged.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 thesystem.yaml
.Follow these steps to apply the configuration changes.
- Make the changes to
values.yaml.
Run the command.
helm upgrade --
install
distribution --namespace distribution -f values.yaml
- Make the changes to
AccessDistribution from your browser at:
http://
: go to theDashboardtab in theApplicationmodule in the UI./ui/ 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:
- Install the first node. The installation is identical to thesingle node installation.Important: make sure not to start Distribution.
Configure the
$JFROG_HOME/distribution/var/etc/
system.yaml
file withthedatabase and first node configuration details. For example,First node system.yamlshared: database: type: postgresql driver: org.postgresql.Driver url: jdbc: postgresql://
: /distribution?sslmode=disable username: distribution password: password security: joinKey: Start and manage the Distribution service.
systemd OSsystemctl start|stop distribution.service
Systemv OSservice distribution start|stop
- Access Distribution from your browser at:
http://
: go to theDistributiontab in theApplicationmodule in the UI./ui/ Check the Distribution log.
Linuxtail -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:
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.yamlshared: database: type: postgresql driver: org.postgresql.Driver url: jdbc: postgresql://
: /distribution?sslmode=disable username: distribution password: password security: joinKey: - Copy the
master.key
from the first node to the additional node located at$JFROG_HOME/distribution/var/etc
/security/master.key.
Start the additional node.
- Access Distribution from your browser at:
http://
: go to theDistributiontab in theApplicationmodule in the UI./ui/ Check the Distribution log.
Linuxtail -f $JFROG_HOME/distribution/var/log/console.log
Docker Compose Installation
First node installation steps:
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 Run theconfig.shscript to setup folders with required ownership.
./config.sh
Configure the
system.yaml
file withthe database for the first node configuration details. For example,First node system.yamlshared: database: type: postgresql driver: org.postgresql.Driver url: jdbc: postgresql://
: /distribution?sslmode=disable username: distribution password: password security: joinKey: Validate and customize the product configuration(optional), including the third party dependencies connection details and ports.
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 Access Distribution from your browser at:
http://
: go to theDistributiontab in theApplicationmodule in the UI./ui/ Check the Distribution log.
docker-compose -p distribution logs
Additional node installation steps:
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 Run theconfig.shscript to setup folders with required ownership.
./config.sh
Configure the
system.yaml
file for the secondary node with master key, database and active node configurations. For example,Additional node system.yamlshared: database: type: postgresql driver: org.postgresql.Driver url: postgresql://
: /distribution?sslmode=disable username: distribution password: password security: joinKey: - Copy the
master.key
from the first node to the additional node located at $JFROG_HOME/distribution/var/etc/security/master.key.
Customize the product configuration(optional), including the third party dependencies connection details and ports.
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 Access Distribution from your browser at:
http://
: go to theDistributiontab in theApplicationmodule in the UI./ui/ 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
Add thehttps://charts.jfrog.ioto your Helm client.
helm repo add jfrog https://charts.jfrog.io
Update the repository.
helm repo update
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 to
helm install
andhelm upgrade.
This means always passing--set distribution.joinKey=
. In the second, this means always passing--set distribution.joinKeySecretName=my-secret
and ensuring the contents of the secret remain unchanged.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 thesystem.yaml
.Follow these steps to apply the configuration changes.
- Make the changes to
values.yaml.
Run the command.
helm upgrade --
install
distribution --namespace distribution -f values.yaml
- Make the changes to
AccessDistribution from your browser at:
http://
: go to theDashboardtab in theApplicationmodule in the UI./ui/ 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.yaml
file located in the$JFROG_HOME/distribution/var/etc
folder.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.yaml
file 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.yaml
file. - 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.yaml
file.
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.yaml
file.
Changing Redis Database Credentials
Compose
To change the default credentials:
Set the new password in the
$JFROG_HOME/distribution
/app/third-party/redis/redis.conf
file.requirepass
- Set your Redis password in theShared Configurationssection of the
$JFROG_HOME/distribution/var/etc/system.yaml
file. Restart all the services.
cd jfrog-distribution-
-compose docker-compose -p distribution restart
RPM/DEB
To change the default credentials:
Set the new password forRPM in the /
etc/redis/redis.conf
file and for Debian in the/etc/redis/redis.conf
file.requirepass
Set your Redis password in theShared Configurationssection of the
$JFROG_HOME/distribution/var/etc/system.yaml
file.Restart all the services.
service distribution restart / systemctl restart distribution.service
Archive
To change the default credentials:
Set the new password in thedistribution/app/third-party/redis/
redis.conf
file.requirepass
- Set your Redis password in theShared Configurationssection of the
distribution/var/etc/system.yaml
file. Restart all the services.
distribution/app/bin/distribution.sh restart
Installing Third Party Applications
PostgreSQL Installation
RPM
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 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 will need toconfigure 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
- Docker-compose:
Start PostgreSQL.
systemctl start postgresql-
.service or service postgresql- start 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-get
libraries 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
Install PostgreSQL.
Run the following commands from the extractedjfrog-distribution-
directory.-deb 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"
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 will need toconfigure 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/13/main/postgresql.conf
.listen_addresses='*'
- Docker-compose:
Start PostgreSQL.
systemctl start postgresql.service or service postgresql start
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 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. 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
从提取的摩根富林明#运行以下命令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
从提取的摩根富林明#运行以下命令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
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.
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
Copy the appropriate docker-compose templates from the templates folder to the extracted folder. Rename it as
docker-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/localtime
might 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 selected
docker-compose.yaml
file to avoid installation issues.- /etc/localtime:/etc/localtime:ro
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=
- 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 theDistribution
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
- Set the Artifactory connection details.
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
Access Artifactory from your browser at:
http://SERVER_HOSTNAME/ui/
. For example, on your local machine:http://localhost/ui/
.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 theconsole.log
file every hour.This isnotdone for manual Docker Compose installations. Learn more on how toconfigure the log rotation.