安装redis3.2

安装

[root@boxiaoyuan boxiaoyuan]# docker pull redis:3.2
3.2: Pulling from redis

2557373f5bdd: Pulling fs layer 
7905a4b7e832: Pull complete 
299490b78710: Pull complete 
a1577a76a447: Pull complete 
5094fb6db209: Pull complete 
fcd252e0a9f2: Pull complete 
479a363f72c9: Pull complete 
452d9d985c26: Pull complete 
0531c6664ced: Pull complete 
0817b34f5d76: Pull complete 
dd1b9a0ab5a8: Pull complete 
38ca84254b8b: Pull complete 
71f8d26b0d8e: Pull complete 
12277c2121f1: Pull complete 
9db68528a0cf: Pull complete 
2bf07517a9eb: Pull complete 
Digest: sha256:43d2f5e7338ef56b3bda52f1ba7b9b58866c07141e834f64267afb51c89e5086
Status: Downloaded newer image for redis:3.2

启动

[root@boxiaoyuan boxiaoyuan]# docker run -p 6379:6379 -v /boxiaoyuan/redis/data:/data -v /boxiaoyuan/redis/conf/redis.conf:/usr/local/etc/redis/redis.conf -d redis:3.2 redis-server /usr/local/etc/redis/redis.conf --appendonly yes 
0ec530ed2e6abb24df724086d6a45cb3eda24db8e72681bce0f61cfa1cce378b

--appendonly yes 表示是否开启持久化AOF

[root@boxiaoyuan boxiaoyuan]# docker ps
CONTAINER ID        IMAGE               COMMAND                CREATED             STATUS              PORTS                     NAMES
0ec530ed2e6a        redis:3.2           "docker-entrypoint.s   49 seconds ago      Up 49 seconds       0.0.0.0:6379->6379/tcp    tender_babbage      
32f015550d38        mysql:5.6           "docker-entrypoint.s   35 minutes ago      Up 35 minutes       0.0.0.0:12345->3306/tcp   boxiaoyuanmysql     
6654d40fd2f0        boxiaoyuantomcat9   "/bin/sh -c '/usr/lo   About an hour ago   Up About an hour    0.0.0.0:9080->8080/tcp    mytomcat9           
[root@boxiaoyuan boxiaoyuan]# 

连接

[root@boxiaoyuan boxiaoyuan]# docker exec -it 0ec530ed2e6a redis-cli
127.0.0.1:6379> set ke1 v1
OK
127.0.0.1:6379> set ke2 v2
OK
127.0.0.1:6379> set ke3 v3
OK
127.0.0.1:6379> shutdown 

查看持久化文件

[root@boxiaoyuan data]# pwd
/boxiaoyuan/redis/data
[root@boxiaoyuan data]# ls
appendonly.aof
[root@boxiaoyuan data]# cat appendonly.aof 
*2
$6
SELECT
上一篇:解决 windows oracle ORA-01113和ORA-01110错误


下一篇:DBCA静默方式建库