After the client uploads the file, the storage and server returns the file ID to the client, and this file ID is used to access the index information of the file in the future. The file index information includes: group name, virtual disk path, data two-level directory, and file name.
Path format:
Build a Simplest Image Server
Build steps:
The first step: upload fastDFS to the linux system.
Step 2: Before installing FastDFS, install the libevent toolkit.
yum -y install libevent
Step 3: Install libfastcommonV1.0.7 toolkit
libfastcommonV1.0.7 toolkit download address:
wget https://codeload.github.com/happyfish100/libfastcommon/tar.gz/V1.0.7 -O libfastcommon-1.0.7.tar.gz
1. Unzip the toolkit
tar zxf libfastcommon-1.0.7.tar.gz
2. Enter the decompressed libfastcommonV1.0.7 and execute ./make.sh
3. ./make.sh install
4. After performing the above steps, a lib64 folder will be created under usr
If the system is a 32-bit system, you need to copy the files in lib64 to the above lib file
Step 4: Install the Tracker service
1, decompress fastDFS_v5.05.tar.gz
2. After decompression, a fastDFS will appear, enter and execute ./make.sh and then execute ./make.shinstall
After installation, files starting with fdfs in the /usr/bin/ directory are compiled. The configuration files are placed in the /etc/fdfs folder
3. Copy all the configuration files in the /root/FastDFS/conf directory to /etc/fdfs. ( cp * /etc/fdfs in /root/FastDFS/conf path)
4. Configure the tracker service. Modify the /root/FastDFS/conf/tracker.conf file.
5. Start the tracker. /usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf
Restart using the command: /usr/bin/fdfs_trackerd/etc/fdfs/tracker.conf restart
Step 5: Install the storage service
Note: If it is installed on a different server, the fourth steps 1~4 need to be re-executed
1. Configure the storage service and modify the /root/FastDFS/conf/storage.conf file
2, start the storage service
/usr/bin/fdfs_storaged /etc/fdfs/storage.conf
Step 6: Test the Service
1. Modify the configuration file /etc/fdfs/client.conf
2. Test image upload ( /usr/bin/fdfs_test/etc/fdfs/client.conf upload 11.png )
Test Results