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
2
votes
3 answers

Cannot Connect To AWS Elasticache Redis Cluster From Local Machine

I recently created a Redis cluster on AWS elasticache and am having trouble connecting via redis-cli from my local machine. Every time I run the command: redis-cli -h -p 6379 the connection is never established and eventually…
2
votes
3 answers

Docker Redis - Seeding Data - Cannot execute redis-cli via Dockerfile or via shell script

Have a single Redis instance set up via docker-compose (using my Redis Dockerfile), all working. Now I'm trying to seed the Redis instance with data after the container has started. (1) Trying to run redis-cli directly in Dockerfile (that is run by…
pete19
  • 333
  • 1
  • 3
  • 17
2
votes
1 answer

Execute Redis command with server timeout

Is there a way to execute a command in Redis, where you supply a server-side timeout? For example, I want to execute a command that can take more than 3 sec. In that case, I would want that the Redis server will stop the execution of the command…
Yoav Abadi
  • 403
  • 7
  • 16
2
votes
1 answer

Redis clean up cluster nodes

I have a Redis cluster with 6 nodes (3 masters,3 slaves). One of the nodes has been replaced with a new one but the old container is left in the list of nodes: 0ab126e86a172a9471a25ff3d2241b2793b87539 :0@0 master,fail,noaddr - 1627299797915…
oroblam
  • 109
  • 4
  • 17
2
votes
0 answers

Why does Redis scan return keys which belong to another node

When I scan the Redis using below command: redis-cli -h -p 6379 --scan --pattern '*' it returns keys which belong to this node, but it also returns many keys which belong to another redis node. Therefore if I run below…
user389955
  • 9,605
  • 14
  • 56
  • 98
2
votes
2 answers

Unable to run `redis-cli` on Windows 10 Enterprise machine

I have installed redis-cli on my Windows 10 Enterprise using node npm and it is now installed at the location: AppData\Roaming\npm\node_modules\redis-cli I have also added the following folder to my PATH…
meallhour
  • 13,921
  • 21
  • 60
  • 117
2
votes
0 answers

MISCONF Redis is configured to save RDB snapshots problem on ec2

I`m using REDIS for data cache and I get error "MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled." I google this problem and I "solve it" by creating…
2
votes
1 answer

How data stored in redis service in docker container

Here is a docker container with redis service: redis: image: redis:latest ports: - "6379:6379" volumes: - ./redisdata:/data I enter the container and call redis-cli ping command with the answer PONG: docker-compose exec…
2
votes
0 answers

Redis Cluster too many slots info

Recently, we met a strange error in our prod. We have a REDIS cluster with 3 masters and 3 slaves. 77:7000, 99:7001, 13:7002 are the masters. While I use redis-cli to connect 77:7000 and execute "cluster nodes" command. The info is like below: It…
GssFlyaway
  • 105
  • 9
2
votes
1 answer

Redis CLI Rename Key - ERR unknown command RENAME with args

I have a redis-cli script that I can run locally (from Win10) but it fails when I run it against the server (Linux) with rename command. After connecting with redis-cli (from Win10), I run the following: SET…
tridy
  • 1,166
  • 1
  • 12
  • 21
2
votes
0 answers

redis executing too many 'info' commands

When I monitor the Redis using monitor command I observe there are lots of info command is being executed. Is this executed by Redis server itself or by the client applications? The problem is, when I check the output of the client list command…
vikas kv
  • 386
  • 2
  • 15
2
votes
0 answers

Redis - Mass insertion of data in cluster mode

I am trying to understand how one can perform mass insertion in Redis instances operating in the cluster mode. I came across this link: https://redis.io/topics/mass-insert It has a sample code one could use to generate data and populate Redis using…
pree
  • 2,297
  • 6
  • 37
  • 55
2
votes
2 answers

why my redis command keys does not block my other operation

form many blog, i learn that the redis command keys * may block the redis server, and other command can not be execute on time . however, today i run the keys * on my db which has about 8million data. and then i use my other client to exec other…
Lucas gao
  • 23
  • 4
2
votes
0 answers

windows redis doesn't work

Yesterday I downloaded redis from github in zip format. In the first place everything seems working fine: the redis-server started up fine, the installing of the service was also going well. But as soon as I started the redis-cli.exe nothing…
Luuk Verhagen
  • 350
  • 1
  • 5
  • 13
2
votes
1 answer

What's the best way to redis-cli psubscribe and pipe to grep

What is a good way to psubscribe on a redis pattern and pipe to grep. I tried redis-cli psubscribe "somepattern*" | grep somevalue But it seems to not work if the pattern doesn't publish frequently.
Drew LeSueur
  • 19,185
  • 29
  • 89
  • 106