https://hub.docker.com/r/ygqygq2/fastdfs-nginx
docker run -d --network=host --name tracker -v /data/docker/file/fdfs/tracker:/var/fdfs -v /etc/localtime:/etc/localtime:ro ygqygq2/fastdfs-nginx:latest tracker
docker run -d --network=host --name storage -e TRACKER_SERVER=$(curl -s https://api.ipify.org):22122 -v /data/docker/file/fdfs/storage:/var/fdfs -v /etc/localtime:/etc/localtime:ro ygqygq2/fastdfs-nginx:latest storage
docker exec -it tracker /bin/bash
docker exec -it storage /bin/bash
/usr/local/nginx/conf/nginx.conf
https://hub.docker.com/r/wangzhen01/fastdfs
docker run -d -e FASTDFS_IPADDR=$(curl -s https://api.ipify.org) -p 8888:8888 -p 22122:22122 -p 23000:23000 -p 8011:80 --name fastdfs -v /data/docker/file/fdfs/fastdfs:/var/fdfs -v /etc/localtime:/etc/localtime:ro wangzhen01/fastdfs:v6.0.8
docker exec -it fastdfs /bin/bash
/usr/local/nginx/conf/nginx.conf
https://hub.docker.com/r/delron/fastdfs
https://github.com/happyfish100/fastdfs
-tracker(跟踪服务器,起到调度的作用)
docker run -d --network=host --name=tracker --restart=always -v /data/docker/file/fdfs/tracker:/var/fdfs -v /etc/localtime:/etc/localtime:ro delron/fastdfs sh tracker.sh
-storage容器(存储服务器,提供容量和备份服务)
docker run -d --network=host --name storage --restart=always -e TRACKER_SERVER=$(curl -s https://api.ipify.org):22122 -v /data/docker/file/fdfs/storage:/var/fdfs -v /etc/localtime:/etc/localtime -e GROUP_NAME=group1 delron/fastdfs storage sh storage.sh
docker exec -it storage /bin/bash
vi /etc/fdfs/client.conf
charset = UTF-8
http.tracker_http_port = 8070
vi /etc/fdfs/storage.conf
http.server_port=8080
vi /etc/fdfs/mod_fastdfs.conf
connect_timeout=10;
tracker_server=192.168.179.133:22122;
# 如果文件ID的uri中包含/group**,则要设置为true;
url_have_group_name = true;
# Storage 配置的store_path0路径,必须和storage.conf中的一致;
store_path0=/var/fdfs;
---测试上传文件
cd /opt
wget https://img.htmltoo.com/ueditor/image/20201102/1604250056172356.jpg
/usr/bin/fdfs_upload_file /etc/fdfs/client.conf 1604250056172356.jpg
-会返回一个路径
group1/M00/00/00/rBEAC2MLG0GAKIxKAAAyVAU2SNI708.jpg
-
http://b.htmltoo.com:8888/group1/M00/00/00/rBEAC2MLG0GAKIxKAAAyVAU2SNI708.jpg
-
http://192.168.88.91:8088/group1/M00/00/00/rBEAC2MLG0GAKIxKAAAyVAU2SNI708.jpg
-文件下载
/usr/bin/fdfs_download_file /etc/fdfs/client.conf group1/M00/00/00/rBEAC2MLG0GAKIxKAAAyVAU2SNI708.jpg
-文件属性信息查看
/usr/bin/fdfs_file_info /etc/fdfs/client.conf group1/M00/00/00/rBEAC2MLG0GAKIxKAAAyVAU2SNI708.jpg
-文件删除
/usr/bin/fdfs_delete_file /etc/fdfs/client.conf group1/M00/00/00/rBEAC2MLG0GAKIxKAAAyVAU2SNI708.jpg
-查看系统状态
/usr/bin/fdfs_monitor /etc/fdfs/client.conf | grep ACTIVE
-查看存储节点信息(storage)
/usr/bin/fdfs_monitor /etc/fdfs/storage.conf
docker exec -it tracker /bin/bash
vi /etc/fdfs/tracker.conf
--env=FASTDFS_PATH=/opt/fdfs \
--env=FASTDFS_BASE_PATH=/var/fdfs
-默认端口是8888