Tag Archives: repeat

(20200916 Solved)Docker||redis-cli Could not connect to Redis at 127.0.0.1:6379: Connection refused

  • problem description

    redis-cli is the redis command line interface to interact with the redis service.

  • solution

    1. via configuration file
      $ vi /etc/redis.conf
      # daemonize no 改为 yes
      redis-server /etc/redis.conf
      

      docker startup redis has no configuration file in it. You need to build it yourself.

    2. start directly
      redis-server &
      

      <李>

      引用

      1. 无法连接到127.0.0.1:6379的Redis:使用自制程序拒绝连接

Redis takes the member with the largest score in Zset

1. Zrange key start stop [withscores]

zrange key-1-1 [withscores]

Return to ordered set

key , a member of the specified interval.

members of the position according to the score value increment ( since the childhood ) to sort.

with the same score members of the value according to the dictionary sequence ( lexicographical order to line up.

if you need a member according to the score value decreasing ( from big to small ) to line up, Please use the ZREVRANGE command.

subscript parameter start and stop to 0 at the bottom, that is to say, With 0 said ordered set first members, with 1 said ordered set the second member, and so on.

you can also use negative indices, with 1 said last member, 2 said penultimate members, and so on.


2. Zrevrange key start stop [withscores]

zrevrange key 0 0 [withscores]

members of the position according to the score value decreasing ( from big to small to line up.

Zrevrangebyscore key +inf 0 limit 0 1

ZRANGEBYSCORE key min Max [WITHSCORES] [LIMIT offset count]