第 10 章 使用 RHUI 4 命令
Red Hat Update Infrastructure 提供了一个强大的脚本界面,用于管理 RHUI 节点、存储库和客户端配置。
10.1. 使用 RHUI 4 CLI 选项 复制链接链接已复制到粘贴板!
Red Hat Update Infrastructure 4 的大多数管理任务都是其安装中。安装后,它会自行运行,定期从红帽 CDN 获取更新的软件包,并自动将那些软件包提供给客户端。
名为 Red Hat Update Infrastructure Management Tool 的命令行界面(使用 rhui-manager运行 )有助于安装。此工具提供了每个 RHUI 组件所需的配置元素的交互式提示:RHUA、CDS 和 load-balancer。该工具还提供了用来获取红帽提供的内容证书,以便在连接到 Red Hat CDN 时使用并生成内部云相关证书,以供客户端用于连接到 RHUI。Red Hat Update Infrastructure Management Tool 允许云供应商生成客户端配置捆绑包,以便在客户端 RHEL 实例中安装。此捆绑包允许客户端从 RHUI 安装中获取更新。
Red Hat Update Infrastructure Management Tool 使用互动 shell ; 一些功能也可以在 shell 提示符中运行。Red Hat Update Infrastructure Management Tool 使用七大命令。对于每个命令的 子命令,如果 子命令需要一个或多个选项 -h 和 --help,则提供一个选项列表。
查看所有选项和命令。
10.1.1. cert 复制链接链接已复制到粘贴板!
Red Hat content certificate management
upload : uploads a new content certificate
info : display information about the current content certificate
Red Hat content certificate management
upload : uploads a new content certificate
info : display information about the current content certificate
rhui-manager cert upload
# rhui-manager cert upload
upload: uploads a new content certificate
--cert - full path to the new content certificate (required)
--key - full path to the new content certificate's key
10.1.2. 软件包 复制链接链接已复制到粘贴板!
package manipulation on repositories
list : lists all packages in a repository
remove : removes a package from a custom repository
upload : uploads a package or directory of packages to a custom repository
remote : uploads RPM content from a remote URL to a custom repository
package manipulation on repositories
list : lists all packages in a repository
remove : removes a package from a custom repository
upload : uploads a package or directory of packages to a custom repository
remote : uploads RPM content from a remote URL to a custom repository
list: lists all packages in a repository
--repo_id - id of the repository to list packages for (required)
list: lists all packages in a repository
--repo_id - id of the repository to list packages for (required)
remove: removes a package from a custom repository
--repo_id - id of the custom repository to remove a package from (required)
--package - name of the package to be removed (required)
--vr - if specified, only the supplied version-release of the package will be removed
--force - don't ask for confirmation
remove: removes a package from a custom repository
--repo_id - id of the custom repository to remove a package from (required)
--package - name of the package to be removed (required)
--vr - if specified, only the supplied version-release of the package will be removed
--force - don't ask for confirmation
upload: uploads a package or directory of packages to a custom repository
--repo_id - id of the custom repository where the packages will be uploaded (required)
--packages - path to an .rpm file or directory of RPMs that will be uploaded (required)
upload: uploads a package or directory of packages to a custom repository
--repo_id - id of the custom repository where the packages will be uploaded (required)
--packages - path to an .rpm file or directory of RPMs that will be uploaded (required)
remote: uploads RPM content from a remote URL to a custom repository
--repo_id - id of the custom repository where the packages will be uploaded (required)
--url - remote URL of the package or a web page that will be scraped for RPM content (required)
remote: uploads RPM content from a remote URL to a custom repository
--repo_id - id of the custom repository where the packages will be uploaded (required)
--url - remote URL of the package or a web page that will be scraped for RPM content (required)
10.1.3. repo 复制链接链接已复制到粘贴板!
info: displays information on an individual repo
--repo_id - identifies the repository to display (required)
info: displays information on an individual repo
--repo_id - identifies the repository to display (required)
add: add a Red Hat repository to the RHUA
--product_name - product to add the RHUA (required)
add: add a Red Hat repository to the RHUA
--product_name - product to add the RHUA (required)
add_by_repo: add Red Hat repositories to the RHUA via repo ID
--repo_ids - repo IDs to add, comma-separated (required)
--sync-now - Use to sync any repos that are added (optional)
add_by_repo: add Red Hat repositories to the RHUA via repo ID
--repo_ids - repo IDs to add, comma-separated (required)
--sync-now - Use to sync any repos that are added (optional)
add_by_file: add Red Hat repositories to the RHUA using an input file
--file - file containing repo IDs to add, one per line (required)
--sync_now - Use to sync any repos that are added (optional)
add_by_file: add Red Hat repositories to the RHUA using an input file
--file - file containing repo IDs to add, one per line (required)
--sync_now - Use to sync any repos that are added (optional)
add_errata: associate errata metadata with a repository
--repo_id - repo ID to associate the metadata with (required)
--updateinfo - updateinfo file to be applied (required)
add_errata: associate errata metadata with a repository
--repo_id - repo ID to associate the metadata with (required)
--updateinfo - updateinfo file to be applied (required)
add_comps: associate comps metadata (group/category/environment/langpacks) with a repository
--repo_id - repo ID to associate the metadata with (required)
--comps - comps file to be applied (required)
add_comps: associate comps metadata (group/category/environment/langpacks) with a repository
--repo_id - repo ID to associate the metadata with (required)
--comps - comps file to be applied (required)
delete: delete a repository
--repo_id - identifies the repository to delete (required)
delete: delete a repository
--repo_id - identifies the repository to delete (required)
sync: sync a repository
--repo_id - identifies the repository to sync (required)
sync: sync a repository
--repo_id - identifies the repository to sync (required)
set_retain_versions: limits the number of older repository versions kept in database
--repo_id - identifies the repository to operate on
--all - operate on all repositories (either --repo_id or --all must be provided, but not both)
--versions - number of versions to keep (required)
--dry_run - display what will be executed without actually executing
set_retain_versions: limits the number of older repository versions kept in database
--repo_id - identifies the repository to operate on
--all - operate on all repositories (either --repo_id or --all must be provided, but not both)
--versions - number of versions to keep (required)
--dry_run - display what will be executed without actually executing
orphan_cleanup: submits a background task to remove orphaned artifacts from storage
orphan_cleanup: submits a background task to remove orphaned artifacts from storage
export: export a repository to the filesystem --repo_id - identifies the repository to export (required)
export: export a repository to the filesystem
--repo_id - identifies the repository to export (required)
metadata : ensure metadata is generated for the latest version of repositories --repo_id - explicit repo ID to generate metadata for
metadata : ensure metadata is generated for the latest version of repositories
--repo_id - explicit repo ID to generate metadata for
enable_sync: enable scheduled synchronization of a repository
--repo_id - identifies the repository to enable scheduled synchronization for (required)
--verbose - if present, info on last/next synchronization tasks will be displayed
enable_sync: enable scheduled synchronization of a repository
--repo_id - identifies the repository to enable scheduled synchronization for (required)
--verbose - if present, info on last/next synchronization tasks will be displayed
disable_sync: disable scheduled synchronization of a repository
--repo_id - identifies the repository to disable scheduled synchronization for (required)
--verbose - if present, info on last/next synchronization tasks will be displayed
disable_sync: disable scheduled synchronization of a repository
--repo_id - identifies the repository to disable scheduled synchronization for (required)
--verbose - if present, info on last/next synchronization tasks will be displayed
enable_autopublish: enable automatic publishing of a new repository version
--repo_id - identifies the repository to enable automatic publishing for (required)
enable_autopublish: enable automatic publishing of a new repository version
--repo_id - identifies the repository to enable automatic publishing for (required)
disable_autopublish: disable automatic publishing of a new repository version
--repo_id - identifies the repository to disable automatic publishing for (required)
disable_autopublish: disable automatic publishing of a new repository version
--repo_id - identifies the repository to disable automatic publishing for (required)
unused: list all unused Red Hat repositories Loading latest entitled products from Red Hat... ... listings loaded Available Repositories --------------------
unused: list all unused Red Hat repositories
Loading latest entitled products from Red Hat...
... listings loaded
Available Repositories
--------------------
10.1.4. cds 复制链接链接已复制到粘贴板!
CDS listing and manipulation
list : lists all cds instances in the RHUI
add : register a cds instance to the RHUI
reinstall : reinstalls an already registered cds instance
delete : unregisters cds instances from the RHUI
CDS listing and manipulation
list : lists all cds instances in the RHUI
add : register a cds instance to the RHUI
reinstall : reinstalls an already registered cds instance
delete : unregisters cds instances from the RHUI
reinstall: reinstalls an already registered cds instance
--hostname - The hostname of the instance to reinstall on; this instance must be registered already.
--all - Reinstall all the registered instances.
--no_update - Use this flag to prevent the final dnf update; it must be specified every time this functionality is desired.
reinstall: reinstalls an already registered cds instance
--hostname - The hostname of the instance to reinstall on; this instance must be registered already.
--all - Reinstall all the registered instances.
--no_update - Use this flag to prevent the final dnf update; it must be specified every time this functionality is desired.
delete: unregisters cds instances from the RHUI
--force - Delete the system, even if it is the last of its kind.
--hostnames - Comma-separated list of hostnames to delete (unregister) from RHUI. (required)
delete: unregisters cds instances from the RHUI
--force - Delete the system, even if it is the last of its kind.
--hostnames - Comma-separated list of hostnames to delete (unregister) from RHUI. (required)
10.1.5. migrate 复制链接链接已复制到粘贴板!
10.1.6. hapoxy 复制链接链接已复制到粘贴板!
Load balancer listing and manipulation
list : lists all haproxy instances in the RHUI
add : register a haproxy instance to the RHUI
reinstall : reinstalls an already registered haproxy instance
delete : unregisters haproxy instances from the RHUI
Load balancer listing and manipulation
list : lists all haproxy instances in the RHUI
add : register a haproxy instance to the RHUI
reinstall : reinstalls an already registered haproxy instance
delete : unregisters haproxy instances from the RHUI
reinstall: reinstalls an already registered haproxy instance
--hostname - The hostname of the instance to reinstall on; this instance must be registered already.
--all - Reinstall all the registered instances.
--no_update - Use this flag to prevent the final dnf update; it must be specified every time this functionality is desired.
reinstall: reinstalls an already registered haproxy instance
--hostname - The hostname of the instance to reinstall on; this instance must be registered already.
--all - Reinstall all the registered instances.
--no_update - Use this flag to prevent the final dnf update; it must be specified every time this functionality is desired.
delete: unregisters haproxy instances from the RHUI
--force - Delete the system, even if it is the last of its kind.
--hostnames - Comma-separated list of hostnames to delete (unregister) from RHUI. (required)
delete: unregisters haproxy instances from the RHUI
--force - Delete the system, even if it is the last of its kind.
--hostnames - Comma-separated list of hostnames to delete (unregister) from RHUI. (required)
10.1.7. status 复制链接链接已复制到粘贴板!
status: RHUI status and health information
--code - if specified, only a numeric code for the result will be displayed
--repo_json - Name of the JSON file for a repo status
status: RHUI status and health information
--code - if specified, only a numeric code for the result will be displayed
--repo_json - Name of the JSON file for a repo status
10.1.8. 客户端 复制链接链接已复制到粘贴板!
cert: create a content certificate for a rhui client
--repo_label - identifies the repositories to add. Comma delimited string of repo labels (required)
--name - identifies the certificate name (required)
--days - number of days cert will be valid (required)
--dir - directory where the certificate will be stored (required)
cert: create a content certificate for a rhui client
--repo_label - identifies the repositories to add. Comma delimited string of repo labels (required)
--name - identifies the certificate name (required)
--days - number of days cert will be valid (required)
--dir - directory where the certificate will be stored (required)