tcp6 0 0 :::7001 :::* LISTEN
tcp6 0 0 :::7002 :::* LISTEN
tcp6 0 0 :::7003 :::* LISTEN
tcp6 0 0 :::7004 :::* LISTEN
tcp6 0 0 :::7005 :::* LISTEN
tcp6 0 0 :::7006 :::* LISTEN
[root@localhost ~]# redis-cli -c -p 7003
127.0.0.1:7003> get hello
-> Redirected to slot [866] located at 172.17.0.2:7001
"newjoyful"
172.17.0.2:7001> get test
-> Redirected to slot [6918] located at 172.17.0.4:7003
"newjoy"
172.17.0.4:7003>
作为结尾,我们应该把现在运行的容器生成Image,但是觉得没有意义,如果容器重启之后IP地址可能会发生变化配置也会随着变化,所以这次试验只合适进行学习、测试
Error parsing reference: "redis/redisNodeA7001_7002:v1" is not a valid repository/tag
[root@localhost ~]# docker commit redisNodeA7000-70001 redis/redisnodea7001_7002:v1
sha256:4bef9995c1fd4214719ae810c8dda347c8f10d0431d27f84cc1c81cf94231cb1
[root@localhost ~]# docker commit redisNodeA7003-70004 redis/redisnodeb7003_7004:v1
sha256:37a5ea1d992b3406fb98751f2798f1f339f6f5bc6ed001fc0103da35ca79f4f4
[root@localhost ~]# docker commit redisNodeA7005-70006 redis/redisnodec7005_7006:v1
sha256:263ccb2779787d917e24a5e0ed7ba29c1a24fb4adc544fdb8948365526f4fb56
[root@localhost ~]#
[root@localhost ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
redis/redisnodec7005_7006 v1 263ccb277978 About a minute ago 751.5 MB
redis/redisnodeb7003_7004 v1 37a5ea1d992b About a minute ago 752.9 MB
redis/redisnodea7001_7002 v1 4bef9995c1fd 2 minutes ago 752.9 MB