Build a FastDFS distributed storage environment (using the Nginx module)

Source: Internet
Author: User

Build a FastDFS distributed storage environment (using the Nginx module)

The last version used to build FastDFS is v4.05. See
This version is old.

The latest version is v5.04. Due to the reconstruction of the Code, there are some inconsistencies in the installation process.
Latest: http://sourceforge.net/projects/fastdfs/files/
For installation, refer to the INSTALL file in the compressed package.

Set up a FastDFS environment and add the Nginx module.
Software used:
FastDFS_v5.04.tar.gz
Libfastcommon-master.zip
Fastdfs-nginx-module_v1.16.tar.gz
Nginx-1.6.2.tar.gz

Different from earlier versions, libfastcommon must be installed in v5.04 first.
: Https://github.com/happyfish100/libfastcommon.git

1. Install libfastcommon
On each server, extract libfastcommon and go to the libfastcommon-master Directory for execution.
./Make. sh
./Make. sh install

We can see that libfastcommon. so is installed in/usr/lib64/libfastcommon. so.

However, the lib directory set by the FastDFS main program is/usr/local/lib.
Therefore, you need to create a soft link.
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


2. Install the FastDFS main program
This version does not seem to require libevent dependencies.
On each server, decompress fastdfs_v5.04.tar.gz and go to the FastDFS directory.
Run
./Make. sh
./Make. sh install
If the soft link in the previous step is successfully created, it should be smooth.

Configure the Tracker server (192.168.1.70)
Vim/etc/fdfs/tracker. conf file, modify the following content:
Base_path =/tracker
Then execute the command
Fdfs_trackerd tracker. conf

Configure the Storage server (192.168.1.80, 192.168.1.30)
Vim/etc/fdfs/storage. conf
Group_name = group1
Base_path =/storage
Store_path0 =/storage
Tracker_server = 192.168.1.70: 22122
Then execute the command
Fdfs_storaged storage. conf


Run the test and modify the configuration file/etc/fdfs/client. conf of the Tracker server 192.168.1.70.
Tracker_server = 192.168.1.170: 22122
Execute Command
[Root @ mysql1 fdfs] # fdfs_upload_file client. conf/home/nginx/FastDFS_v5.04.tar.gz
Group1/M00/00/00/wKgBHlQvrQGARrS6AAU9tcFAzok.tar.gz


3. Unzip fastdfs-nginx-module
FastDFS stores files on the Storage server through the Tracker server,
However, there is a delay when the servers in the same group need to copy files.
Assume that the Tracker server uploads the file to 192.168.1.80 and the file ID has been returned to the client,
At this time, the background will copy this file to 192.168.1.30. If the copy is not completed, the client will use this ID to retrieve the file at 192.168.1.30, and an error will certainly occur.
The fastdfs-nginx-module can be redirected to the source server to fetch files, avoiding errors caused by Replication latency on the client.

Modify the config file of fastdfs-nginx-module
The original content is
CORE_INCS = "$ CORE_INCS/usr/local/include/fastdfs/usr/local/include/fastcommon /"

Vim/home/nginx/fastdfs-nginx-module/src/config, change
CORE_INCS = "$ CORE_INCS/usr/include/fastdfs/usr/include/fastcommon"

The location of each version is not uniform, so you need to modify the location based on your own version.

-------------------------------------- Split line --------------------------------------

Deployment of Nginx + MySQL + PHP in CentOS 6.2

Build a WEB server using Nginx

Build a Web server based on Linux6.3 + Nginx1.2 + PHP5 + MySQL5.5

Performance Tuning for Nginx in CentOS 6.3

Configure Nginx to load the ngx_pagespeed module in CentOS 6.3

Install and configure Nginx + Pcre + php-fpm in CentOS 6.4

Nginx installation and configuration instructions

Nginx log filtering using ngx_log_if does not record specific logs

-------------------------------------- Split line --------------------------------------

For more details, please continue to read the highlights on the next page:

  • 1
  • 2
  • Next Page

Related Article

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.