如果您对Redis的了解不深入请关注本栏目,本栏目包括Redis安装,Redis配置文件说明。
redis-cli
# 指定主机
redis-cli -h 127.0.0.1
# 指定端口
redis-cli -p 7379
# 指定库(在Redis中有默认有16个库,对应库序号为0~15,不指定默认是0)
redis-cli -n 8
# 使 redis-cli 支持编码级格式化
redis-cli --raw
redis-cli -h
[root@yiqifu-redis ~]# redis-cli -h
redis-cli 6.0.6Usage: redis-cli [OPTIONS] [cmd [arg [arg …]]]
-h Server hostname (default: 127.0.0.1).
-p Server port (default: 6379).
-s Server socket (overrides hostname and port).
-a Password to use when connecting to the server.
You can also use the REDISCLI_AUTH environment
variable to pass this password more safely
(if both are used, this argument takes predecence).
–user Used to send ACL style ‘AUTH username pass’. Needs -a.
–pass Alias of -a for consistency with the new --user option.
–askpass Force user to input password with mask from STDIN.
If this argument is used, ‘-a’ and REDISCLI_AUTH
environment variable will be ignored.
-u Server URI.
-r Execute specified command N times.
-i When -r is used, waits seconds per command.
It is possible to specify sub-second times like -i 0.1.
-n Database number.
-3 Start session in RESP3 protocol mode.
-x Read last argument from STDIN.
-d 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…
[root@yiqifu-redis ~]# redis-cli
127.0.0.1:6379> help
redis-cli 6.0.6
To get help about Redis commands type:
“help @” to get a list of commands in
“help ” for help on
“help ” to get a list of possible help topics
“quit” to exitTo set redis-cli preferences:
“:set hints” enable online hints
“:set nohints” disable online hints
Set your preferences in ~/.redisclirc
从上面可以看出Redis帮助分为两种,分别是
命令组有15种:包括了主要命令和数据类型等命令分组。
@generic,@string,@list,@set,@sorted_set,@hash,@pubsub, @transactions,@connection,@server,@scripting,@hyperloglog,@cluster,@geo, @stream
有关Redis命令帮助也可以看这里:http://redis.cn/commands.html
127.0.0.1:6379> keys *
- “aaa”
- “bbb”
如下查看aaa的值类型
127.0.0.1:6379> type aaa
string
如下查看 ccc 的编码类型
127.0.0.1:6379> object encoding ccc
“raw”127.0.0.1:6379> set xxx 100
OK
127.0.0.1:6379> object encoding xxx
“int”
如下设置bbb 的过期时间为20秒。
127.0.0.1:6379> EXPIRE bbb 20
(integer) 1
如下,设置bbb 的过期时间为指定时间戳1697014508。
127.0.0.1:6379> EXPIREAT bbb 1697014508
(integer) 1
过期时间说明
如下查看 aaa 的过期时间
127.0.0.1:6379> ttl aaa
(integer) -1
127.0.0.1:6379> help @generic
DEL key [key …]
summary: Delete a key
since: 1.0.0DUMP key
summary: Return a serialized version of the value stored at the specified k ey.
since: 2.6.0EXISTS key [key …]
summary: Determine if a key exists
since: 1.0.0EXPIRE key seconds
summary: Set a key’s time to live in seconds
since: 1.0.0EXPIREAT key timestamp
summary: Set the expiration for a key as a UNIX timestamp
since: 1.2.0KEYS pattern
summary: Find all keys matching the given pattern
since: 1.0.0…
127.0.0.1:6379> set aaa 111
OK
set 命令设置过期时间参数 ex,如下,设置bbb过期时间为20秒。
127.0.0.1:6379> set bbb 222 ex 20
OK
127.0.0.1:6379> ttl bbb
(integer) 15
set 命令限制只能新建参数 nx,如下,第二次添加nx参数则添加失败。这种机制可实现锁。
127.0.0.1:6379> set aaa 111
OK
127.0.0.1:6379> set aaa 111 nx
(nil)
set 命令限制只能更新参数 xx,如下,在没有key为ccc的情况下使用 xx 参数添加失败
127.0.0.1:6379> set ccc 333 xx
(nil)
127.0.0.1:6379> get aaa
“111”
如下一次添加两个键值aaa=111, bbb=222
127.0.0.1:6379> mset aaa 111, bbb 222
OK
127.0.0.1:6379> keys *
1) “aaa”
2) “bbb”
如下一次读取两个键值 aaa, bbb
127.0.0.1:6379> mget aaa bbb
1) “111,”
2) “222”
127.0.0.1:6379> msetnx mmm 111, nnn 222
(integer) 1
127.0.0.1:6379> msetnx mmm 333, nnn 444
(integer) 0
127.0.0.1:6379> mget mmm nnn
1) “111,”
2) “222”
如下向原键ccc添加新内容 world
127.0.0.1:6379> set ccc hello
OK
127.0.0.1:6379> append ccc world
(integer) 10
127.0.0.1:6379> get ccc
“helloworld”
如下把键ccc对应的值从位置5开始覆盖为内容yiqifu
127.0.0.1:6379> setrange ccc 5 yiqifu
(integer) 11
127.0.0.1:6379> get ccc
“helloyiqifu”
索引位置说明
如下从键ccc的值中开始截取内容。
127.0.0.1:6379> getrange ccc 5 9
“world”
127.0.0.1:6379> getrange ccc 5 -1
“world”
如下查询键为ccc的字符串长度
127.0.0.1:6379> strlen ccc
(integer) 11
如下自增、自增操作
127.0.0.1:6379> set ddd 10
OK
127.0.0.1:6379> incr ddd
(integer) 11
127.0.0.1:6379> get ddd
“11”
127.0.0.1:6379> decr ddd
(integer) 10
127.0.0.1:6379> get ddd
“10”
如下自增、自减操作
127.0.0.1:6379> set ddd 10
OK
127.0.0.1:6379> incrby ddd 5
(integer) 15
127.0.0.1:6379> get ddd
“15”
127.0.0.1:6379> decrby ddd 5
(integer) 10
127.0.0.1:6379> get ddd
“10”
127.0.0.1:6379> incrbyfloat ddd 0.1
“10.1”
127.0.0.1:6379> get ddd
“10.1”
如下对键eee设置222,会返回旧值111
127.0.0.1:6379> set eee 111
OK
127.0.0.1:6379> get eee
“111”
127.0.0.1:6379> getset eee 222
“111”
127.0.0.1:6379> get eee
“222”
如下将第一个字节的第6位设置为1,二进制表示为:00000100
127.0.0.1:6379> setbit aaa 5 1
(integer) 0
127.0.0.1:6379> get aaa
“\x04”
如下从第0个字节开始到第二个字节结束,按位查找第一次出现1的位置(注意是出现1这个bit的位置)
127.0.0.1:6379> bitpos aaa 1 0 2
(integer) 5
如下从第0个字节开始到第二个字节结束,按位统计出现1的次数。
127.0.0.1:6379> bitcount aaa 0 2
(integer) 1
如下将key为aaa和bbb的值。按位与操作,并存放在ccc中;按位或操作,并存放在ddd中。
127.0.0.1:6379> setbit aaa 6 1
(integer) 0
127.0.0.1:6379> setbit bbb 7 1
(integer) 0
127.0.0.1:6379> bitop and ccc aaa bbb
(integer) 1
127.0.0.1:6379> get ccc
“\x00”127.0.0.1:6379> bitop or ddd aaa bbb
(integer) 1
127.0.0.1:6379> get ddd
“\x03”
127.0.0.1:6379> help @string
APPEND key value
summary: Append a value to a key
since: 2.0.0BITCOUNT key [start end]
summary: Count set bits in a string
since: 2.6.0BITFIELD key [GET type offset] [SET type offset value] [INCRBY type offset increment] [OVERFLOW WRAP|SAT|FAIL]
summary: Perform arbitrary bitfield integer operations on strings
since: 3.2.0BITOP operation destkey key [key …]
summary: Perform bitwise operations between strings
since: 2.6.0BITPOS key bit [start] [end]
summary: Find first bit set or clear in a string
since: 2.8.7DECR key
summary: Decrement the integer value of a key by one
since: 1.0.0DECRBY key decrement
summary: Decrement the integer value of a key by the given number
since: 1.0.0GET key
summary: Get the value of a key
since: 1.0.0…
127.0.0.1:6379> lpush aaa 111 222 333 444 555
(integer) 5
注意:测试时如果操作过程提示值类型错误,可以先把数据库清空,如下:
127.0.0.1:6379> lpush aaa 111 222 333 444 555
(error) WRONGTYPE Operation against a key holding the wrong kind of value
127.0.0.1:6379> flushdb
OK
127.0.0.1:6379> rpush bbb 111 222 333 444 555
(integer) 5
127.0.0.1:6379> lpop aaa
“555”
127.0.0.1:6379> lpop aaa
“444”
127.0.0.1:6379> lpop aaa
“333”
127.0.0.1:6379> rpop bbb
“555”
127.0.0.1:6379> rpop bbb
“444”
127.0.0.1:6379> rpop bbb
“333”
127.0.0.1:6379> lpush aaa 111 222 333 444 555
(integer) 7
127.0.0.1:6379>
127.0.0.1:6379> lrange aaa 0 -1
1) “555”
2) “444”
3) “333”
4) “222”
5) “111”
6) “222”
7) “111”
127.0.0.1:6379> lrange bbb 0 -1
1) “111”
2) “222”
127.0.0.1:6379> lindex aaa 3
“222”
127.0.0.1:6379> lset aaa 3 xxxx
OK
127.0.0.1:6379> lindex aaa 3
“xxxx”
127.0.0.1:6379> lrem aaa 1 111
(integer) 1
127.0.0.1:6379> lrange aaa 0 -1
1) “555”
2) “444”
3) “333”
4) “xxxx”
5) “222”
6) “111”
127.0.0.1:6379> linsert aaa before 555 777
(integer) 7
127.0.0.1:6379> linsert aaa after 777 666
(integer) 8
127.0.0.1:6379> lrange aaa 0 4
1) “777”
2) “666”
3) “555”
4) “444”
5) “333”
127.0.0.1:6379> llen aaa
(integer) 8
127.0.0.1:6379> blpop ccc 5
(nil)
(5.04s)
127.0.0.1:6379> brpop ccc 5
(nil)
(5.09s)
127.0.0.1:6379> lrange aaa 0 -1
1) “777”
2) “666”
3) “555”
4) “444”
5) “333”
6) “xxxx”
7) “222”
8) “111”
127.0.0.1:6379> ltrim aaa 2 -3
OK
127.0.0.1:6379> lrange aaa 0 -1
1) “555”
2) “444”
3) “333”
4) “xxxx”
有关更多链表类型数据的操作命令,请查看帮助组 @list
127.0.0.1:6379> help @list
BLPOP key [key …] timeout
summary: Remove and get the first element in a list, or block until one is available
since: 2.0.0BRPOP key [key …] timeout
summary: Remove and get the last element in a list, or block until one is a vailable
since: 2.0.0BRPOPLPUSH source destination timeout
summary: Pop an element from a list, push it to another list and return it; or block until one is available
since: 2.2.0LINDEX key index
summary: Get an element from a list by its index
since: 1.0.0
127.0.0.1:6379> hset person1 name zhangsan
(integer) 1
127.0.0.1:6379> hset person1 age 20
(integer) 1
假如没有哈希,我们只能通过字符串来保存,如下
127.0.0.1:6379> set person1::name zhangsan
OK
127.0.0.1:6379> set person1::age 20
OK127.0.0.1:6379> keys person1*
1) “person1::age”
2) “person1::name”
127.0.0.1:6379> hmset person2 name lisi age 21
OK
127.0.0.1:6379> keys person2
1) “person2”
127.0.0.1:6379> hget person1 name
“zhangsan”
127.0.0.1:6379> hget person1 age
“20”
127.0.0.1:6379> hmget person1 name age
1) “zhangsan”
2) “20”
127.0.0.1:6379> hkeys person1
1) “name”
2) “age”
127.0.0.1:6379> hvals person1
1) “zhangsan”
2) “20”
127.0.0.1:6379> hgetall person1
- “name”
- “zhangsan”
- “age”
- “20”
127.0.0.1:6379> hincrby person1 age -1
“19”
127.0.0.1:6379> hget person1 age
“19”
127.0.0.1:6379> hincrbyfloat person1 age 0.5
“20.5”
127.0.0.1:6379> hget person1 age
“20.5”
有关更多哈希类型数据的操作命令,请查看帮助组 @hash
127.0.0.1:6379> help @hash
HDEL key field [field …]
summary: Delete one or more hash fields
since: 2.0.0HEXISTS key field
summary: Determine if a hash field exists
since: 2.0.0HGET key field
summary: Get the value of a hash field
since: 2.0.0HGETALL key
summary: Get all the fields and values in a hash
since: 2.0.0HINCRBY key field increment
summary: Increment the integer value of a hash field by the given number
since: 2.0.0
127.0.0.1:6379> sadd aaa 11 22 33 44 55 11 22
(integer) 5
127.0.0.1:6379> smembers aaa
1) “11”
2) “22”
3) “33”
4) “44”
5) “55”
127.0.0.1:6379> smembers aaa
1) “11”
2) “22”
3) “33”
4) “44”
5) “55”
127.0.0.1:6379> srem aaa 33 44
(integer) 2
127.0.0.1:6379> smembers aaa
5) “11”
6) “22”
7) “55”
127.0.0.1:6379> sadd bbb 11 22 66 77
(integer) 4
127.0.0.1:6379> sinter aaa bbb
1) “11”
2) “22”
对两个集合进行交集运算,并将结果存储在一个另一个集合中。
如对集合aaa和集合bbb进行交集运算,并将结果存储在ccc中。
127.0.0.1:6379> SINTERSTORE ccc aaa bbb
(integer) 2
127.0.0.1:6379> SMEMBERS ccc
1) “11”
2) “22”
127.0.0.1:6379> sunion aaa bbb
1) “11”
2) “22”
3) “55”
4) “66”
5) “77”
127.0.0.1:6379> sunionstore ddd aaa bbb
(integer) 5
127.0.0.1:6379> smembers ddd
1) “11”
2) “22”
3) “55”
4) “66”
5) “77”
127.0.0.1:6379> sdiff aaa bbb
1) “55”
127.0.0.1:6379> sdiff bbb aaa
1) “66”
2) “77”
对两个集合进行差集运算,并将结果存储在一个另一个集合中。
如对集合aaa和集合bbb进行差集运算,并将结果存储在eee中。
127.0.0.1:6379> sdiffstore eee bbb aaa
(integer) 2
127.0.0.1:6379> smembers eee
1) “66”
2) “77”
127.0.0.1:6379> srandmember aaa 2
1) “22”
2) “11”
127.0.0.1:6379> srandmember aaa 10
1) “11”
2) “22”
3) “55”
127.0.0.1:6379> srandmember aaa -4
1) “55”
2) “55”
3) “22”
4) “55”
127.0.0.1:6379> spop aaa
“22”
127.0.0.1:6379> spop aaa
“11”
127.0.0.1:6379> spop aaa
“55”
127.0.0.1:6379> spop aaa
(nil)
有关更多集合类型数据的操作命令,请查看帮助组 @set
127.0.0.1:6379> help @set
SADD key member [member …]
summary: Add one or more members to a set
since: 1.0.0SCARD key
summary: Get the number of members in a set
since: 1.0.0SDIFF key [key …]
summary: Subtract multiple sets
since: 1.0.0SDIFFSTORE destination key [key …]
summary: Subtract multiple sets and store the resulting set in a key
since: 1.0.0SINTER key [key …]
summary: Intersect multiple sets
since: 1.0.0SINTERSTORE destination key [key …]
summary: Intersect multiple sets and store the resulting set in a key
since: 1.0.0
127.0.0.1:6379> zadd aaa 3 zhangsan 1 lisi 2 wangwu
(integer) 3
127.0.0.1:6379> zrange aaa 0 -1
1) “lisi”
2) “wangwu”
3) “zhangsan”
查看集合元素的同时要查看分值请加 withscores 参数
如查看集合aaa的元素
127.0.0.1:6379> zrange aaa 0 -1
1) “lisi”
2) “wangwu”
3) “zhangsan”
127.0.0.1:6379> zrange aaa 0 -1 withscores
1) “lisi”
2) “1”
3) “wangwu”
4) “2”
5) “zhangsan”
6) “3”
127.0.0.1:6379> zrevrange aaa 0 -1
1) “zhangsan”
2) “wangwu”
3) “lisi”
127.0.0.1:6379> zrangebyscore aaa 2 3
1) “wangwu”
2) "zhangsan
127.0.0.1:6379> zscore aaa lisi
“1”
127.0.0.1:6379> zrank aaa lisi
(integer) 0
应用:如歌曲排行榜
如对 wangwu 的分值加2
127.0.0.1:6379> zrange aaa 0 -1 withscores
1) “lisi”
2) “1”
3) “wangwu”
4) “2”
5) “zhangsan”
6) “3”
127.0.0.1:6379> zincrby aaa 2 wangwu
“4”
127.0.0.1:6379> zrange aaa 0 -1 withscores
1) “lisi”
2) “1”
3) “zhangsan”
4) “3”
5) “wangwu”
6) “4”
127.0.0.1:6379> zadd bbb 10 xiaoming 20 xiaozhang 30 lisi
(integer) 1
127.0.0.1:6379> zinterstore ccc 2 aaa bbb
(integer) 1
127.0.0.1:6379> zrange ccc 0 -1 withscores
1) “lisi”
2) “31”127.0.0.1:6379> zinterstore ccc 2 aaa bbb weights 1 0.2
(integer) 1
127.0.0.1:6379> zrange ccc 0 -1
1) “lisi”
127.0.0.1:6379> zrange ccc 0 -1 withscores
1) “lisi”
2) “7”127.0.0.1:6379> zinterstore ccc 2 aaa bbb weights 1 0.2 aggregate max
(integer) 1
127.0.0.1:6379> zrange ccc 0 -1 withscores
1) “lisi”
2) “6”
127.0.0.1:6379> zunionstore ddd 2 aaa bbb
(integer) 6
127.0.0.1:6379> zrange ddd 0 -1
1) “zhangsan”
2) “wangwu”
3) “xiaoming”
4) “xiaozhang”
5) “xiaoliu”
6) “lisi”
有关更多链表类型数据的操作命令,请查看帮助组 @sorted_set
127.0.0.1:6379> help @sorted_set
BZPOPMAX key [key …] timeout
summary: Remove and return the member with the highest score from one or more sorted sets, or block until one is available
since: 5.0.0BZPOPMIN key [key …] timeout
summary: Remove and return the member with the lowest score from one or more sorted sets, or block until one is available
since: 5.0.0ZADD key [NX|XX] [CH] [INCR] score member [score member …]
summary: Add one or more members to a sorted set, or update its score if it already exists
since: 1.2.0ZCARD key
summary: Get the number of members in a sorted set
since: 1.2.0ZCOUNT key min max
summary: Count the members in a sorted set with scores within the given values
since: 2.0.0
127.0.0.1:6379> select 1
OK
127.0.0.1:6379[1]>
127.0.0.1:6379> help @connection
AUTH password
summary: Authenticate to the server
since: 1.0.0CLIENT CACHING YES|NO
summary: Instruct the server about tracking or not keys in the next reques t
since: 6.0.0CLIENT GETNAME -
summary: Get the current connection name
since: 2.6.9CLIENT GETREDIR -
summary: Get tracking notifications redirection client ID if any
since: 6.0.0CLIENT ID -
summary: Returns the client ID for the current connection
since: 5.0.0CLIENT KILL [ip:port] [ID client-id] [TYPE normal|master|slave|pubsub] [US ER username] [ADDR ip:port] [SKIPME yes/no]
summary: Kill the connection of a client
since: 2.4.0CLIENT LIST [TYPE normal|master|replica|pubsub]
summary: Get the list of client connections
since: 2.4.0CLIENT PAUSE timeout
summary: Stop processing commands from clients for some time
since: 2.9.50CLIENT REPLY ON|OFF|SKIP
summary: Instruct the server whether to reply to commands
since: 3.2.0…
相当于修改redis.conf配置文件
如下配置protected-mode为no
127.0.0.1:6379> CONFIG GET *
1) “rdbchecksum”
2) “yes”
3) “daemonize”
4) “no”
5) “io-threads-do-reads”
6) “no”
7) “lua-replicate-commands”
8) “yes”
9) “always-show-logo”
10) “yes”
11) “protected-mode”
12) “yes”127.0.0.1:6379> CONFIG SET “protected-mode” no
OK
127.0.0.1:6379> flushdb
OK
127.0.0.1:6379> keys *
(empty array)
如下删除所有库的所有数据,其他库中的数据也没有了
127.0.0.1:6379> flushall
OK
127.0.0.1:6379> keys *
(empty array)
127.0.0.1:6379> save
OK
127.0.0.1:6379> bgsave
Background saving started
他的作用是执行一些压缩,让aof文件变小
如下执行重写AOF
127.0.0.1:6379> BGREWRITEAOF
Background append only file rewriting started
如下将当前Redis实例作为从机(Slave)加入主机(Master 127.0.0.1:6379)
127.0.0.1:6381> REPLICAOF 127.0.0.1 6379
OK
127.0.0.1:6379> help @server
ACL CAT [categoryname]
summary: List the ACL categories or the commands inside a category
since: 6.0.0ACL DELUSER username [username …]
summary: Remove the specified ACL users and the associated rules
since: 6.0.0ACL GENPASS [bits]
summary: Generate a pseudorandom secure password to use for ACL users
since: 6.0.0ACL GETUSER username
summary: Get the rules for a specific ACL user
since: 6.0.0ACL HELP -
summary: Show helpful text about the different subcommands
since: 6.0.0ACL LIST -
summary: List the current ACL rules in ACL config file format
since: 6.0.0ACL LOAD -
summary: Reload the ACLs from the configured ACL file
since: 6.0.0ACL LOG [count or RESET]
summary: List latest events denied because of ACLs in place
since: 6.0.0…
127.0.0.1:6379> multi
OK
127.0.0.1:6379> set aaa 111
QUEUED
127.0.0.1:6379> set bbb 222
QUEUED
127.0.0.1:6379> exec
- OK
- OK
127.0.0.1:6379> watch aaa
OK
127.0.0.1:6379> multi
OK
127.0.0.1:6379> set aaa 333
QUEUED
127.0.0.1:6379> exec
(nil)
这里模拟另一个客户端修改其值
127.0.0.1:6379> set aaa 444
OK
127.0.0.1:6379> help @transactions
DISCARD -
summary: Discard all commands issued after MULTI
since: 2.0.0EXEC -
summary: Execute all commands issued after MULTI
since: 1.2.0MULTI -
summary: Mark the start of a transaction block
since: 1.2.0UNWATCH -
summary: Forget about all watched keys
since: 2.2.0WATCH key [key …]
summary: Watch the given keys to determine execution of the MULTI/EXEC block
since: 2.2.0
127.0.0.1:6379> subscribe xxx
Reading messages… (press Ctrl-C to quit)
- “subscribe”
- “xxx”
- (integer) 1
- “message”
- “xxx”
- “123456”
127.0.0.1:6379> publish xxx 123456
(integer) 1
127.0.0.1:6379> help @pubsub
PSUBSCRIBE pattern [pattern …]
summary: Listen for messages published to channels matching the given patt erns
since: 2.0.0PUBLISH channel message
summary: Post a message to a channel
since: 2.0.0PUBSUB subcommand [argument [argument …]]
summary: Inspect the state of the Pub/Sub subsystem
since: 2.8.0PUNSUBSCRIBE [pattern [pattern …]]
summary: Stop listening for messages posted to channels matching the given patterns
since: 2.0.0SUBSCRIBE channel [channel …]
summary: Listen for messages published to the given channels
since: 2.0.0UNSUBSCRIBE [channel [channel …]]
summary: Stop listening for messages posted to the given channels
since: 2.0.0
Redis是一种基于客户端-服务端模型以及请求/响应协议的TCP服务。
在Redis中,一次请求/响应服务器能实现处理新的请求即使旧的请求还未被响应。这样就可以将多个命令发送到服务器,而不用等待回复,最后在一个步骤中读取该答复。
这就是管道(pipelining),是一种几十年来广泛使用的技术。例如许多POP3协议已经实现支持这个功能,大大加快了从服务器下载新邮件的过程。
Redis很早就支持管道(pipelining)技术,因此无论你运行的是什么版本,你都可以使用管道(pipelining)操作Redis。
下面是一个使用的例子,首先创建一个xxx=10,然后加1,最后再取值的过程。这个三个命令放在一起,使用了Redis管道。
[root@yiqifu-redis ~]# echo -e “set xxx 10\n incr xxx\n get ccc” | nc localhost 6379
+OK
:11
$1
yum install nc -y