FastDFS_v5.05 is installed on the new server. there are still many changes compared with FastDFSV3.02. now we will record the installation and configuration process for your reference. for security considerations, where IP addresses are involved, you can use IP202.98.27.31 at will. when the traffic is low, you can deploy tracker and storage on the same server. later, you can scale the tracker and storage based on your business needs. 1. download the software: wgethttps: // github.com
FastDFS_v5.05 is installed on the new server. there are still many changes compared with FastDFSV3.02. now we will record the installation and configuration process for your reference. for security considerations, where IP addresses are involved, you can use IP202.98.27.31 at will. when the traffic is low, you can deploy tracker and storage on the same server. later, you can scale the tracker and storage based on your business needs:
1. software download:
Wget https://github.com/happyfish100/libfastcommon/archive/V1.0.7.tar.gz
Wget http://jaist.dl.sourceforge.net/project/fastdfs/FastDFS%20Nginx%20Module%20Source%20Code/fastdfs-nginx-module_v1.16.tar.gz
Wget https://github.com/happyfish100/fastdfs/archive/V5.05.tar.gz
Wget http://nginx.org/download/nginx-1.8.0.tar.gz
Wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.36.tar.gz
Wget http://zlib.net/zlib-1.2.8.tar.gz
2. install libfastcommon:
Cp V1.0.7.tar.gz/usr/local/
Tar-zxvf V1.0.7.tar.gz
Cd libfastcommon-1.0.7
./Make. sh
./Make. sh install
Libfastcommon. so is installed in/usr/lib64/libfastcommon. so by default, while the lib directory set by the FastDFS main program is/usr/local/lib, so soft connection is set.
Ln-s/usr/lib64/libfastcommon. so/usr/local/lib/libfastcommon. so
Ln-s/usr/lib64/libfastcommon. so/usr/lib/libfastcommon. so
Ln-s/usr/lib64/libfdfsclient. so/usr/local/lib/libfdfsclient. so
Ln-s/usr/lib64/libfdfsclient. so/usr/lib/libfdfsclient. so
3. install FastDFS:
(1) tar-zxvf V5.05.tar.gz-C/usr/local
Cd/usr/local/fastdfs-5.05/
./Make. sh
./Make. sh install
Cd/etc/fdfs
(2) configuration file settings:
Cp tracker. conf. sample tracker. conf
Cp storage. conf. sample storage. conf
Cp client. conf. sample client. conf
For detailed settings, see the attachment.
Items to be modified in the tracker. conf configuration:
Bind_addr = 202.98.27.31
Port = 22122
Http. server_port = 8080
Several items to be modified in the storage. conf configuration:
Group_name = group1
Bind_addr = 202.98.27.31
Port = 23000
Base_path =/usrdata/fastdfs
Store_path0 =/usrdata/fastdfs
Tracker_server = 202.98.27.31: 22122
Http. server_port = 8888
(3) Start
Start tracker storage. conf
Fdfs_trackerd/etc/fdfs/tracker. conf
Fdfs_storaged/etc/fdfs/storage. conf
4. install the nginx plug-in:
(1) installation
Tar-zxvf fastdfs-nginx-module_v1.16.tar.gz
Cd fastdfs-nginx-module/src/
(2) config file modification:
Vi config
Modify the following configuration.
CORE_INCS = "$ CORE_INCS/usr/local/include/fastdfs/usr/local/include/fastcommon /"
Change
CORE_INCS = "$ CORE_INCS/usr/include/fastdfs/usr/include/fastcommon /"
This is very important. Otherwise, an error will be reported during nginx compilation. I think this is the reason why many fastdfs plug-ins installed on nginx report errors, rather than version mismatch.
Cp mod_fastdfs.conf/etc/fdfs
Modify configurations
Group_name = group1
Tracker_server = 202.98.27.31: 22122
Store_path0 =/usrdata/fastdfs
Base_path =/usrdata/fastdfs
Url_have_group_name = true
2) configure the soft connection of the file server
Ln-s/usrdata/fastdfs/data/M00 (path where the stoage stores data in the configuration file)
Copy the following two files to/etc/fdfs/
Cp/usr/local/fastdfs-5.05/http. conf/etc/fdfs/
Cp/usr/local/fastdfs-5.05/mime. types/etc/fdfs/
5. install nginx:
Install Nginx on each Storage server
(1) pcre installation:
Tar-zxvf pcre-8.36.tar.gz
Cd pcre-8.36
./Configure
Make & make install
Cd ../
Ln-s/usr/local/lib/libpcre. so.1/lib64/
(2) zlib installation:
Tar-zxvf zlib-1.2.8.tar.gz
Cd zlib-1.2.8
./Configure
Make & make install
Cd ../
(3) nginx installation:
Tar-zxvf nginx-1.8.0.tar.gz
Cd nginx-1.8.0
./Configure -- prefix =/usr/local/nginx -- add-module =/home/yq/fastdfs-nginx-module/src
Make
Make install
Cd/usr/local/nginx/conf
Vi nginx. conf
Add
Location/group1/M00 {
Root/usrdata/fastdfs/data;
Ngx_fastdfs_module;
}
Start:
/Usr/local/nginx/sbin/nginx
Installation is complete.
6. Upload test files:
/Usr/bin/fdfs_test/etc/fdfs/client. conf upload benz.jpg
Access files as prompted
Attachment:
Tracker. conf
Storage. conf
Client. conf