Questions tagged [redis-cli]

redis-cli is the command line interface that is installed when installing Redis.

redis-cli 3.0.5

Usage: redis-cli [OPTIONS] [cmd [arg [arg ...]]]
  -h <hostname>      Server hostname (default: 127.0.0.1).
  -p <port>          Server port (default: 6379).
  -s <socket>        Server socket (overrides hostname and port).
  -a <password>      Password to use when connecting to the server.
  -r <repeat>        Execute specified command N times.
  -i <interval>      When -r is used, waits <interval> seconds per command.
                     It is possible to specify sub-second times like -i 0.1.
  -n <db>            Database number.
  -x                 Read last argument from STDIN.
  -d <delimiter>     Multi-bulk delimiter in for raw formatting (default: \n).
  -c                 Enable cluster mode (follow -ASK and -MOVED redirections).
  --raw              Use raw formatting for replies (default when STDOUT is
                     not a tty).
  --no-raw           Force formatted output even when STDOUT is not a tty.
  --csv              Output in CSV format.
  --stat             Print rolling stats about server: mem, clients, ...
  --latency          Enter a special mode continuously sampling latency.
  --latency-history  Like --latency but tracking latency changes over time.
                     Default time interval is 15 sec. Change it using -i.
  --latency-dist     Shows latency as a spectrum, requires xterm 256 colors.
                     Default time interval is 1 sec. Change it using -i.

  --lru-test <keys>  Simulate a cache workload with an 80-20 distribution.

  --slave            Simulate a slave showing commands received from the master.
  --rdb <filename>   Transfer an RDB dump from remote server to local file.
  --pipe             Transfer raw Redis protocol from stdin to server.
  --pipe-timeout <n> In --pipe mode, abort with error if after sending all data.
                     no reply is received within <n> seconds.
                     Default timeout: 30. Use 0 to wait forever.
  --bigkeys          Sample Redis keys looking for big keys.
  --scan             List all keys using the SCAN command.
  --pattern <pat>    Useful with --scan to specify a SCAN pattern.
  --intrinsic-latency <sec> Run a test to measure intrinsic system latency.
                     The test will run for the specified amount of seconds.
  --eval <file>      Send an EVAL command using the Lua script at <file>.
  --help             Output this help and exit.
  --version          Output version and exit.

Examples:
  cat /etc/passwd | redis-cli -x set mypasswd
  redis-cli get mypasswd
  redis-cli -r 100 lpush mylist x
  redis-cli -r 100 -i 1 info | grep used_memory_human:
  redis-cli --eval myscript.lua key1 key2 , arg1 arg2 arg3
  redis-cli --scan --pattern '*:12345*'

  (Note: when using --eval the comma separates KEYS[] from ARGV[] items)

When no command is given, redis-cli starts in interactive mode.
Type "help" in interactive mode for information on available commands.
278 questions
1
vote
2 answers

How to run a redis cluster on a docker cluster?

Context I am trying to setup a redis cluster so that it runs on top off a docker cluster, to achieve maximum auto-healing. More precisely, I have a docker compose file, which defines a service that has 3 replicas. Each service replica has a…
1
vote
1 answer

redis-cli 'sentinel slaves redis-cluster' returns an empty list with a password protected master

sentinel slaves returns an empty list with a password protected master. My current redis-cluster setup is the following: 3 Different linux servers srv 1 => redis master + sentinel 1 srv 2 => redis slaves + sentinel 2 srv 3 => sentinel 3…
Orsius
  • 830
  • 1
  • 11
  • 18
1
vote
1 answer

Installing redis CLI

I am new to redis and I am installing redis cli, using the below tutorial. https://www.digitalocean.com/community/tutorials/how-to-install-and-use-redis this tutorial suggests to do sudo make install after make test, but when I am doing "sudo…
1
vote
1 answer

Redis arabic language decoding

I use Redis with PHP, with phpRedis connector. When i save a word in arabic language I can't retrieve this word, it's return encoding values. In redis the problem is solved if I connect with: >redis-cli --raw Example…
amic
  • 85
  • 7
