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
本文来自博客园,作者:CoderTL,转载请注明原文链接:https://www.cnblogs.com/codertl/p/15612498.html