第160天學習打卡(專案 穀粒商城 2)
阿新 • • 發佈:2021-06-18
docker pull redis
mkdir -p /home/redis/conf
touch /home/redis/conf/redis.conf
docker run -p 6379:6379 --name redis \
-v /home/redis/data:/data \
-v /home/redis/conf/redis.conf:/etc/redis/redis.conf \
-d redis redis-server /etc/redis/redis.conf
docker exec -it redis redis-cli
[root@stor01 ~]# docker pull redis
Using default tag: latest
latest: Pulling from library/redis
69692152171a: Pull complete
a4a46f2fd7e0: Pull complete
bcdf6fddc3bd: Pull complete
2902e41faefa: Pull complete
df3e1d63cdb1: Pull complete
fa57f005a60d: Pull complete
Digest: sha256:7e2c6181ad5c425443b56c7c73a9cd6df24a122345847d1ea9bb86a5afc76325
Status: Downloaded newer image for redis:latest
docker.io/library/redis:latest
[root@stor01 ~]# mkdir -p /home/redis/conf
[root@stor01 ~]# cd home/
-bash: cd: home/: No such file or directory
[root@stor01 ~]# cd /home/
[root@stor01 home]# ls
apache-tomcat-9.0.44-windows-x64 dockerfile jdk-8u291-linux-x64.tar.gz my_wordpress test
apache-tomcat-9.0.45 Dockerfile kuangapp qinjiang tomcatlogs
apache-tomcat-9.0.45.tar.gz docker-test-volume kuangshen readme.txt www
ceshi idea kuangshen.java redis
composetest jdk-8u291-linux-x64.rpm mysql swagger-demo-0.0.1-SNAPSHOT.jar
[root@stor01 home]# cd redis
[root@stor01 redis]# ls
conf
[root@stor01 redis]# cd conf/
[root@stor01 conf]# ls
[root@stor01 conf]# touch redis.conf
[root@stor01 conf]# docker run -p 6379:6379 --name redis \
> -v /home/redis/data:/data \
> -v /home/redis/conf/redis.conf:/etc/redis/redis.conf \
> -d redis redis-server /etc/redis/redis.conf
3f0d4b93585733149fbac8bf8f56ae6895ced9c37e30415840bbfb9105267546
docker: Error response from daemon: driver failed programming external connectivity on endpoint redis (42c7fe4056672cec5a27373b945e0f1ac073f889ba33d668658839559595ae84): Error starting userland proxy: listen tcp4 0.0.0.0:6379: bind: address already in use.
[root@stor01 conf]# netstat -tanlp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1070/sshd
tcp 0 0 0.0.0.0:36247 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:8888 0.0.0.0:* LISTEN 2015/python
tcp 0 0 0.0.0.0:2049 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 22399/docker-proxy
tcp 0 0 0.0.0.0:49610 0.0.0.0:* LISTEN 32588/rpc.statd
tcp 0 0 127.0.0.1:6379 0.0.0.0:* LISTEN 21994/redis-server
tcp 0 0 0.0.0.0:26379 0.0.0.0:* LISTEN 20898/redis-sentine
tcp 0 0 127.0.0.1:6381 0.0.0.0:* LISTEN 9030/redis-server 1
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 32590/rpcbind
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 3238/nginx: master
tcp 0 0 0.0.0.0:20048 0.0.0.0:* LISTEN 32598/rpc.mountd
tcp 0 0 127.0.0.1:6379 127.0.0.1:43414 ESTABLISHED 21994/redis-server
tcp 0 0 127.0.0.1:51850 127.0.0.1:8888 TIME_WAIT -
tcp 0 0 127.0.0.1:6381 127.0.0.1:51562 ESTABLISHED 9030/redis-server 1
tcp 0 0 127.0.0.1:6379 127.0.0.1:57228 ESTABLISHED 21994/redis-server
tcp 0 0 127.0.0.1:51562 127.0.0.1:6381 ESTABLISHED 20898/redis-sentine
tcp 0 0 172.16.229.113:22 39.129.5.60:58158 ESTABLISHED 22735/sshd: root@pt
tcp 0 0 172.16.229.113:22 39.129.5.60:65250 ESTABLISHED 22773/sshd: root@no
tcp 0 0 172.16.229.113:8888 167.99.203.197:61000 ESTABLISHED 2015/python
tcp 0 0 172.16.229.113:8888 167.99.106.172:38372 ESTABLISHED 2015/python
tcp 0 0 127.0.0.1:43414 127.0.0.1:6379 ESTABLISHED 20898/redis-sentine
tcp 0 0 172.16.229.113:8888 8.133.179.231:49404 ESTABLISHED 2015/python
tcp 0 0 127.0.0.1:35494 127.0.0.1:6381 ESTABLISHED 20898/redis-sentine
tcp 0 0 172.16.229.113:33730 100.100.30.26:80 ESTABLISHED 18813/AliYunDun
tcp 0 0 172.16.229.113:57156 100.100.18.120:443 TIME_WAIT -
tcp 0 0 172.16.229.113:8888 50.18.103.180:57644 ESTABLISHED 2015/python
tcp 0 0 172.16.229.113:8888 104.152.52.25:50739 ESTABLISHED 2015/python
tcp 0 0 127.0.0.1:6381 127.0.0.1:35494 ESTABLISHED 9030/redis-server 1
tcp 0 0 127.0.0.1:45163 127.0.0.1:6381 ESTABLISHED 21994/redis-server
tcp 0 0 127.0.0.1:57228 127.0.0.1:6379 ESTABLISHED 20898/redis-sentine