Redis服务部署命令操作:
1.下载Docker镜像
[root@linux-node2 ~]# docker pull hotxia/tgc-redis
Using default tag: latest
latest: Pulling from hotxia/tgc-redis
9f4819a016a9: Already exists
3cb4abd19912: Pull complete
Digest: sha256:e7cb228141c6b42eb098f45c7c196eedc3817463aab95d1794917a0099823901
Status: Downloaded newer image for hotxia/tgc-redis:latest
docker.io/hotxia/tgc-redis:latest
2.查看已下载的Docker镜像
[root@linux-node2 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hotxia/tgc-rabbitmq latest 80f25d90be88 19 minutes ago 1.44GB
tgc-rabbitmq latest 80f25d90be88 19 minutes ago 1.44GB
hotxia/tgc-redis latest f856bcf3907a 16 hours ago 1.36GB
dadoha/centos7.4.1708 latest 196e0ce0c9fb 2 years ago 197MB
3.运行Docker镜像为容器
[root@linux-node2 ~]# docker run -itd -p 192.168.56.12:6379:6379 hotxia/tgc-redis /bin/bash
2ca0da69bd844e88cbf99f5bd6f739bdb25f19ac883eb6c105d8eaec85522124
4.查看已成功运行的容器
[root@linux-node2 ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
2ca0da69bd84 hotxia/tgc-redis "/bin/bash" 23 seconds ago Up 22 seconds 192.168.56.12:6379->6379/tcp infallible_bhaskara
5.进入容器查看服务是否启动
[root@linux-node2 ~]# docker exec -it 2ca0da69bd84 /bin/bash
[root@2ca0da69bd84 /]# netstat -tlnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
6.手动启动Redis服务
[root@2ca0da69bd84 /]# nohup /usr/local/redis/src/redis-server &
[1] 43
[root@2ca0da69bd84 /]# nohup: ignoring input and appending output to ‘nohup.out’
[root@2ca0da69bd84 /]# netstat -tlnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:6379 0.0.0.0:* LISTEN 43/redis-server *:6
tcp6 0 0 :::6379 :::* LISTEN 43/redis-server *:6
7.验证Redis服务是否正常
[root@linux-node2 ~]# netstat -tlnp|grep 6379
tcp 0 0 192.168.56.12:6379 0.0.0.0:* LISTEN 93066/docker-proxy
Content type
Image
Digest
Size
524.4 MB
Last updated
almost 7 years ago
docker pull hotxia/tgc-redis