《OpenShift 4.x HOL教程汇总》
已在 RHEL 8.4 上验证
本文的前置条件:RHEL8 - 配置基于安装 ISO 文件的 YUM Repo
在 RHEL 8 中把软件源分成了两部分,一个是BaseOS,另一个是AppStream。在 RHEL 8 的ISO中有BaseOS和AppStream安装源存储库。
- BaseOS 存储库:BaseOS 存储库以传统 RPM 包的形式提供底层核心 OS 内容。
- AppStream 存储库:Application Stream 存储库提供用户可能希望在给定用户空间中运行的所有应用程序。
- 执行命令,查看RHEL中AppStream自带的应用模块。
$ yum module list
Updating Subscription Management repositories.
Last metadata expiration check: 0:06:34 ago on Sat 05 Jun 2021 02:52:55 AM EDT.
Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)
Name Stream Profiles Summary
389-ds 1.4 389 Directory Server (base)
ant 1.10 [d] common [ Java build tool
d]
container-tools rhel8 [d][e] common [ Most recent (rolling) versions of podman, buildah, skopeo, runc, conmon, runc, conmon, CRIU,
d] Udica, etc as well as dependencies such as container-selinux built and tested together, and u
pdated as frequently as every 12 weeks.
container-tools 1.0 common [ Stable versions of podman 1.0, buildah 1.5, skopeo 0.1, runc, conmon, CRIU, Udica, etc as wel
d] l as dependencies such as container-selinux built and tested together, and supported for 24 m
onths.
container-tools 2.0 common [ Stable versions of podman 1.6, buildah 1.11, skopeo 0.1, runc, conmon, etc as well as depende
d] ncies such as container-selinux built and tested together, and supported as documented on the
Application Stream lifecycle page.
container-tools 3.0 common [ Stable versions of podman 3.0, buildah 1.19, skopeo 1.2, runc, conmon, etc as well as depende
d] ncies such as container-selinux built and tested together, and supported as documented on the
Application Stream lifecycle page.
eclipse rhel8 java [d] An open, extensible IDE and application platform
freeradius 3.0 [d] server [ High-performance and highly configurable free RADIUS server
d]
gimp 2.8 [d] common [ gimp module
d], deve
l
go-toolset rhel8 [d] common [ Go
d]
httpd 2.4 [d][e] common [ Apache HTTP Server
d], deve
l, minim
al
idm DL1 adtrust, The Red Hat Enterprise Linux Identity Management system module
client,
common
[d], dns
, server
idm client [d] common [ RHEL IdM long term support client module
d]
inkscape 0.92.3 [d] common [ Vector-based drawing program using SVG
d]
javapackages-runtime 201801 [d] common [ Basic runtime utilities to support Java applications
d]
jmc rhel8 [d] common [ Java Mission Control is a profiling and diagnostics tool for the Hotspot JVM
d], core
libselinux-python 2.8 common Python 2 bindings for libselinux
llvm-toolset rhel8 [d][e] common [ LLVM
d]
mailman 2.1 [d] common [ Electronic mail discussion and e-newsletter lists managing software
d]
mariadb 10.3 [d] client, MariaDB Module
galera,
server [
d]
mariadb 10.5 client, MariaDB Module
galera,
server [
d]
maven 3.5 [d] common [ Java project management and project comprehension tool
d]
maven 3.6 common [ Java project management and project comprehension tool
d]
mercurial 4.8 [d] common [ Mercurial -- a distributed SCM
d]
mod_auth_openidc 2.3 Apache module suporting OpenID Connect authentication
mysql 8.0 [d] client, MySQL Module
server [
d]
nginx 1.14 [d] common [ nginx webserver
d]
nginx 1.16 common [ nginx webserver
d]
nginx 1.18 common [ nginx webserver
d]
nodejs 10 [d] common [ Javascript runtime
d], deve
lopment,
minimal
, s2i
nodejs 12 common [ Javascript runtime
d], deve
lopment,
minimal
, s2i
nodejs 14 common [ Javascript runtime
d], deve
lopment,
minimal
, s2i
parfait 0.5 common Parfait Module
perl 5.24 common [ Practical Extraction and Report Language
d], mini
mal
perl 5.26 [d][e] common [ Practical Extraction and Report Language
d], mini
mal
perl 5.30 common [ Practical Extraction and Report Language
d], mini
mal
perl-App-cpanminus 1.7044 [d] common [ Get, unpack, build and install CPAN modules
d]
perl-DBD-MySQL 4.046 [d] common [ A MySQL interface for Perl
d]
perl-DBD-Pg 3.7 [d] common [ A PostgreSQL interface for Perl
d]
perl-DBD-SQLite 1.58 [d] common [ SQLite DBI driver
d]
perl-DBI 1.641 [d] common [ A database access API for Perl
d]
perl-FCGI 0.78 [d] common [ FastCGI Perl bindings
d]
perl-IO-Socket-SSL 2.066 [d][e] common [ Perl library for transparent TLS
d]
perl-YAML 1.24 [d] common [ Perl parser for YAML
d]
perl-libwww-perl 6.34 [d][e] common [ A Perl interface to the World-Wide Web
d]
php 7.2 [d] common [ PHP scripting language
d], deve
l, minim
al
php 7.3 common [ PHP scripting language
d], deve
l, minim
al
php 7.4 common [ PHP scripting language
d], deve
l, minim
al
pki-core 10.6 PKI Core module for PKI 10.6 or later
pki-deps 10.6 PKI Dependencies module for PKI 10.6 or later
pmdk 1_fileformat_v6 Persistent Memory Development Kit (former NVML)
postgresql 9.6 client, PostgreSQL server and client module
server [
d]
postgresql 10 [d][e] client, PostgreSQL server and client module
server [
d] [i]
postgresql 12 client, PostgreSQL server and client module
server [
d]
postgresql 13 client, PostgreSQL server and client module
server [
d]
python27 2.7 [d] common [ Python programming language, version 2.7
d]
python36 3.6 [d] build, c Python programming language, version 3.6
ommon [d
]
python38 3.8 [d] build, c Python programming language, version 3.8
ommon [d
]
python39 3.9 [d] build, c Python programming language, version 3.9
ommon [d
]
redis 5 [d] common [ Redis persistent key-value database
d]
redis 6 common [ Redis persistent key-value database
d]
rhn-tools 1.0 [d] common [ Red Hat Satellite 5 tools for RHEL
d]
ruby 2.5 [d] common [ An interpreter of object-oriented scripting language
d]
ruby 2.6 common [ An interpreter of object-oriented scripting language
d]
ruby 2.7 common [ An interpreter of object-oriented scripting language
d]
rust-toolset rhel8 [d] common [ Rust
d]
satellite-5-client 1.0 [d] common [ Red Hat Satellite 5 client packages
d], gui
scala 2.10 [d] common [ A hybrid functional/object-oriented language for the JVM
d]
squid 4 [d] common [ Squid - Optimising Web Delivery
d]
subversion 1.10 [d] common [ Apache Subversion
d], serv
er
subversion 1.14 common [ Apache Subversion
d], serv
er
swig 3.0 [d] common [ Connects C/C++/Objective C to some high-level programming languages
d], comp
lete
swig 4.0 common [ Connects C/C++/Objective C to some high-level programming languages
d], comp
lete
varnish 6 [d] common [ Varnish HTTP cache
d]
virt rhel [d][e] common [ Virtualization module
- 只查看postgresql的模块。通过下方说明确认当前缺省会安装的服务器版本是10。
$ yum module list postgresql
Updating Subscription Management repositories.
Last metadata expiration check: 0:00:22 ago on Sat 05 Jun 2021 02:52:55 AM EDT.
Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)
Name Stream Profiles Summary
postgresql 9.6 client, server [d] PostgreSQL server and client module
postgresql 10 [d] client, server [d] PostgreSQL server and client module
postgresql 12 client, server [d] PostgreSQL server and client module
postgresql 13 client, server [d] PostgreSQL server and client module
Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled
- 安装postgresql。
$ yum -y module install postgresql
- 再次查看postgresql的模块。通过下方说明确认当前已经安装的版本为10。
$ yum module list postgresql
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Last metadata expiration check: 3:20:39 ago on Sat 05 Jun 2021 07:51:56 AM CST.
rhel8-appstream
Name Stream Profiles Summary
postgresql 9.6 client, server [d] PostgreSQL server and client module
postgresql 10 [d][e] client, server [d] [i] PostgreSQL server and client module
postgresql 12 client, server [d] PostgreSQL server and client module
postgresql 13 client, server [d] PostgreSQL server and client module
Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled
- 确认已经安装的版本号。
$ postgres --version
postgres (PostgreSQL) 10.15
- 删除已经安装的postgresql
$ yum -y module remove postgresql
- 再次查看postgresql的模块。通过下方说明确认当前允许使用的版本为10。
$ yum module list postgresql
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Last metadata expiration check: 3:23:26 ago on Sat 05 Jun 2021 07:51:56 AM CST.
rhel8-appstream
Name Stream Profiles Summary
postgresql 9.6 client, server [d] PostgreSQL server and client module
postgresql 10 [d][e] client, server [d] PostgreSQL server and client module
postgresql 12 client, server [d] PostgreSQL server and client module
postgresql 13 client, server [d] PostgreSQL server and client module
Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled
- 尝试安装postgresql:12,确认不允许安装非“enabled”的版本。
$ yum -y module install postgresql:12
Updating Subscription Management repositories.
Last metadata expiration check: 0:33:34 ago on Sat 05 Jun 2021 02:52:55 AM EDT.
Dependencies resolved.
The operation would result in switching of module 'postgresql' stream '10' to stream '12'
Error: It is not possible to switch enabled streams of a module.
It is recommended to remove all installed content from the module, and reset the module using 'yum module reset <module_name>' command. After you reset the module, you can install the other stream.
- 尝试“enable” postgresql:12,确认不允许直接“enabled”另一个版本。
$ yum -y module enable postgresql:12
Updating Subscription Management repositories.
Last metadata expiration check: 0:33:34 ago on Sat 05 Jun 2021 02:52:55 AM EDT.
Dependencies resolved.
The operation would result in switching of module 'postgresql' stream '10' to stream '12'
Error: It is not possible to switch enabled streams of a module.
It is recommended to remove all installed content from the module, and reset the module using 'yum module reset <module_name>' command. After you reset the module, you can install the other stream.
- “disable”掉postgresql中所有项目
$ yum module disable postgresql
- 再次查看postgresql,确认所有版本都被“disabled”了。
$ yum module list postgresql
Updating Subscription Management repositories.
Last metadata expiration check: 0:34:35 ago on Sat 05 Jun 2021 02:52:55 AM EDT.
Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)
Name Stream Profiles Summary
postgresql 9.6 [x] client, server [d] PostgreSQL server and client module
postgresql 10 [d][x] client, server [d] PostgreSQL server and client module
postgresql 12 [x] client, server [d] PostgreSQL server and client module
postgresql 13 [x] client, server [d] PostgreSQL server and client module
Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled
- “enable”安装版本为12的postgresql。
$ yum -y module enable postgresql:12
- 再次查看postgresql,确认版本12的postgresql是“enabled”状态。
$ yum module list postgresql
Updating Subscription Management repositories.
Last metadata expiration check: 0:35:36 ago on Sat 05 Jun 2021 02:52:55 AM EDT.
Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)
Name Stream Profiles Summary
postgresql 9.6 client, server [d] PostgreSQL server and client module
postgresql 10 [d] client, server [d] PostgreSQL server and client module
postgresql 12 [e] client, server [d] PostgreSQL server and client module
postgresql 13 client, server [d] PostgreSQL server and client module
Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled
- 尝试安装版本为10的postgresql,确认无法安装。
$ yum -y module install postgresql:10
Updating Subscription Management repositories.
Last metadata expiration check: 0:38:54 ago on Sat 05 Jun 2021 02:52:55 AM EDT.
Dependencies resolved.
The operation would result in switching of module 'postgresql' stream '12' to stream '10'
Error: It is not possible to switch enabled streams of a module.
It is recommended to remove all installed content from the module, and reset the module using 'yum module reset <module_name>' command. After you reset the module, you can install the other stream.
- 安装版本为12的postgresql,确认可以安装。
$ yum -y module install postgresql:12
- 再次查看postgresql,确认版本12的postgresql是“installed”状态。
$ yum module list postgresql
Updating Subscription Management repositories.
Last metadata expiration check: 0:40:01 ago on Sat 05 Jun 2021 02:52:55 AM EDT.
Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)
Name Stream Profiles Summary
postgresql 9.6 client, server [d] PostgreSQL server and client module
postgresql 10 [d] client, server [d] PostgreSQL server and client module
postgresql 12 [e] client, server [d] [i] PostgreSQL server and client module
postgresql 13 client, server [d] PostgreSQL server and client module
Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled
- 确认postgres运行环境的版本。
$ postgres --version
postgres (PostgreSQL) 12.5