PIGSTY

离线安装

如何在没有互联网访问的情况下安装 pigsty?

Pigsty 默认从互联网上游 安装,但有些环境与互联网隔离。 为了解决这个问题,Pigsty 支持从 离线软件包 进行离线安装。

下载 pigsty 离线软件包,将其放到 /tmp/pkg.tgz

下载 pigsty 源码包,解压(假设到 ~/pigsty

cd ~/pigsty; ./bootstrap,它将解压软件包并使用本地仓库

vi ~/pigsty.yml,覆盖 node_repo_modules 设为 local 以使用本地仓库

照常运行 ./install.yml。它将从本地仓库安装所有内容。


什么是离线软件包?

离线软件包打包了所有需要的 RPM/DEB 软件包及其依赖; 它本质上是在正常 安装 后采取的本地 APT / YUM 仓库的快照压缩包。

您可以从 GitHub 发布页面 找到这些软件包,例如:

df64ac0c2b5aab39dd29698a640daf2e  pigsty-v3.6.0.tgz
cea861e2b4ec7ff5318e1b3c30b470cb  pigsty-pkg-v3.6.0.d12.aarch64.tgz
2f253af87e19550057c0e7fca876d37c  pigsty-pkg-v3.6.0.d12.x86_64.tgz
0158145b9bbf0e4a120b8bfa8b44f857  pigsty-pkg-v3.6.0.el8.aarch64.tgz
07330d687d04d26e7d569c8755426c5a  pigsty-pkg-v3.6.0.el8.x86_64.tgz
311df5a342b39e3288ebb8d14d81e0d1  pigsty-pkg-v3.6.0.el9.aarch64.tgz
92aad54cc1822b06d3e04a870ae14e29  pigsty-pkg-v3.6.0.el9.x86_64.tgz
c4fadf1645c8bbe3e83d5a01497fa9ca  pigsty-pkg-v3.6.0.u22.aarch64.tgz
5477ed6be96f156a43acd740df8a9b9b  pigsty-pkg-v3.6.0.u22.x86_64.tgz
196169afc1be02f93fcc599d42d005ca  pigsty-pkg-v3.6.0.u24.aarch64.tgz
dbe5c1e8a242a62fe6f6e1f6e6b6c281  pigsty-pkg-v3.6.0.u24.x86_64.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.0/pigsty-pkg-v3.6.0.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.


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

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,...)

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 remove the /www/pigsty/repo_complete marker file, to force Pigsty to perform a repo build stage (infra.repo) during installation.

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