[root@localhost ~]# cd /myredis [root@localhost myredis]# vim redis.conf [root@localhost myredis]# vim redis.conf [root@localhost myredis]# ll 总用量 112 drwxr-xr-x. 2 root root 103 1月 18 15:26 appendonlydir -rw-r--r--. 1 root root 121 1月 18 15:25 dump6379.rdb -rw-r--r--. 1 root root 107528 1月 18 15:28 redis.conf [root@localhost myredis]# rm rf dump6379.rdb rm: 无法删除"rf": 没有那个文件或目录 rm:是否删除普通文件 "dump6379.rdb"?y [root@localhost myredis]# rm -rf dump6379.rdb [root@localhost myredis]# ll 总用量 108 drwxr-xr-x. 2 root root 103 1月 18 15:26 appendonlydir -rw-r--r--. 1 root root 107528 1月 18 15:28 redis.conf [root@localhost myredis]# cd appendonlydir/ [root@localhost appendonlydir]# pwd /myredis/appendonlydir [root@localhost appendonlydir]# rm -rf * [root@localhost appendonlydir]# ll 总用量 0 [root@localhost appendonlydir]# cd .. [root@localhost myredis]# ll 总用量 108 drwxr-xr-x. 2 root root 103 1月 18 15:30 appendonlydir -rw-r--r--. 1 root root 107528 1月 18 15:28 redis.conf [root@localhost myredis]# cd appendonlydir/ [root@localhost appendonlydir]# ll 总用量 4 -rw-r--r--. 1 root root 0 1月 18 15:30 appendonly.aof.1.base.aof -rw-r--r--. 1 root root 0 1月 18 15:30 appendonly.aof.1.incr.aof -rw-r--r--. 1 root root 88 1月 18 15:30 appendonly.aof.manifest [root@localhost appendonlydir]# ll 总用量 8 -rw-r--r--. 1 root root 0 1月 18 15:30 appendonly.aof.1.base.aof -rw-r--r--. 1 root root 51 1月 18 15:30 appendonly.aof.1.incr.aof -rw-r--r--. 1 root root 88 1月 18 15:30 appendonly.aof.manifest [root@localhost appendonlydir]# vim appendonly.aof.1.incr.aof [root@localhost appendonlydir]# ll 总用量 8 -rw-r--r--. 1 root root 0 1月 18 15:30 appendonly.aof.1.base.aof -rw-r--r--. 1 root root 51 1月 18 15:31 appendonly.aof.1.incr.aof -rw-r--r--. 1 root root 88 1月 18 15:30 appendonly.aof.manifest [root@localhost appendonlydir]# ll 总用量 8 -rw-r--r--. 1 root root 0 1月 18 15:30 appendonly.aof.1.base.aof -rw-r--r--. 1 root root 51 1月 18 15:31 appendonly.aof.1.incr.aof -rw-r--r--. 1 root root 88 1月 18 15:30 appendonly.aof.manifest [root@localhost appendonlydir]# ll 总用量 8 -rw-r--r--. 1 root root 0 1月 18 15:30 appendonly.aof.1.base.aof -rw-r--r--. 1 root root 51 1月 18 15:31 appendonly.aof.1.incr.aof -rw-r--r--. 1 root root 88 1月 18 15:30 appendonly.aof.manifest [root@localhost appendonlydir]# ll 总用量 8 -rw-r--r--. 1 root root 0 1月 18 15:30 appendonly.aof.1.base.aof -rw-r--r--. 1 root root 51 1月 18 15:31 appendonly.aof.1.incr.aof -rw-r--r--. 1 root root 88 1月 18 15:30 appendonly.aof.manifest [root@localhost appendonlydir]# ll 总用量 8 -rw-r--r--. 1 root root 130 1月 18 15:32 appendonly.aof.2.base.aof -rw-r--r--. 1 root root 0 1月 18 15:32 appendonly.aof.2.incr.aof -rw-r--r--. 1 root root 88 1月 18 15:32 appendonly.aof.manifest [root@localhost appendonlydir]# vim appendonly.aof.2.incr.aof [root@localhost appendonlydir]# vim appendonly.aof.2.base [root@localhost appendonlydir]# vim appendonly.aof.2.base appendonly.aof.2.base appendonly.aof.2.base.aof [root@localhost appendonlydir]# vim appendonly.aof.2.base.aof [root@localhost appendonlydir]# vim /myredis/redis.conf [root@localhost appendonlydir]# ll 总用量 8 -rw-r--r--. 1 root root 0 1月 18 15:33 appendonly.aof.2.base -rw-r--r--. 1 root root 128 1月 18 15:35 appendonly.aof.2.base.aof -rw-r--r--. 1 root root 0 1月 18 15:33 appendonly.aof.2.incr.aof -rw-r--r--. 1 root root 88 1月 18 15:32 appendonly.aof.manifest
[root@localhost ~]# cd /myredis
[root@localhost myredis]# vim redis.conf
[root@localhost myredis]# vim redis.conf
[root@localhost myredis]# ll
总用量 112
drwxr-xr-x. 2 root root 103 1月 18 15:26 appendonlydir
-rw-r--r--. 1 root root 121 1月 18 15:25 dump6379.rdb
-rw-r--r--. 1 root root 107528 1月 18 15:28 redis.conf
[root@localhost myredis]# rm rf dump6379.rdb
rm: 无法删除"rf": 没有那个文件或目录
rm:是否删除普通文件 "dump6379.rdb"?y
[root@localhost myredis]# rm -rf dump6379.rdb
[root@localhost myredis]# ll
总用量 108
drwxr-xr-x. 2 root root 103 1月 18 15:26 appendonlydir
-rw-r--r--. 1 root root 107528 1月 18 15:28 redis.conf
[root@localhost myredis]# cd appendonlydir/
[root@localhost appendonlydir]# pwd
/myredis/appendonlydir
[root@localhost appendonlydir]# rm -rf *
[root@localhost appendonlydir]# ll
总用量 0
[root@localhost appendonlydir]# cd ..
[root@localhost myredis]# ll
总用量 108
drwxr-xr-x. 2 root root 103 1月 18 15:30 appendonlydir
-rw-r--r--. 1 root root 107528 1月 18 15:28 redis.conf
[root@localhost myredis]# cd appendonlydir/
[root@localhost appendonlydir]# ll
总用量 4
-rw-r--r--. 1 root root 0 1月 18 15:30 appendonly.aof.1.base.aof
-rw-r--r--. 1 root root 0 1月 18 15:30 appendonly.aof.1.incr.aof
-rw-r--r--. 1 root root 88 1月 18 15:30 appendonly.aof.manifest
[root@localhost appendonlydir]# ll
总用量 8
-rw-r--r--. 1 root root 0 1月 18 15:30 appendonly.aof.1.base.aof
-rw-r--r--. 1 root root 51 1月 18 15:30 appendonly.aof.1.incr.aof
-rw-r--r--. 1 root root 88 1月 18 15:30 appendonly.aof.manifest
[root@localhost appendonlydir]# vim appendonly.aof.1.incr.aof
[root@localhost appendonlydir]# ll
总用量 8
-rw-r--r--. 1 root root 0 1月 18 15:30 appendonly.aof.1.base.aof
-rw-r--r--. 1 root root 51 1月 18 15:31 appendonly.aof.1.incr.aof
-rw-r--r--. 1 root root 88 1月 18 15:30 appendonly.aof.manifest
[root@localhost appendonlydir]# ll
总用量 8
-rw-r--r--. 1 root root 0 1月 18 15:30 appendonly.aof.1.base.aof
-rw-r--r--. 1 root root 51 1月 18 15:31 appendonly.aof.1.incr.aof
-rw-r--r--. 1 root root 88 1月 18 15:30 appendonly.aof.manifest
[root@localhost appendonlydir]# ll
总用量 8
-rw-r--r--. 1 root root 0 1月 18 15:30 appendonly.aof.1.base.aof
-rw-r--r--. 1 root root 51 1月 18 15:31 appendonly.aof.1.incr.aof
-rw-r--r--. 1 root root 88 1月 18 15:30 appendonly.aof.manifest
[root@localhost appendonlydir]# ll
总用量 8
-rw-r--r--. 1 root root 0 1月 18 15:30 appendonly.aof.1.base.aof
-rw-r--r--. 1 root root 51 1月 18 15:31 appendonly.aof.1.incr.aof
-rw-r--r--. 1 root root 88 1月 18 15:30 appendonly.aof.manifest
[root@localhost appendonlydir]# ll
总用量 8
-rw-r--r--. 1 root root 130 1月 18 15:32 appendonly.aof.2.base.aof
-rw-r--r--. 1 root root 0 1月 18 15:32 appendonly.aof.2.incr.aof
-rw-r--r--. 1 root root 88 1月 18 15:32 appendonly.aof.manifest
[root@localhost appendonlydir]# vim appendonly.aof.2.incr.aof
[root@localhost appendonlydir]# vim appendonly.aof.2.base
[root@localhost appendonlydir]# vim appendonly.aof.2.base
appendonly.aof.2.base appendonly.aof.2.base.aof
[root@localhost appendonlydir]# vim appendonly.aof.2.base.aof
[root@localhost appendonlydir]# vim /myredis/redis.conf
[root@localhost appendonlydir]# ll
总用量 8
-rw-r--r--. 1 root root 0 1月 18 15:33 appendonly.aof.2.base
-rw-r--r--. 1 root root 128 1月 18 15:35 appendonly.aof.2.base.aof
-rw-r--r--. 1 root root 0 1月 18 15:33 appendonly.aof.2.incr.aof
-rw-r--r--. 1 root root 88 1月 18 15:32 appendonly.aof.manifest
127.0.0.1:6379> flushall OK 127.0.0.1:6379> keys * (empty array) 127.0.0.1:6379> quit [root@localhost bin]# redis-server /myredis/redis.conf [root@localhost bin]# redis-cli -a abc123 Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe. 127.0.0.1:6379> keys * (empty array) 127.0.0.1:6379> shutdown not connected> quit [root@localhost bin]# redis-server /myredis/redis.conf [root@localhost bin]# redis-cli -a abc123 Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe. 127.0.0.1:6379> keys * 1) "k3" 2) "k4" 3) "k2" 4) "k1" 127.0.0.1:6379> shutdown not connected> quit [root@localhost bin]# redis-server /myredis/redis.conf [root@localhost bin]# redis-cli -a abc123 Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe. 127.0.0.1:6379> keys * (empty array) 127.0.0.1:6379> set k1 1 OK 127.0.0.1:6379> get k1 "1" 127.0.0.1:6379> set k1 1111111111111111111111111111 OK 127.0.0.1:6379> set k1 1111111111111111111111111111 OK 127.0.0.1:6379> set k1 1111111111111111111111111111 OK 127.0.0.1:6379> set k1 1111111111111111111111111111 OK 127.0.0.1:6379> set k1 1111111111111111111111111111 OK 127.0.0.1:6379> set k1 1111111111111111111111111111 OK 127.0.0.1:6379> set k1 1111111111111111111111111111 OK 127.0.0.1:6379> set k1 1111111111111111111111111111 OK 127.0.0.1:6379> set k1 1111111111111111111111111111 OK 127.0.0.1:6379> set k1 1111111111111111111111111111 OK 127.0.0.1:6379> set k1 1111111111111111111111111111 OK 127.0.0.1:6379> set k1 1111111111111111111111111111 OK 127.0.0.1:6379> set k1 1111111111111111111111111111 OK 127.0.0.1:6379> set k1 1111111111111111111111111111 OK 127.0.0.1:6379> set k1 1111111111111111111111111111 OK 127.0.0.1:6379> set k1 1111111111111111111111111111 OK 127.0.0.1:6379> set k1 2asdasdasdasdalsdkxzckajsdaskdxmzncaskdjaskdjasdmzx,mckajsdkasdmasndnxcnasdkasd OK
127.0.0.1:6379> flushall
OK
127.0.0.1:6379> keys *
(empty array)
127.0.0.1:6379> quit
[root@localhost bin]# redis-server /myredis/redis.conf
[root@localhost bin]# redis-cli -a abc123
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
127.0.0.1:6379> keys *
(empty array)
127.0.0.1:6379> shutdown
not connected> quit
[root@localhost bin]# redis-server /myredis/redis.conf
[root@localhost bin]# redis-cli -a abc123
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
127.0.0.1:6379> keys *
1) "k3"
2) "k4"
3) "k2"
4) "k1"
127.0.0.1:6379> shutdown
not connected> quit
[root@localhost bin]# redis-server /myredis/redis.conf
[root@localhost bin]# redis-cli -a abc123
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
127.0.0.1:6379> keys *
(empty array)
127.0.0.1:6379> set k1 1
OK
127.0.0.1:6379> get k1
"1"
127.0.0.1:6379> set k1 1111111111111111111111111111
OK
127.0.0.1:6379> set k1 1111111111111111111111111111
OK
127.0.0.1:6379> set k1 1111111111111111111111111111
OK
127.0.0.1:6379> set k1 1111111111111111111111111111
OK
127.0.0.1:6379> set k1 1111111111111111111111111111
OK
127.0.0.1:6379> set k1 1111111111111111111111111111
OK
127.0.0.1:6379> set k1 1111111111111111111111111111
OK
127.0.0.1:6379> set k1 1111111111111111111111111111
OK
127.0.0.1:6379> set k1 1111111111111111111111111111
OK
127.0.0.1:6379> set k1 1111111111111111111111111111
OK
127.0.0.1:6379> set k1 1111111111111111111111111111
OK
127.0.0.1:6379> set k1 1111111111111111111111111111
OK
127.0.0.1:6379> set k1 1111111111111111111111111111
OK
127.0.0.1:6379> set k1 1111111111111111111111111111
OK
127.0.0.1:6379> set k1 1111111111111111111111111111
OK
127.0.0.1:6379> set k1 1111111111111111111111111111
OK
127.0.0.1:6379> set k1 2asdasdasdasdalsdkxzckajsdaskdxmzncaskdjaskdjasdmzx,mckajsdkasdmasndnxcnasdkasd
OK