PIGSTY

Offline Install

install pigsty without Internet access?

Pigsty install from Internet upstream by default, while some environments are isolated from the Internet. To address this issue, Pigsty supports offline installation from offline packages.

Download the pigsty offline package, put it to /tmp/pkg.tgz

Download the pigsty source package, extract it (assume ~/pigsty)

cd ~/pigsty; ./bootstrap, it will extract the pkg and use the local repo

vi ~/pigsty.yml, overwrite node_repo_modules to local to use the local repo

Run ./install.yml as usual. it will install everything from the local repo.


What is offline package?

Offline package packs all the required RPM/DEB packages and their dependencies; it is essentially a snapshot tarball of local APT / YUM repo, taken after a normal installation.

You can find these packages from the GitHub release page, for example:

045977aff647acbfa77f0df32d863739  pigsty-pkg-v3.6.1.d12.aarch64.tgz
636b15c2d87830f2353680732e1af9d2  pigsty-pkg-v3.6.1.d12.x86_64.tgz
700a9f6d0db9c686d371bf1c05b54221  pigsty-pkg-v3.6.1.el8.aarch64.tgz
2aff03f911dd7be363ba38a392b71a16  pigsty-pkg-v3.6.1.el8.x86_64.tgz
ce07261b02b02b36a307dab83e460437  pigsty-pkg-v3.6.1.el9.aarch64.tgz
d598d62a47bbba2e811059a53fe3b2b5  pigsty-pkg-v3.6.1.el9.x86_64.tgz
13fd68752e59f5fd2a9217e5bcad0acd  pigsty-pkg-v3.6.1.u22.aarch64.tgz
c25ccfb98840c01eb7a6e18803de55bb  pigsty-pkg-v3.6.1.u22.x86_64.tgz
0d71e58feebe5299df75610607bf428c  pigsty-pkg-v3.6.1.u24.aarch64.tgz
4fbbab1f8465166f494110c5ec448937  pigsty-pkg-v3.6.1.u24.x86_64.tgz
083d8680fa48e9fec3c3fcf481d25d2f  pigsty-v3.6.1.tgz

We usually release offline packages for the following linux distro, with the latest OS minor version.

https://github.com/pgsty/pigsty/releases/download/v3.6.1/pigsty-pkg-v3.6.1.el9.x86_64.tgz

Offline Package is made for specific Linux OS Major.Minor Version

Using offline package on lower minor version may have a chance of success, but it is not guaranteed.


Using Offline Package

Place the offline package at /tmp/pkg.tgz, navigate to the ~/pigsty directory and execute ./bootstrap to extract and use the offline package. Pigsty will extract it to /www/pigsty, configure the system repository list to enable this repository, and install ansible from it.

Since Pigsty v3.6, most configuration templates no longer build local software repositories by default, but install packages directly from Internet upstream. A few configuration templates such as rich and full still retain the old behavior — building local repositories first before using them.

If you want to use the extracted and configured offline package in your own configuration, please modify the following settings:

  • repo_enabled: Set this to true to build local software repo (explicitly disabled in most templates)
  • node_repo_modules: Set this to local to install from local software repo for all nodes in the env
    • In most templates, this parameter is now explicitly configured as: node,infra,pgsql, which installs software packages directly from upstream repos.
    • Setting it to local will use the local repo alone, which is fastest and more reliable if applicable.
    • If you want to use both local and upstream repositories, you can set it to local,node,infra,pgsql

Pros and Cons

If you are using the exact same OS minor version above, using offline packages is advised.

Advantages of using offline package

  • Official offline packages are tested.
  • The easiest way to deliver on Internet isolated environment.
  • Speed up the installation process by pre-download all packages in one-pass.
  • The snapshot is ensured working without worrying about upstream dependency breakage.

Disadvantages of using offline package

  • If OS minor version not match, OS rpm/deb packages may break
  • It may not contain the latest updates and OS security patches.

Bootstrap

The bootstrap script will automatically detect /tmp/pkg.tgz and extract it to /www/pigsty by default. It will also set up the os package manager repo file and install ansible and other utils.

Where are my repo files?

Bootstrap will wipe-out existing repo by default to ensure only the required repos are installed.

You can find them in /etc/yum.repos.d/backup (EL) or /etc/apt/backup (debian / ubuntu)

If you want to keep your existing repo

You can use the -k|--keep parameter to keep the existing repo files intact:

./bootstrap -k # or --keep

Make offline package

If your OS choice is not in the default offline package offering list, you can make your own offline package with the built-in cache.yml playbook.

Find a node running exact same OS version with the Internet access

Run standard online installation procedure (use the rich template: configure -c rich)

cd ~/pigsty; ./cache.yml: make and fetch the offline package to dist/${version}/

Copy the offline package to the environment without Internet access (ftp, scp, usb,...)

Behavior Change in v3.6

Since Pigsty v3.6, most configuration templates install packages directly from Internet upstream, rather than downloading to the admin node first to build a local repository and then installing from it. You can restore the previous default behavior by adjusting parameters, which is useful if you need to build your own offline packages:

Some configuration templates, such as rich and full, still retain the old behavior — building local repositories first before using them, so no adjustment is needed.

We offer paid service to make offline packages for precise Linux major.minor versions. ($30)


Hybrid Approach

There's a hybrid approach to using the offline package and do online install upon it. This could be useful if your OS repo is a local Intranet repo.

Let's say you are using RockyLinux 9.5, but the official offline package is made for RockyLinux 9.6.

You can use the el9 offline packages, and run the make repo-build before the ./install.yml, to force Pigsty to perform a repo build task (infra.repo).

If you want to use the latest version or resolve any dependency conflict, you can remove these rpm/deb and run make repo-build, pigsty will re-download them from the upstream repo.