- 概述
- 要求
- 安装
- 安装后
- 集群管理
- 监控和警示
- 迁移和升级
- 特定于产品的配置
- 最佳实践和维护
- 故障排除
- 无法获取沙盒映像
- Pod 未显示在 ArgoCD 用户界面中
- Redis 探测器失败
- RKE2 服务器无法启动
- 在 UiPath 命名空间中找不到密码
- 初始安装后,ArgoCD 应用程序进入“进行中”状态
- MongoDB Pod 处于 CrashLoopBackOff 状态或在删除后处于“等待 PVC 配置”状态
- 意外错误:不一致;手动运行 fsck
- 集群还原后 MongoDB 或业务应用程序降级
- 缺少 Self-heal-operator 和 Sf-k8-utils 存储库
- 集群还原或回滚后服务不正常
- RabbitMQ Pod 卡在 CrashLoopBackOff 中
- Prometheus 处于 CrashLoopBackoff 状态,并出现内存不足 (OOM) 错误
- 监控仪表板中缺少 Ceph-rook 指标
- Pod 无法在代理环境中与 FQDN 通信
- 使用 Automation Suite 诊断工具
- 使用 Automation Suite 支持捆绑包
- 探索日志
使用 uipathctl.sh
uipathctl.sh脚本提供了一种自动化方法,用于将集群升级到较新版本、配置备份、还原集群等,方法是在一个节点上运行。 这些任务的自动化是通过 IT 自动化工具 Ansible 完成的。
要求
Ansible 使用 SSH 机制登录到任何主机节点或计算机以执行任务。
在运行uipathctl.sh脚本之前,您必须执行以下步骤:
- 识别 Ansible 主机节点。
- 将节点的 SSH 签名添加到已知主机。
- 设置 SSH 身份验证方法。
- 安装 Ansible 和其他必备工具。
有关说明,请参阅以下部分。
识别 Ansible 主机节点
Ansible 主机节点是安装 Ansible 的计算机。 此计算机必须是服务器节点,以便具有执行集群中所有自动化所需的权限。
在在线安装中,Ansible 主机节点可以是任何服务器节点。
在离线安装中,Ansible 主机节点必须是您在/uipath位置装载 UiPath 捆绑包磁盘的主服务器节点。 如果没有附加 UiPath 捆绑包磁盘的服务器节点,您只需将其他磁盘挂载到任何现有服务器节点,并将其视为 Ansible 主机节点。
将节点的 SSH 签名添加到已知主机
要将节点的 SSH 签名添加到已知主机,请将集群中每个节点的私有 IP 地址添加到 Ansible 主机节点的known_hosts文件中。
在 Ansible 主机节点上运行以下命令,每次将<node-private-ip>替换为集群中每个节点的私有 IP 地址。
ssh-keyscan -H <node-private-ip> >> ~/.ssh/known_hosts
ssh-keyscan -H <node-private-ip> >> ~/.ssh/known_hosts
设置 SSH 身份验证方法
Ansible 支持两种 SSH 机制:
- Option 1: Key-based SSH authentication – Recommended. It uses private and public keys.
- 选项 2:基于密码的 SSH 身份验证
选项 1:基于密钥的 SSH 身份验证(推荐)
步骤 1:设置 SSH 密钥
SSH 密钥身份验证机制使用私钥和公钥的组合。
确保通过复制所有其他节点上的 Ansible 主机节点的公钥来授予访问权限。
如果您没有 SSH 密钥,则可以通过运行ssh-keygen命令生成一个。
生成 SSH 密钥
您可以使用ssh-keygen命令生成新的 SSH 密钥。 要生成新的 SSH 密钥,只需运行 ssh-keygen 命令并按照说明进行操作。
要生成新的 SSH 密钥,请执行以下步骤:
- 使用
ssh-keygen命令生成新的 SSH 密钥。 - 记下密钥的位置。 默认值为:
- 公钥:
~/.ssh/id_rsa.pub - 私钥:
~/.ssh/id_rsa
- 公钥:
- 通过复制,授予对所有其他节点上 Ansible 主机节点公钥的访问权限。
授予对每个节点上公钥的访问权限
要授予对公钥的访问权限,请使用ssh-copy-id命令将其复制到集群中的所有节点(包括当前节点)。 如果 SSH 公钥的路径不是~/.ssh/id_rsa.pub ,请确保进行相应的替换。
ssh-copy-id -i ~/.ssh/id_rsa.pub username@node-private-ip
ssh-copy-id -i ~/.ssh/id_rsa.pub username@node-private-ip
步骤 2:提供对 Ansible 的 SSH 密钥访问权限
Ansible 使用 SSH 机制登录主机并执行所需的安装。 因此,您必须提供对 Ansible 的 SSH 密钥访问权限。
在以下方法中进行选择:
选项 1:使用ssh-agent (推荐)
By default, Ansible uses ssh-agent to obtain access to nodes. For more information about ssh-agent, see ssh-agent manual.
要向ssh-agent添加新密钥,请运行以下命令:
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
选项 2:使用不受保护的私钥
仅当您的私钥不受密码保护时,才支持此选项。
此方法需要以交互方式使用私钥,方法是将--ansible-private-key参数添加到uipathctl.sh脚本中。 该参数采用私钥的绝对路径并将其用于身份验证。
选项 2:基于密码的 SSH 身份验证
如果选择基于密码的 SSH 身份验证,则必须向uipathctl.sh脚本提供--ansible-ask-password参数。 此参数将提示您提供身份验证密码。
安装 Ansible 和其他必备工具
检查是否已安装 Ansible 和其他必备工具
您必须确保在先前选择的 Ansible 主机节点上安装 Ansible 和以下其他支持工具。
-
ansible(v2.8+)要检查是否已安装
ansible,请运行:ansible --version &>/dev/null || echo "Error: Ansible is not installed"ansible --version &>/dev/null || echo "Error: Ansible is not installed" -
ansible-playbook要检查是否已安装
ansible-playbook,请运行:ansible-playbook --version &>/dev/null || echo "Error: Ansible Playbook is not installed"ansible-playbook --version &>/dev/null || echo "Error: Ansible Playbook is not installed" -
sshpass– 仅在将密码与--ansible-ask-password参数一起使用进行身份验证时才需要。要检查是否已安装
sshpass,请运行:sshpass -V &>/dev/null || echo "Error: sshpass is not installed"sshpass -V &>/dev/null || echo "Error: sshpass is not installed" -
zip– 要检查是否已安装zip,请运行:zip --version &>/dev/null || echo "Error: zip is not installed"zip --version &>/dev/null || echo "Error: zip is not installed"重要提示:如果上述任何命令出错,则表示您的计算机上未安装目标包。 要安装所有所需工具,请执行以下部分中的步骤。 如果已安装所有工具,则可以跳过这些步骤。
安装 Ansible 和其他必备工具
要安装 Ansible 和其他相关包,请执行以下步骤:
- 导航到 Ansible 主机节点上的安装程序文件夹。 安装程序通常位于
/opt/UiPathAutomationSuite/{version}文件夹中。 - 运行以下命令:
-
对于在线:
./uipathctl.sh install-prerequisites --install-type online --accept-license-agreement./uipathctl.sh install-prerequisites --install-type online --accept-license-agreement- 对于离线:
You need an additional Ansible tarball, which contains Ansible and other dependent packages. Download ansible.tar.gz and store it anywhere outside the installer folder. For download instructions, see ansible.tar.gz.
如果ansible.tar.gz位于其他位置,请更新--offline-prerequisites-bundle参数的绝对位置。
./uipathctl.sh install-prerequisites --install-type offline --offline-prerequisites-bundle ../ansible.tar.gz --accept-license-agreement
./uipathctl.sh install-prerequisites --install-type offline --offline-prerequisites-bundle ../ansible.tar.gz --accept-license-agreement
高级 Ansible 配置
生成 Ansible Inventory.ini 文件
在某些情况下,例如在配置备份或升级时,Automation Suite 会自动为 Ansible 生成inventory.ini文件。 但是,在少数情况下,您必须构建inventory.ini文件并将其提供给 Ansible。 例如:
- 从备份数据还原集群时。 这是因为在还原时,没有运行状况良好的集群可派生
inventory.ini。 - 当您要提供特定于每个节点的高级配置(例如用户名和 SSH 密钥)时。
For more details, see How to build your own inventory.
以下代码块显示uipathctl.sh脚本可以识别的清单模板。
[FIRST_SERVER]
'10.0.1.1'
[SECONDARY_SERVERS]
'10.0.1.2'
'10.0.1.3'
[AGENTS]
'10.0.1.4'
'10.0.1.5'
[TASKMINING]
'10.0.1.6'
[GPU]
'10.0.1.7'
[all:vars]
ansible_connection=ssh
ansible_timeout=10
ansible_user=admin
[FIRST_SERVER]
'10.0.1.1'
[SECONDARY_SERVERS]
'10.0.1.2'
'10.0.1.3'
[AGENTS]
'10.0.1.4'
'10.0.1.5'
[TASKMINING]
'10.0.1.6'
[GPU]
'10.0.1.7'
[all:vars]
ansible_connection=ssh
ansible_timeout=10
ansible_user=admin
| 组 | 值 |
|---|---|
|
|
运行 您必须提供此节点的专用 IP 地址。 |
|
|
集群中其他服务器节点的组。 您必须提供所有其他服务器节点的专用 IP 地址。 |
|
|
集群中的代理节点组。 您必须提供所有代理节点的私有 IP 地址。 |
|
|
集群中 Task Mining 节点的组。 您必须提供所有 Task Mining 节点的私有 IP 地址。 |
|
|
集群中 GPU 节点的组。 您必须提供所有 GPU 节点的私有 IP 地址。 |
|
|
应用于所有先前定义的主机组的变量组。
You can provide the variables per group or per host node. For details, see Assigning a variable to many machines: group variables. |
生成 Ansible 变量文件
对于其他节点上的 Ansible 业务流程,您必须定义一些参数,Ansible 使用这些参数来确定其他节点上安装程序和相应文件的位置。 这些参数在Yaml文件中定义,并提供给 Ansible。
如果要修改默认配置,请按以下格式创建文件,并使用--ansible-variables-file将其提供给uipathctl.sh }。
#Path where installer zip is available. By default, uipathctl.sh takes the current folder and compress it to zip before copying it to other nodes.
installer_path: /path/to/installer.zip
# Path where installer will be copied on nodes
target_installer_base_path: /opt/UiPathAutomationSuite/<version>/installer
# Install type - online or offline
install_type: online
# Path on nodes where offline bundles will be copied
target_bundle_base_path: /opt/UiPathAutomationSuite/{version}
# Path on nodes where offline bundles will be extracted
target_tmp_path: /opt/UiPathAutomationSuite/tmp
# Basepath and filname for the various config files and bundles on the local machine
cluster_config_filename: cluster_config.json
cluster_config_basepath: /var/tmp/uipathctl_{version}
backup_config_filename: backup_config.json
backup_config_basepath: /var/tmp/uipathctl_{version}
restore_config_filename: restore.json
restore_config_basepath: /var/tmp/uipathctl_{version}
infra_bundle_filename: sf-infra.tar.gz
infra_bundle_basepath: /var/tmp/uipath_upgrade_<version>
#Path where installer zip is available. By default, uipathctl.sh takes the current folder and compress it to zip before copying it to other nodes.
installer_path: /path/to/installer.zip
# Path where installer will be copied on nodes
target_installer_base_path: /opt/UiPathAutomationSuite/<version>/installer
# Install type - online or offline
install_type: online
# Path on nodes where offline bundles will be copied
target_bundle_base_path: /opt/UiPathAutomationSuite/{version}
# Path on nodes where offline bundles will be extracted
target_tmp_path: /opt/UiPathAutomationSuite/tmp
# Basepath and filname for the various config files and bundles on the local machine
cluster_config_filename: cluster_config.json
cluster_config_basepath: /var/tmp/uipathctl_{version}
backup_config_filename: backup_config.json
backup_config_basepath: /var/tmp/uipathctl_{version}
restore_config_filename: restore.json
restore_config_basepath: /var/tmp/uipathctl_{version}
infra_bundle_filename: sf-infra.tar.gz
infra_bundle_basepath: /var/tmp/uipath_upgrade_<version>
| 变量 | 值 |
|---|---|
installer_path | sf-installer.zip的路径。 如果不提供此值, uipathctl.sh将压缩当前目录并将其作为安装程序 zip 复制到其他节点。 |
target_installer_base_path | 安装程序将在节点上复制到的路径。 默认值为“/opt/UiPathAutomationSuite/{version |
install_type | 安装方法。 可能的值为: online和offline 。 |
target_bundle_base_path | 将在其中复制离线捆绑包的节点上的路径。 默认位置为/var/tmp/uipathctl_{version} 。 |
target_tmp_path | 提取捆绑包的节点上的路径。 默认位置为/opt/UiPathAutomationSuite/tmp 。 |
cluster_config_filename | 集群配置文件的名称。 默认值为cluster_config.json 。 |
cluster_config_basepath | 在编排期间, cluster_config.json将临时存储在节点上的位置。 默认值为/var/tmp/uipathctl_{version} 。 |
backup_config_filename | 备份配置文件的名称。 默认值为backup.json 。 |
backup_config_basepath | 在编排期间, backup.json将临时存储在节点上的位置。 默认值为/var/tmp/uipathctl_{version} 。 |
restore_config_filename | 还原配置文件的名称。 默认值为restore.json 。 |
restore_config_basepath | 在编排期间, restore.json 将临时存储在节点上的位置。 默认值为 `/var/tmp/uipathctl_{version |
infra_bundle_filename | 包含基础架构层的捆绑包的名称。 这与您提供给uipathctl.sh脚本的内容相同。 |
infra_bundle_basepath | 在编排期间, sf-infra.tar.gz将临时存储在节点上的位置。 这与您提供给uipathctl.sh脚本的内容相同。 |