From 503f02ee8c7fc8e4c2f996c6dcca186ab7799143 Mon Sep 17 00:00:00 2001 From: Michele Cereda Date: Thu, 25 May 2023 21:38:10 +0200 Subject: [PATCH] refactor: dedicate article to the cli utility --- knowledge base/redis-cli.md | 56 +++++++++++++++++++++++++++++++++++++ knowledge base/redis.md | 11 -------- 2 files changed, 56 insertions(+), 11 deletions(-) create mode 100644 knowledge base/redis-cli.md delete mode 100644 knowledge base/redis.md diff --git a/knowledge base/redis-cli.md b/knowledge base/redis-cli.md new file mode 100644 index 0000000..e3cc459 --- /dev/null +++ b/knowledge base/redis-cli.md @@ -0,0 +1,56 @@ +# `redis-cli` + +## Table of contents + +1. [TL;DR](#tldr) +1. [Further readings](#further-readings) +1. [Sources](#sources) + +## TL;DR + +```sh +# Install it. +asdf plugin add 'redis-cli' && asdf install 'redis-cli' '6.2.12' +brew install 'redis' +dnf install 'redis' + +# Connect to servers. +redis-cli -s 'socket' +redis-cli -h 'host.fqdn' -p 'port' +redis-cli … -a 'password' +REDISCLI_AUTH='password' redis-cli +redis-cli -u 'redis://username:password@host.fqdn:port/db_number' + +# Execute commands. +redis-cli 'command' 'arg_1' … 'arg_N' +redis-cli -h 'localhost' 'PING' +redis-cli -n 'db_number' 'INCR' 'a' + +# Execute commands from the master's container in kubernetes. +kubectl exec redis-0 -- redis-cli 'PING' + +# Debug the server. +redis-cli … 'MONITOR' +``` + +## Further readings + +- Redis' [website] +- Redis' [documentation] + +## Sources + +- [cheat.sh] + +All the references in the [further readings] section, plus the following: + + +[documentation]: https://redis.io/docs/ +[website]: https://redis.io/ + + +[further readings]: #further-readings + + + +[cheat.sh]: https://cheat.sh/redis-cli diff --git a/knowledge base/redis.md b/knowledge base/redis.md deleted file mode 100644 index b95f382..0000000 --- a/knowledge base/redis.md +++ /dev/null @@ -1,11 +0,0 @@ -# Redis - -## TL;DR - -```sh -# debug the server -redis-cli -h "${HOST}" -p "${PORT}" --user "${USERNAME}" --askpass MONITOR - -# execute the commands from the master's container on kubernetes -kubectl exec redis-0 -- redis-cli MONITOR -```