Build a FastDFS distributed storage environment
FastDFS Introduction
The following experiment is about to build a FastDFS distributed storage environment. The network topology is as follows:
First, install FastDFS on each server
[Root @ slaveOne FastDFS] # yum install libevent-devel libevent-headers-y
[Root @ slaveOne FastDFS] #./make. sh
[Root @ slaveOne FastDFS] #./make. sh install
After the installation is successful, you can see the corresponding configuration file under/etc.
Configure the tracker server, 192.168.1.1
Modify the/etc/fdfs/tracker. conf configuration file
Base_path =/tracker
Start the service
[Root @ master fdfs] # fdfs_trackerd tracker. conf
Configure storage Server
192.168.1.2 and 192.168.1.3 modify the/etc/fdfs/storage. conf configuration file
Group_name = group1
Base_path =/storage
Store_path0 =/storage
Tracker_server = 192.168.1.1: 22122
192.168.1.10 modify the/etc/fdfs/storage. conf configuration file
Group_name = group2
Base_path =/storage
Store_path0 =/storage
Tracker_server = 192.168.1.1: 22122
Start the storage service
[Root @ slaveOne fdfs] # fdfs_storaged storage. conf
Data path:/storage/data, mkdir sub dir...
Mkdir data path: 00...
Mkdir data path: 01...
Mkdir data path: 02...
Mkdir data path: 03...
......
Mkdir data path: FE...
Mkdir data path: FF...
Data path:/storage/data, mkdir sub dir done.
The environment has been set up and is now tested on the 192.168.1.1 Tracker server.
Modify the/etc/fdfs/client. conf configuration file
Base_path =/tmp/fastdfs
Tracker_server = 192.168.1.1: 22122
Execute commands to upload files
[Root @ master fdfs] # fdfs_upload_file client. conf/root/jquery-easyui-1.4.zip
Group1/M00/00/00/wKgBA1QnlouAcPe0AAu0LAhS8cw4.4.zip
The returned information indicates that the file has been uploaded to the specified position of group1,
This file can be found in the/storage/data/00/00 path of the storage servers 192.168.1.2 and 192.168.1.3 of group1.
To download an object, run the following command:
The store_lookup parameter of the Tracker configuration file/etc/fdfs/tracker. conf
# The method of selecting group to upload files
#0: round robin
#1: specify group
#2: load balance, select the max free space group to upload file
Store_lookup = 0
0 indicates the Rotation Algorithm, 1 indicates the specified group, 2 indicates the load balancing, find the group with the largest remaining space
If you select 1, you also need to specify the store_group parameter.
# Which group to upload file
# When store_lookup set to 1, must set store_group to the group name
Store_group = group2
Refer:
Build a FastDFS distributed storage environment (using the Nginx module)
Complete installation and configuration steps for fastDFS in CentOS 6.2
FastDFS installation in Ubuntu, PHP Client
Install, configure, and test the FastDFS Distributed File Server
FastDFS integration Nginx problem sorting
Build FastDFS in CentOS
Full record of FastDFS installation in Ubuntu
FastDFS details: click here
FastDFS: click here
This article permanently updates the link address: