4
2
0
2

FastDFS安装

FastDFS安装

1、拉取镜像

docker pull morunchang/fastdfs

2、使用docker镜像构建tracker容器(跟踪服务器,起到调度的作用):

docker run -d --name tracker --net=host morunchang/fastdfs sh tracker.sh

3、使用docker镜像构建storage容器(存储服务器,提供容量和备份服务):

docker run -d --name storage --net=host -e TRACKER_IP=ip地址:22122 -e GROUP_NAME=group1 morunchang/fastdfs sh storage.sh

  • 使用的网络模式是–net=host, 替换为你机器的Ip即可
  • GROUP_NAME是组名,即storage的组
  • 如果想要增加新的storage服务器,再次运行该命令,注意更换新组名

4、修改Nginx配置

4.1 进入storage的容器内部,修改nginx.conf

docker exec -it storage /bin/bash

4.2 进入后

vi /data/nginx/conf/nginx.conf

4.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;
}

5、退出容器

exit

6、重启storage容器

docker restart storage

7、开启启动容器

docker update --restart=always tracker

docker update --restart=always storage

posted @   CoderTL  阅读(88)  评论(0编辑  收藏  举报
编辑推荐:
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
阅读排行:
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
点击右上角即可分享
微信分享提示