Automation Suite
2022.10
False
Imagen de fondo del banner
Guía de instalación de Automation Suite
Última actualización 24 de abr. de 2024

Cómo borrar datos de Redis

Para borrar todos los datos almacenados en Redis y restablecerlos a un estado vacío, sigue los siguientes pasos:

  1. Identifique el nombre, la contraseña y el puerto secretos:

    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. Identifique los nombres de los servicios:

    kubectl get secret $secretName -o jsonpath="{.data.service_names}" -n redis-system | base64 --decodekubectl get secret $secretName -o jsonpath="{.data.service_names}" -n redis-system | base64 --decode
  3. Supongamos que la salida del comando anterior es: redis-cluster-db, redis-cluster-db-headless. Debe llamar a los siguientes comandos 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 FLUSHALLkubectl 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

Was this page helpful?

Obtén la ayuda que necesitas
RPA para el aprendizaje - Cursos de automatización
Foro de la comunidad UiPath
Logotipo blanco de UiPath
Confianza y seguridad
© 2005-2024 UiPath. All rights reserved.