UiPath Documentation
automation-suite
2.2510
true
Linux 版 Automation Suite 安装指南
重要 :
请注意,此内容已使用机器翻译进行了部分本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。

如何清除 Redis 数据

使用适用于 Linux 上 Automation Suite 的 FLUSHALL 命令清除 Redis 集群中的所有数据。

要清除 Redis 中存储的所有数据并将其重置为空状态,请执行以下步骤:

  1. 识别密钥名称、密码和端口:

    export KUBECONFIG="/etc/rancher/rke2/rke2.yaml"; export PATH=$PATH:/var/lib/rancher/rke2/bin;
    secretName=$(kubectl get redb redis-cluster-db -o jsonpath="{.spec.databaseSecretName}" -n redis-system)
    password=$(kubectl get secret $secretName -o jsonpath="{.data.password}" -n redis-system | base64 --decode)
    port=$(kubectl get secret $secretName -o jsonpath="{.data.port}" -n redis-system | base64 --decode)
    export KUBECONFIG="/etc/rancher/rke2/rke2.yaml"; export PATH=$PATH:/var/lib/rancher/rke2/bin;
    secretName=$(kubectl get redb redis-cluster-db -o jsonpath="{.spec.databaseSecretName}" -n redis-system)
    password=$(kubectl get secret $secretName -o jsonpath="{.data.password}" -n redis-system | base64 --decode)
    port=$(kubectl get secret $secretName -o jsonpath="{.data.port}" -n redis-system | base64 --decode)
    
  2. 识别服务名称:

    kubectl get secret $secretName -o jsonpath="{.data.service_names}" -n redis-system | base64 --decode
    kubectl get secret $secretName -o jsonpath="{.data.service_names}" -n redis-system | base64 --decode
    
  3. 假设上一个命令的输出是:redis-cluster-db, redis-cluster-db-headless。您必须调用以下 FLUSHALL 命令:

    kubectl exec -ti -n redis-system redis-cluster-0 -- redis-cli -h redis-cluster-db -p $port -a $password FLUSHALL
    
    kubectl exec -ti -n redis-system redis-cluster-0 -- redis-cli -h redis-cluster-db-headless -p $port -a $password FLUSHALL
    kubectl exec -ti -n redis-system redis-cluster-0 -- redis-cli -h redis-cluster-db -p $port -a $password FLUSHALL
    
    kubectl exec -ti -n redis-system redis-cluster-0 -- redis-cli -h redis-cluster-db-headless -p $port -a $password FLUSHALL
    

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新