Install and configure FastDFS_v5.05 on CentOS

Source: Internet
Author: User

Install and configure FastDFS_v5.05 on CentOS

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.