docker 安装 fastdfs
拉镜像
docker pull delron/fastdfs
创建数据目录
mkdir -p /home/dockerdata/fdfs/tracker/var mkdir -p /home/dockerdata/fdfs/storage/var
运行tracker
docker run --restart always -d --net=host --name tracker -v /home/dockerdata/fdfs/tracker/var:/var/fdfs delron/fastdfs tracker
设置密码
docker exec -it tracker /bin/bash vi /etc/fdfs/http.conf #开启密码
http.anti_steal.check_token = true #设置密码
http.anti_steal.secret_key = 123456
#保存后退出编辑
exit
docker restart tracker
运行storage
docker run --restart always -d --net=host --name storage -e TRACKER_SERVER=127.0.0.1:22122 -v /home/dockerdata/fdfs/storage/var:/var/fdfs -e GROUP_NAME=group1 delron/fastdfs storage
端口说明
默认文件端口为:8888
也可以自己nginx配置映射
server{
listen 80;
server_name fast.xx.com;
location /group1/M00 {
alias /home/dockerdata/fdfs/storage/data;
}
}
tracker-servers端口为:22122