Redis monitoring

Redis offers CLI (command line interface) tools for monitoring. To check if Redis process is working fine you should issue following command on the server where it runs:

redis-cli ping

Feedback is given with the exit code of the command above. You can get it's value from environment variable $? with following command

echo $?

Below you can find meaning of the exit codes

Exit code ($?)Meaning
0OK - Works fine
2CRIT - There are some issues with Redis

Redis itself opens following ports

PortPurpose
6379/TCPData exchange

This port can be used for checking if the service is still running.

Delete RedisAI models

In order to delete one, or all of the NLU models from RedisAI, follow steps below.

Check and copy NLU model ID from NLUs listing in Automate GUI:

model ID is '51d9a411-9a79-43ac-b722-b4034a1ff72d' in our example.

Identify RedisAI master nodes - to do this, match pods IPs with RedisAI nodes configuration:
(remember to provide correct namespace for kubectl commands)

kubectl get pods --namespace redis-ai -o wide

# Example output:
NAME                       READY   STATUS    RESTARTS   AGE    IP               NODE         NOMINATED NODE   READINESS GATES
redis-ai-redis-cluster-0   2/2     Running   0          101d   10.233.69.234    w2-k8s-dev   <none>           <none>
redis-ai-redis-cluster-1   2/2     Running   0          101d   10.233.69.212    w2-k8s-dev   <none>           <none>
redis-ai-redis-cluster-2   2/2     Running   0          101d   10.233.107.238   w1-k8s-dev   <none>           <none>
redis-ai-redis-cluster-3   2/2     Running   0          101d   10.233.107.215   w1-k8s-dev   <none>           <none>
redis-ai-redis-cluster-4   2/2     Running   0          101d   10.233.107.235   w1-k8s-dev   <none>           <none>
redis-ai-redis-cluster-5   2/2     Running   0          101d   10.233.69.215    w2-k8s-dev   <none>           <none>

get cluster nodes informations from one of the RedisAI pod:

kubectl -n redis-ai exec redis-ai-redis-cluster-0 -- cat /bitnami/redis/data/nodes.conf

# Example output:
Defaulted container "redis-ai-redis-cluster" out of: redis-ai-redis-cluster, metrics
344d02e4b91e4950feec10b68c6423a589ffaa0b 10.233.107.238:6379@16379 master - 0 1717184724159 3 connected 10923-16383
33dcc702673f17a729a659a6fe96e11eef672bae 10.233.69.234:6379@16379 myself,master - 0 1717184722000 1 connected 0-5460
802bb8615547ba0db6d9e484c51f25fd20e590af 10.233.107.235:6379@16379 slave 33dcc702673f17a729a659a6fe96e11eef672bae 0 1717184721144 1 connected
dd93980376be896feda5499d89c9c2eb2673e032 10.233.107.215:6379@16379 slave 344d02e4b91e4950feec10b68c6423a589ffaa0b 0 1717184722149 3 connected
87b98c573b9884d97853ade29df61db4f97b7571 10.233.69.215:6379@16379 slave e4a9fd3d4c209598821a674dda34dfdf8b827f98 0 1717184723154 2 connected
e4a9fd3d4c209598821a674dda34dfdf8b827f98 10.233.69.212:6379@16379 master - 0 1717184723000 2 connected 5461-10922
vars currentEpoch 6 lastVoteEpoch 0

based on this, we know that the master nodes are:

10.233.69.234 -> redis-ai-redis-cluster-0
10.233.69.212 -> redis-ai-redis-cluster-1
10.233.107.238 -> redis-ai-redis-cluster-2

Now, we need to search every master node for specific model ID:

# paste your NLU model ID after grep command:
kubectl -n redis-ai exec redis-ai-redis-cluster-0 -- sh -c "redis-cli AI._MODELSCAN | grep 51d9a411-9a79-43ac-b722-b4034a1ff72d"

If model is found, full KEY will be returned, for example:

{51d9a411-9a79-43ac-b722-b4034a1ff72d}::intentizer::model

Copy full KEY returned in previous step, and delete model with following command (use the same master pod):

# replace '{51d9a411-9a79-43ac-b722-b4034a1ff72d}::intentizer::model' with your copied KEY
kubectl -n redis-ai exec redis-ai-redis-cluster-0 -- redis-cli AI.MODELDEL {51d9a411-9a79-43ac-b722-b4034a1ff72d}::intentizer::model

if deletion was successful, output should return "OK".

To delete ALL models from RedisAI, execute following command against each of the master pods:

kubectl -n redis-ai exec redis-ai-redis-cluster-0 -- sh -c "redis-cli AI._MODELSCAN | grep '::intentizer::model' | awk '{print \$1}' | xargs -I {} redis-cli AI.MODELDEL {}"