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-cli NOAUTH error after redirected to slot

After enabling authentication for redis server, redis-cli returns (error) NOAUTH Authentication required. error every time request is redirected to a different slot. See below output 127.0.0.1:7000> auth admin password OK 127.0.0.1:7000> get…
Sudhir
  • 1,339
  • 2
  • 15
  • 36
0
votes
1 answer

Get value by position in Redis

When getting all the keys from Redis, like this: redis.server.com:6379> keys * 1) "z13235jxby03knne1w1gucl5" Instead of manually copying the long key to execute get z13235jxby03knne1w1gucl5, I'd like to run something like get $(1) (pseudo code) to…
Max
  • 488
  • 8
  • 19
0
votes
0 answers

kubernetes redis-cluster pod by pod login using shell script?

Currently, I am trying to prepare a shell script for redis-cluster backup of each pod running in a particular namespace. I wanted to achieve it by performing two operations: login to each pod one by one and then connect to redis-cli and execute…
andy
  • 525
  • 3
  • 6
  • 22
0
votes
0 answers

How we can store JSON object in Redis

I want to store JSON DATA in Redis How I can do that what is the best option to store JSON in Redis. my object will look like {"name":"b123.home.group.title", "value":"Hellow World", "locale":"en-us", "uid":"b456"} I want to update the object based…
Suraj Dalvi
  • 988
  • 1
  • 20
  • 34
0
votes
1 answer

Getting error while executing redis migrate command

I am trying to execute the below command migrate x.x.x.x 6379 key destinationserver COPY and I am getting the error (error) ERR value is not an integer or out of range Also these redis servers have authetication.. I am not sure how to provide it…
Sourabh Roy
  • 159
  • 1
  • 18
0
votes
1 answer

How We can do partial search in Redis using SSCAN with special characters

I have created a Redis set and the following is the member of the set: "[test@#$demo%^here[sfs]][en-us][1234]" I have 1000 members in the Redis set and I want to search this document using sscan partially I have tried following the way sscan test…
Suraj Dalvi
  • 988
  • 1
  • 20
  • 34
0
votes
1 answer

Redis CLI - WRONGTYPE Operation against a key holding the wrong kind of value

I am new to redis. I am trying to execute the below command. HSET 1000:123:1603872000 "totalscore":100 "uid":"1000:123:1603872000" "price": 1000 "points": 30 But this gives me below error (error) WRONGTYPE Operation against a key holding the…
Oops
  • 1,373
  • 3
  • 16
  • 46
0
votes
1 answer

Why i couldn't connect redis cli from local?

I'm trying to connect redis-cli, but i can't. what is wrong?
ShaSha
  • 589
  • 3
  • 9
  • 24
0
votes
1 answer

Job is visible only from redis cli but not showing in rq dashboard and not executed

I want to build a pipeline using Redis and RQ. I created a worker, server and a job, the worker is running and listening to queue, the server is dispatching a job to a queue, the job is dispatched and I print the job ID, in console, I can see the…
palAlaa
  • 9,500
  • 33
  • 107
  • 166
0
votes
1 answer

How can I get number of connection per clients in Redis Cluster

From Redis CLI I can see number of connected clients by running client list. Now I want to see number connection per client(by addr or id) made to Redis Cluster. Is there any way to do so. Thanks in advance.
Shubho Shaha
  • 1,869
  • 1
  • 16
  • 22
0
votes
1 answer

Redis Shell Script Hex Keys

Created a cron job that deletes specific keys in Redis. Sample key: "\xac\xed\x00\x05t\x00\x15test" Using bash and redis-cli it seems that keys with HEX values cannot be properly parsed and deleted: Code below: …
Anonymous Duck
  • 2,942
  • 1
  • 12
  • 35
0
votes
1 answer

Redis Hget throwing WRONGTYPE Operation against a key holding the wrong kind of value

I'm using nodeJs to obtain a value in a redis key field. Something like this: let result = await redisM.hget('aaa:bbb', 'profiles'); The value I'm looking for is an object but I keep getting "WRONGTYPE Operation against a key holding the wrong kind…
Eunito
  • 416
  • 5
  • 22
0
votes
0 answers

How to check average number of requests per second hitting Redis

I have a single redis pod running in my k8s cluster, and I would like to get an idea of how many requests per second my redis server is currently handling in my production environment. I have tried redis-cli monotor, which prints out live requests…
Moses Xu
  • 2,140
  • 4
  • 24
  • 35
0
votes
1 answer

How to use redis-cli with Redis on Docker?

Run Redis in Docker File docker-compose.yml version: "3.8" services: redis: image: redis volumes: - ./data:/data ports: - 6379:6379 docker pull redis docker-compose up docker-compose up -d docker container ls telnet…
Vy Do
  • 46,709
  • 59
  • 215
  • 313
0
votes
1 answer

Redis standalone server is changing configuration on the fly

I'm running a Redis instance as standalone server with the config as follow: #bind option is commented protected-mode no port 6379 timeout 0 supervised no The problem is the instance is running normally but passed some time it just hung out and…
Juan I. Morales Pestana
  • 1,057
  • 1
  • 10
  • 34