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
0 answers

How to fetch redis cli set json and fetch from Get Api Spring boot redis?

I want response from redis cli to postman as this http://localhost:8585/api/home/getBestTrainerBasedRating [ { "trainerid": 28, "rating": 5.0, "trainerName": "yellow", "courseName": "", "price": 0.0, …
1
vote
0 answers

Dockerized Redis cluster nodes

I am trying to set up a dockerized redis cluster spanning multiple host machines. In my curretn setup I have two hosts with public ip addresses and start a similar configuration on both, this config consists of a compose.yml: services: …
MarkusSPE
  • 81
  • 1
  • 10
1
vote
2 answers

redis delete does not delete the key

In my redis database I have a key: 127.0.0.1:6379[5]> get…
1
vote
1 answer

redis-cli --pipe yields MOVED errors when bulk uploading to Elasticache with cluster-mode enabled

I am trying to use redis-cli --pipe to bulk upload some commands to my AWS Elasticache for redis cluster. The commands come from parsing a file via a custom awk command, which helps generate some HSET commands. The awk command is in a custom shell…
DBOY
  • 13
  • 3
1
vote
1 answer

how do i export all keys to csv file redis-cli?

I am looking to export everything in Redis to a file using redis-cli I understand redis-cli -h XXXX --csv get keyname[****] > filename.csv will export the one given key to a file, but how do I get every single key/value that exists into a file?
lsg
  • 11
  • 2
1
vote
1 answer

How to store object inside Redis Hash value in Node JS

I am using npm redis package to store data into redis . I want to store below data into "user:123" cache key. { child1:{key1:val1,key2:val2}, child2:{key1:val1,key2:val2}, child3:{key1:val1,key2:val2} } …
Shree
  • 145
  • 4
  • 15
1
vote
1 answer

How to efficiently set multiple related keys in redis?

I want to execute the following in a bash script: num_total_keys=0x1FFFF for ((i = 0; i <= $num_total_keys; i++)) do redis-cli SET some_prefix:$i True > /dev/null done When I execute this, however, it takes a really long time. Is there a more…
hermit.crab
  • 852
  • 1
  • 8
  • 20
1
vote
1 answer

'kubectl run' redis-cli directly

I want to start a container and directly run redis-cli interactively inside. For some reason, in my attempts, the input is always ignored. Launching an interactive shell and then launching the program manually works: # in my local shell: $ kubectl…
Balz Guenat
  • 1,552
  • 2
  • 15
  • 35
1
vote
1 answer

Export/import/backup RedisGraph database

I've got a little too far with RedisGraph and now it's about to ship in production. Therefore I need to export and import some data between servers and also to create backups. I'm using the open source community version (not the Redis…
vinyll
  • 11,017
  • 2
  • 48
  • 37
1
vote
2 answers

Redis password error from one server but not from another

I'm trying to connect to a redis server from two different servers, call them server1 and server2 From server1 I cannot login, using the right or the wrong password I always get: user@server1:~$ redis-cli -h…
Way Too Simple
  • 275
  • 1
  • 2
  • 10
1
vote
1 answer

How to flush Redis keyspace of expired keys?

Backstory: The keyspace of the Redis database in question reports a large amount of expired keys and memory usage is maxed out. The application using this database is experiencing (rare) intermittent timeouts and I thought (in my limited knowledge)…
Neil C. Obremski
  • 18,696
  • 24
  • 83
  • 112
1
vote
1 answer

redis-cli: How to change the output delimiter to the NUL character?

I like to get the members of a set, NUL-separated. What do I do? redis-cli SMEMBERS theset Uses the newline delimiter.
HappyFace
  • 3,439
  • 2
  • 24
  • 43
1
vote
1 answer

redis-cli interactive mode: how to use --bigkeys

redis-cli -h host -p port --bigkeys will show a list of large keys, which is very convenient. but in my environment, I am limited to the interactive mode. Before I can type any commands, it's already connected to redis via interactive mode.…
Cui Pengfei 崔鹏飞
  • 8,017
  • 6
  • 46
  • 87
1
vote
1 answer

Redis Clustering Waiting for the cluster to join Private VPC

I have 3 EC2 Instances with Redis Running like this: Server 001: 10.0.1.203, Port: 6379 Server 002: 10.0.1.202, Port: 6380 Server 003: 10.0.1.190, Port: 6381 Config file for each one: # bind 127.0.0.1 protected-mode no port PORT pidfile…
Ulises
  • 406
  • 7
  • 22
1
vote
1 answer

Is there any redis-cli cmd to know redis has replayed all the data from dump.rdb snapshot

I have a requirement to dynamically turn on appendonly setting after redis replayed all the data from backup file dump.rdb. So is there any redis-cli cmd to know that redis has loaded all the data from dump.rdb snapshot?#