- 概述
- 要求
- 预安装
- 安装
- 安装后
- 迁移和升级
- 监控和警示
- 集群管理
- 特定于产品的配置
- 故障排除
通过运算符 Hub 部署 Redis
通过 OpenShift OperatorHub 安装 Redis Enterprise 运算符,以在 Automation Suite 中进行缓存。
Automation Suite 上的 UiPath™ 产品需要使用 Redis 以确保缓存功能。 您可以通过以下选项来满足 Redis 缓存要求:
- 在 OpenShift 集群或 OpenShift 集群外部的其他服务器上安装和配置 Redis。
- 在 OpenShift 集群上安装 Redis 企业版运算符。要通过 OperatorHub 安装 Redis Enterprise 运算符,请按照本部分中的说明进行操作。
如果您在同一个集群上安装多个 Automation Suite 实例,请为每个安装配置单独的 Redis 实例。不要在安装多个 Automation Suite 的计算机上共享单个 Redis 实例。
每个 Redis 实例都可以位于集群中的任何命名空间中 - 它不必与其服务的 Automation Suite 安装的命名空间匹配。但是,每个 Redis 实例都必须使用自己的专用命名空间;两个 Redis 实例不能共享命名空间。对于每个安装,请在其 input.json 文件中指定该安装的 Redis 主机名和凭据。
- Automation Suite 未附带 Redis 企业版操作员许可证。您必须直接从 Redis 获取许可证,或使用 UiPath 提供的 HAA Redis 许可证。
- 如果您使用 Redis Enterprise Operator 6.2.18-41 版或更早版本,则必须在安装运算符之前安装安全上下文约束。有关详细信息,请参阅Redis 文档。
安装 Redis 企业运算符
采取以下步骤,通过 Orchestrator Hub 安装 Redis 企业版运算符:
- 在 OpenShift 界面中,导航到“运算符”> “运算符 Hub” 。
- 在搜索字段中,搜索“Redis 企业版” 。
- 在结果列表中选择“Redis 提供的 Redis 企业版运算符” 。该条目被标记为“已认证” 。默认情况下,映像从 Red Hat 注册表拉取。
- 在“安装运算符”页面上,为运算符指定命名空间。仅支持每个运算符一个命名空间。
- 使用要安装的版本更新频道。有关特定版本的详细信息,请参阅运算符发布说明。
- 选择批准策略。对于生产系统,请使用“手动”以确保运算符更新需要您的批准。
- 选择“安装”并批准安装计划。
您可以在“Operators”> “已安装的运算符”中监控 Redis Enterprise 运算符订阅的状态。
创建 Redis 企业版集群
请按照以下步骤创建 Redis 企业版集群:
-
创建包含以下内容的
redis-enterprise-cluster.yaml文件:--- apiVersion: app.redislabs.com/v1 kind: RedisEnterpriseCluster metadata: name: rec spec: bootstrapperImageSpec: repository: registry.connect.redhat.com/redislabs/redis-enterprise-operator persistentSpec: enabled: true redisEnterpriseServicesRiggerImageSpec: repository: registry.connect.redhat.com/redislabs/services-manager redisEnterpriseImageSpec: imagePullPolicy: IfNotPresent repository: registry.connect.redhat.com/redislabs/redis-enterprise nodes: 1 uiServiceType: ClusterIP--- apiVersion: app.redislabs.com/v1 kind: RedisEnterpriseCluster metadata: name: rec spec: bootstrapperImageSpec: repository: registry.connect.redhat.com/redislabs/redis-enterprise-operator persistentSpec: enabled: true redisEnterpriseServicesRiggerImageSpec: repository: registry.connect.redhat.com/redislabs/services-manager redisEnterpriseImageSpec: imagePullPolicy: IfNotPresent repository: registry.connect.redhat.com/redislabs/redis-enterprise nodes: 1 uiServiceType: ClusterIP设置 YAML 文件中
nodes参数的值,以确定在 Redis 企业版集群中运行的 Pod 数量。 -
通过运行以下命令,将 YAML 文件中的配置应用到 OpenShift 集群:
备注:将命令中的
<redis-namespace>占位符替换为您在上一步中使用的命名空间。oc apply -f redis-enterprise-cluster.yaml -n "<redis-namespace>"oc apply -f redis-enterprise-cluster.yaml -n "<redis-namespace>" -
使用以下命令验证集群是否处于
Running状态。 该命令要求您在计算机上安装jq实用程序。oc get RedisEnterpriseCluster -n <redis-system> -o json | jq -r '.items[0].status.state'oc get RedisEnterpriseCluster -n <redis-system> -o json | jq -r '.items[0].status.state'要安装
jq,请使用以下选项之一:- 选项 1:运行以下命令:
yum install -y epel-release yum install -y jqyum install -y epel-release yum install -y jq - 选项 2:运行以下命令:
shell curl https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/j/jq-1.6-2.el7.x86_64.rpm --output /tmp/jq-1.6-2.el7.x86_64.rpm yum localinstall /tmp/jq-1.6-2.el7.x86_64.rpmshell curl https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/j/jq-1.6-2.el7.x86_64.rpm --output /tmp/jq-1.6-2.el7.x86_64.rpm yum localinstall /tmp/jq-1.6-2.el7.x86_64.rpm
- 选项 1:运行以下命令:
创建 Redis 数据库
请采取以下步骤创建 Redis 数据库:
- 创建包含以下内容的
redis-database.yaml文件:--- apiVersion: app.redislabs.com/v1alpha1 kind: RedisEnterpriseDatabase metadata: name: redb spec: tlsMode: disabled databasePort: 6380--- apiVersion: app.redislabs.com/v1alpha1 kind: RedisEnterpriseDatabase metadata: name: redb spec: tlsMode: disabled databasePort: 6380 - 通过运行以下命令,将 YAML 文件中的配置应用到 OpenShift 集群:
备注:
将命令中的
<redis-namespace>占位符替换为您在上一步中使用的命名空间。oc apply -f redis-database.yaml -n "<redis-namespace>"oc apply -f redis-database.yaml -n "<redis-namespace>" - 通过运行以下命令验证数据库是否处于
active状态:oc get redisenterprisedatabase -n "<redis_namespace>" -o json | jq -r '.items[0].status.status'oc get redisenterprisedatabase -n "<redis_namespace>" -o json | jq -r '.items[0].status.status'
更新集群配置文件
要通过运算符 Hub 部署 Redis,您需要将以下部分添加到input.json配置文件中。将<redis-namespace>和<password>占位符替换为适当的值:
"fabric": {
"redis": {
"hostname": "redb.<redis-namespace>.svc.cluster.local",
"port": 6380,
"password": "<password>",
"tls": false
}
},
"fabric": {
"redis": {
"hostname": "redb.<redis-namespace>.svc.cluster.local",
"port": 6380,
"password": "<password>",
"tls": false
}
},
要检索密码,请运行以下命令:
oc get secret -n <redis-namespace> redb-redb -o json | jq -r '.data.password' | base64 -d
oc get secret -n <redis-namespace> redb-redb -o json | jq -r '.data.password' | base64 -d