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
0
votes
1 answer

redis: get key-value from another computer

Computer B wants key-value from computer A. Redis-server is on computer A with ip address 192.16.0.2, port 6379. Computer B with ip address 192.16.0.3 tries to get data from computer A. I tried redis-cli -h 192.168.0.2 -h 6379. But there is no…
ingyu koh
  • 1
  • 1
0
votes
1 answer

why does the value of LASTSAVE changes when I load a redis backup?

According to Redis official documentation: LASTSAVE Return the UNIX TIME of the last DB save executed with success. However, when I execute LASTSAVE I get the timestamp of the last restored backup instead of the last DB save executed. In other…
cristobal
  • 1
  • 1
0
votes
1 answer

storing data into redis through cron job

I want to store data into redis from pandas through a cron job every 15 minute and below is my code:- I am taking data into pandas every 15 minutes with below code and sending it to the redis dictionary mydict2 through a cron job. import sys import…
user10177566
0
votes
1 answer

Redis data - interpretation of results

I'm starting to work with a Redis database and I have been querying a key that is of type hash. I do an HSCAN to check some values and its format. I get the following results. I was wondering if there is any way I can know what's the representation…
Brandon
  • 512
  • 8
  • 26
0
votes
1 answer

In Spring Data Redis, how to pass multiple keys into leftpop() (rightpop()) method with timeout?

As far as I'm concerned, this method is similar to BLPOP command in redis-cli. The latter, however, is able to get multiple lists in its signature. Is it possible with leftPop() method too? From docs: Removes and returns first element from lists…
amseager
  • 5,795
  • 4
  • 24
  • 47
0
votes
0 answers

How can I check/compute the "delete hit rate" on redis?

It's well known that we are able to calculate redis hit-rate by using redis-cli info command(to check key_hits and key_misses). However, these two metrics record only hits&misses in query cases(i.e., GET command) . Are there any ways to solve my…
jaki
  • 1
  • 1
0
votes
1 answer

Assignment of slots to nodes method

I'm trying to modify a script in which I was using redis-trib. For various reasons I can't use it now, but I can use redis-CLI. The point is that when it comes to assigning slots to nodes, is it done in blocks or in some way? That is, if there are 3…
Hugo L.M
  • 1,053
  • 17
  • 31
0
votes
0 answers

Redis mass insert not inserting everything

I'm trying to use redis massinsert over network with a 1.8gb file. It has about 6,000,000 entries, but only 900,000 are being added. Any reason for this? cat massinsert.txt | redis-cli -h **myaddress** --pipe
brandonunited
  • 83
  • 2
  • 6
0
votes
1 answer

Is there a way to create help in terminal like redis-cli?

I'm now using redis-cli to play with redis. And as I see redis-cli help me with arguments to command, so I'm easily understand order of arguments to type. I don't need to open documentation. You can see this on picture. I'm find this VERY…
0
votes
1 answer

Redis CLI scan pattern and unlink/delete multiple patterns in a single call

I have keys stored in my Redis as given below. project:page_1_user_1 project:page_1_user_2 project:page_1_user_3 project:page_2_user_1 project:page_2_user_2 project:page_3_user_1 To delete the keys matching the pattern, I use the below command as…
Alok Agarwal
  • 1
  • 1
  • 3
0
votes
2 answers

On loading a file in redis, a new line is being inserted in value, how to avoid this

I am trying to upload a file in redis using command: redis-cli -p -h -n -x set < /tmp/file.json The problem is : in redis value - It is storing a \n at the end of line and I don't want…
Pankaj Kumar Katiyar
  • 1,474
  • 1
  • 20
  • 36
0
votes
1 answer

Delete keys with pattern in redis having redis-cli password

How to delete keys with pattern having redis-cli password? Records i needs to remove: redis-cli -p 6379 -a password KEYS "/st_files/281/*" | wc -l 9 I want to remove the values under /st_files/281/* Which has count 9. My redis setup has…
0
votes
1 answer

Add new server to Redis cluster

I've just set up a Redis cluster, which is working fine. The structure is the following: Server 1 | Server 2 | Server 3 Master A | Master B | Master C Slave B | Slave C | Slave A Master A <-> Slave A Master B <-> Slave B Master C <-> Slave C I'm…
Tobias Lorenz
  • 1,426
  • 11
  • 17
0
votes
1 answer

How to find list of sources[IP] of the redis messages in Redis server

My Redis Server instance handles with multiple publishers. How can I find the list of sources[IP] which published messages in Redis Server in a particular time limit?
robinrjoe
  • 329
  • 2
  • 14
0
votes
1 answer

intersect multiple sets with lua script using redis.call("sinter", ...) command

I want to intersect multiple sets (2 or more). The number of sets to be intersected are passed as ARGV from command line. As number of sets are being passed from command-line. So the number of arguments in redis.call() function are uncertain. How…
Amit Upadhyay
  • 7,179
  • 4
  • 43
  • 57