Fastdfs introduction

Fastdfs is a popular distributed file system with automatic file synchronization and single point of failure prevention features.

The deployment of

Docker deployment is adopted and Docker file provided by the official website is slightly modified. As of 2021-11-09, two deployment schemes can be seen in github official website project, one is local and one is network. Local is to download some packages that will be used in advance to the local, so as to prevent the domestic access to the dockerHub network is not good, but after the actual test, there will be problems with this scheme, so we directly use the network mode: github.com/happyfish10…

Start the tracker

Run the fdfs_trackerd /etc/fdfs/tracker.conf restart command to start the tracker

To view the log file cat/root/fastdfs/logs/trackerd log show 04:24:55 [2021-11-09] the INFO – fastdfs v6.07, base_path = / home/DFS,… Indicates successful startup.

Start the storage

Run the fdfs_storaged /etc/fff/storage. conf restart command to start the storage

To view the log file cat/root/fastdfs/logs/storaged. The log shows 04:24:55 [2021-11-09] the INFO – fastdfs v6.07, base_path = / home/DFS,… Indicates successful startup.

Run the fdfs_monitor /etc/fdfs/storage.conf command to check whether the storage has been registered with tracker.

Nat network

Most cases storage is deployed in a network, when its registered to the tracker, the tracker to just storage network IP, now need to use double IP mode deployment, reference www.jianshu.com/p/b16922f71… “Storage Server Dual IP Settings” in

Actual separated deployment

The docker configuration on the official website is to package tracker, storage and nginx together through Dockerfile. I split tracker, storage and Nginx into two packages and separate the configuration file as well. According to my habit, Docker-compose and the volumes mapping configuration file are used for deployment. Tracker address fengrui358/fastdfs_tracker, storage address fengrui358/fastdfs_storage. Modify the configuration file based on github official website and save it in the conf directory.

tracker docker compose config:

fastdfs_tracker: image: 'fengrui358/fastdfs_tracker' container_name: fastdfs_tracker restart: always networks: /conf:/etc/ FDFS # Configuration -./data:/home/ DFS # DataCopy the code

storage docker compose config:

fastdfs_storage: image: 'fengrui358/fastdfs_storage' container_name: fastdfs_storage restart: always networks: - "fastdfs_network" ports: - "23000:23000" # stoage_server - "8011:80" #nginx web volumes: -. / conf: / etc/FDFS # configuration - / data: / home/DFS # data - / conf: / usr/local/nginx/conf # nginx configurationCopy the code

Client testing

A Dotnet client was used for testing, github.com/caozhiyuan/…

Reference:

www.ityouknow.com/fastdfs/201… www.jianshu.com/p/b16922f71…

Original address:frhello.com/fastdfs- Deployment and…