8、Docker 安装 FastDFS

Docker 安装 FastDFS

拉取FastDFS镜像

[root@docker ~]# docker pull morunchang/fastdfs
Using default tag: latest
Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: TLS handshake timeout
[root@docker ~]# docker pull morunchang/fastdfs
Using default tag: latest
latest: Pulling from morunchang/fastdfs
43db9dbdcb30: Pull complete 
85a9cd1fcca2: Pull complete 
c23af8496102: Pull complete 
e88c36ca55d8: Pull complete 
492fed9ec7f3: Pull complete 
0c1d41dbb2bd: Pull complete 
99b513124929: Pull complete 
bf3f5901a13d: Pull complete 
88bf4f57c2c5: Pull complete 
Digest: sha256:f3fb622783acee7918b53f8a76c655017917631c52780bebb556d29290955b13
Status: Downloaded newer image for morunchang/fastdfs:latest
[root@docker ~]# 

运行tracker实例;

[root@docker ~]# docker run -d --name e3mall-fastdfs-tracker --net=host morunchang/fastdfs sh tracker.sh
63803049d69ea0a0bdf53c07c80998f5518c10dac045b5b356101014d51941f1
[root@docker ~]# 

运行storage实例;

[root@docker ~]# docker run -d --name e3mall-fastdfs-storage --net=host -e TRACKER_IP=192.168.25.11:22122 -e GROUP_NAME=group1 morunchang/fastdfs sh storage.sh
f5fdaba637e84c9fda5996fba1771bed3cb554ef651987c41f311b702fccca83
[root@docker ~]# 

修改nginx的配置,不拦截上传内容;

# 1. 进入容器
docker exec -it e3mall-fastdfs-storage  /bin/bash
# 2. 编辑nginx配置文件
vi /data/nginx/conf/nginx.conf
# 3. 修改以下内容
location /group1/M00 {
     proxy_next_upstream http_502 http_504 error timeout invalid_header;
     proxy_cache http-cache;
     proxy_cache_valid  200 304 12h;
     proxy_cache_key $uri$is_args$args;
     proxy_pass http://fdfs_group1;
     expires 30d;
 }
# 4. 退出
exit
# 5. 重启storage容器
docker restart e3mall-fastdfs-storage

开启防火墙 8080802212223000 四个端口;

firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --zone=public --add-port=8080/tcp --permanent
firewall-cmd --zone=public --add-port=22122/tcp --permanent
firewall-cmd --zone=public --add-port=23000/tcp --permanent
firewall-cmd --reload

猜你喜欢

转载自blog.csdn.net/weixin_42112635/article/details/84833252