1
vote
3 answers

redis client and node js - hgetall method fails with empty results

This is day one for me with redis cilent and node js. I'm trying to replicate this command that I run via the redis-cli in node.js: 127.0.0.1:6379> HGETALL widgets:9145090003_00:00_00:00 1) "id" 2) "33305" 3) "loc" 4) "jamaica" 5) "days" 6)…
Happydevdays
  • 1,982
  • 5
  • 31
  • 57
1
vote
0 answers

Redis for Windows script debugger gets stuck

Performing a simple test to debug a LUA script, redis-cli gets stuck and does not accept any input. They only way of ending the session is doing Ctrl+C c:>cd "\Program Files\Redis" c:\Program Files\Redis>echo return ARGV[1] + ARGV[2] >…
vtortola
  • 34,709
  • 29
  • 161
  • 263
1
vote
2 answers

From a given Redis cluster, how can I run a Redis CLI or API call to get a list of EVERY key on that whole cluster, not just one machine?

This is only for initial Redis setup. Obviously, on production systems, a dump of the entire multi-machine database would be difficult to sort through. I'd accept an answer in any language, although I prefer Python. A simple Redis CLI command for…
Nathan Basanese
  • 8,475
  • 10
  • 37
  • 66
1
vote
1 answer

UTF-8 in redis-cli

I'm trying to show UTF-8 content in redis-cli. I've tried this solution: redis-cli --raw which was suggested here: Redis - problem with accents (UTF-8 encoding) But this is what i'm getting: מחוז ירושלים Can someone assist ?
ohadinho
  • 6,894
  • 16
  • 71
  • 124
1
vote
1 answer

Escaping special characters while storing JSON as string in Redis

I am trying to store JSON data in Redis through PHP, but testing it through the redis-cli command line client. In both clients, I seem to be unable to store JSON without escaping it somehow. redis 127.0.0.1:6379> set test1…
user2151176
  • 21
  • 1
  • 4
1
vote
1 answer

How can I set a sample size using redis-cli --latency command?

I'm trying to write a script to monitor the redis latency from my server. I saw about the redis-cli --latency command but can't find any way to preset to sample size it should actually measure, so I can actually see the difference in latency over…
Mr. Adobo
  • 815
  • 1
  • 12
  • 24
0
votes
2 answers

RedisJSON - Manipulating the JSON array of objects (Using Node Redis client)

This is the data [ { "senderID": "64d9c926c17fd183a93d5e35", "receiverID": "64d9c92dc17fd183a93d5e39", "timestamp": "2023-08-14T07:39:45.946Z", "content": "bru", "status": "delivered", "type": "chat", "messageID":…
0
votes
0 answers

Why does redis-cli DUMP (rdcli) return (nil) when the value passed is a loop control variable?

My goal is to loop over a list of keys and generate a DUMP for each key I am using redis-cli installed via npm which is why I call it as rdcli # For reading comprehension: export RED="rdcli -h $redis_endpoint -p $redis_port -a $redis_pass" # This…
Simon
  • 855
  • 9
  • 24
0
votes
0 answers

How to retry succeeded job with bullmq

I am trying to restart a job in bull mq with using only redis-cli. The reason of not using JS api or just recreating a job is because redis is inside the k9s cluster on production and i basically unable to connect to it from outside. But i have…
0
votes
1 answer

Can I implement a redis job queue with plain bash and redis-cli?

I am relatively new to redis, and I am looking to implement a job queue as a simple list of job ids (and nothing else in redis). I've searched around, but couldn't find examples of how to do this in plain shell interface (redis-cli). The examples…
thor
  • 21,418
  • 31
  • 87
  • 173
0
votes
2 answers

Redis client-side cache (tracking) test

I'm testing Redis client-side caching using redis-cli. Redis server version: 7.0.11 redis-cli version: 7.0.11 redis-cli 1 I started with the monitor command: redis-cli monitor In redis-cli 2 I run the snippet: HELLO: 3 CLIENT TRACKING ON PREFIX…