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

unable to edit redis persistence

unable to edit redis persistency / snapshotting , ( save ) unable to edit redis persistency, tried using redis-cli -> config set save "" , config rewrite edited the .conf file to have save "" , also for precautionary added appendonly no after…
0
votes
1 answer

Unable to get keys on redis cluster

I have created a cache key on redis cluster with cacheKey as "citylist_[object Object]" When i am trying to get the keys on cluster mode with pattern keys citylist* on redis. It is returning me (empty array) but when i am trying to get the value…
Manish Kumar
  • 101
  • 11
0
votes
1 answer

print method in lua script/redis is not working

I am trying to execute the following script and getting the below error. Redis is running in docker Exception in thread "main" org.redisson.client.RedisException: ERR user_script:1: Script attempted to access nonexistent global variable 'print'…
Shiva
  • 1,962
  • 2
  • 13
  • 31
0
votes
0 answers

How to define redis EngineCPUUtilization from the metric provided by redis-cli

If you run redis-cli -h -p 6379 info cpu: you will get 4 metrics related to redis cpu: used_cpu_sys used_cpu_user used_cpu_sys_children used_cpu_user_children Using the above metrics, how to define metrics EngineCPUUtilization which is similar…
user389955
  • 9,605
  • 14
  • 56
  • 98
0
votes
1 answer

json object append in redis-cli

i am using redis-cli for one of my project and i need to append the data into existing json in redis, i have tried json.arrappend but it is not working. i need to append in sDetail array and in jsonDetails array. any suggestions how to append in…
Abhishek Chhabra
  • 120
  • 2
  • 14
0
votes
0 answers

redis-cli flushall makes key names inaccessible

I ran into something odd today. I found that using $ redis-cli FLUSHDB, I can remove a database and its contents just fine. When I use $ redis-cli FLUSHALL however, it leaves a database which can be seen with $ redis-cli INFO KEYSPACE, but which has…
Drake
  • 63
  • 8
0
votes
1 answer

when I start redis instance, it gets added as replica to existing cluster automatically

I am running redis in cluster mode with one master and two replicas. I have a host where for some reason all redis instances were down and when I do ps -ef|grep redis , I would get nothing. Then I start redis manually using redis-server command as…
Zack
  • 2,078
  • 10
  • 33
  • 58
0
votes
0 answers

Azure Redis connection: An existing connection was forcibly closed by the remote host

I have an Azure Redis service up and running in cloud. When I try to connect to it seems that the connection was made, but when I try to PING or SET keys, I'll have an error says ERROR: An existing connection was forcibly closed by the remote…
0
votes
1 answer

Redis migrate command showing NOKEY error

I am trying to copy all my keys from DB 1 to DB 2 in my redis. I am using following command: select 1 to switch to DB 1 MIGRATE localhost 6380 "" 2 50000 AUTH my_password COPY KEYS This throws NOKEY error. Can anyone tell me what is going wrong?
0
votes
1 answer

JSON.SET in redis cli and stackexchange.redis it's showing exception

I'm trying to set and get JSON results in redis with redis-om anyway it uses Stackexchange.Redis even with that the same exception repects. using System; using StackExchange.Redis; namespace test { class Program { …
0
votes
0 answers

Unable to connect to Redis : nested exception is io.lettuce.core.RedisConnectionException: Unable to connect to localhost:6379

@Bean public RedisCacheManager redisCacheManager(LettuceConnectionFactory lettuceConnectionFactory) { RedisCacheConfiguration redisCacheConfiguration = RedisCacheConfiguration.defaultCacheConfig() .disableCachingNullValues(); …
0
votes
1 answer

Redis-cli verbose mode

I was trying to access the remote Redis instance using redis-cli -h and -p parameters. Every time I hit send nothing seems to happen for over a minute. So, I don't even know ether it is a slow response from a server or an error from either side.…
Igor Tiulkanov
  • 552
  • 5
  • 18
0
votes
1 answer

Altering a redis index to remove stopwords

I'm using RediSearch and I would like to remove all the stop words, I can read in the documentation that it says to set the STOPWORDS to 0 using the FT.CREATE command, however, I have an already created index I would like to modify to remove the…
FC5570
  • 163
  • 4
  • 12
0
votes
1 answer

How to set redis key with the output of a bash command

I'm using redis-cli within a bash script, now I want to save the current date in a specific format into a redis specific key. how do I do that? I already tried redis-cli -x SET last-modified $(date +"%D %T") but without success. Any help will be…
NNH
  • 265
  • 3
  • 10
0
votes
1 answer

Redis bitcount command returns a syntax error

after set myKey as key in Redis with foobar value I want to get the BITCOUNT of myKey. this command in Redis-CLI giving me an error: BITCOUNT myKey 2 3 BYTE (error) ERR syntax error how can I solve this?
Mehdi
  • 5
  • 3