Distributed File storage Fastdfs (ii) FASTDFS installation

Source: Internet
Author: User

In the previous article, we analyzed the FASTDFS architecture, know that Fastdfs is a client, tracking server and storage Server three parts, below we look at how to build a Fastdfs environment out. This is Fastdfs's homepage: https://code.google.com/p/fastdfs/, with a brief introduction to Fastdfs and some popular downloads. But I think, the building process of the official network is too simple, and did not propose a solution to an exception, for a novice is difficult to build a satisfactory environment, after all, the Fastdfs have a higher attainments will not struggle how to build the environment, So here I summed up my construction process and some of the problems encountered, I hope to have some help, if there are any problems also please actively pointed out.

I. Environmental Statement

I think the first thing for the blog to build the environment is to declare what the environment is used in the blog post, so that the people who look at the blogger form a comparison, a lot of bloggers do not explain their environment, a lot of people follow the Bo master to build, set up the more than half to find himself and Bo Master environment is not the same, That waste of time and affect the mood. Here I explain my environment. I use Ubuntu14.04 LTS 64 bit as the host, build a single node FASTDFS environment, attention is a single node. Let's start with the simplest, and then I'll write an article about how to build a multi-node environment. To facilitate the recovery of the system, I used the VirtualBox virtual Ubuntu14.04 LTS, of course, if you want to build on the physical machine of course also can. All commands that appear in the following blogs are executed under root authority.

second, environmental preparation-installation Libevent

Fastdfs is internally bound to Libevent as an HTTP server, libevent must be installed above the v2.x version, this article installs the V4.06 version, so libevent must be installed.

If Libevent is already installed, verify that the installation path is/usr, because Fastdfs will need to find some dependent files in this directory when compiling the source program, otherwise the compilation Fastdfs error. If not, it is recommended that you uninstall Libevent first and then install to/usr. This article installs the libevent-2.0.19-stable.tar.gz,:https://acelnmp.googlecode.com/files/libevent-2.0.19-stable.tar.gz, which is followed by the following steps.

wget https://acelnmp.googlecode.com/files/libevent-2.0.19-stable.tar.gztar zxvf libevent-2.0.19-stable.tar.gz./configure --prefix=/usrmake cleanmakemake install

So the libevent is installed and pressed into.

third, installation Fastdfs

1, first download Fastdfs

wget https://fastdfs.googlecode.com/files/FastDFS_v4.06.tar.gz

2. Decompression

tar vxzf FastDFS_v4.06.tar.gz

Note: Here the%fastdfs% is the decompression directory, each person according to their own actual situation to replace.

3. Modify the make.sh file

Start by executing the following command to see where your libpthread.a is located

/-name‘libpthread.a‘

The result is:/USR/LIB/X86_64-LINUX-GNU/LIBPTHREAD.A

The same way to see your own libpthread.so file why where

/-name‘libpthread.so‘

The result is:/usr/lib/x86_64-linux-gnu/libpthread.so

Find the places in make.sh about LIBPTHREAD.A and libpthread.so, where you added the file location you just found.

Original file

if-f-f-f-f-f-f-f-fthen  LIBS="$LIBS -lpthread"

The modified file

if [ - F/usr/lib/libpthread.So] || [ - F/usr/Local/lib/libpthread.So] || [ - F/lib64/libpthread.So] || [ - F/usr/lib64/libpthread.So] || [ - F/usr/lib/x86_64-linux-gnu/libpthread.So]|| [ - F/usr/lib/libpthread.A] || [ - F/usr/lib/x86_64-linux-gnu/libpthread.A] || [ - F/usr/Local/lib/libpthread.A] || [ - F/lib64/libpthread.A] || [ - F/usr/lib64/libpthread.A]; then libs= "$LIBS-lpthread"

The purpose of this step is because different machine pthread the location of the class library is different, if not set up, there will be a compile time can not find pthread and other errors.

Note: Someone's blog is written in order to support HTTP, to set with_httpd=1 and so on, In my installed v4.06, Fastdfs no longer integrates the functionality of HTTP, if you want to download files via HTTP, you need to configure a separate fastdfs-apache-module, in the back of the blog I will explain separately how to configure.

4, modify the Client/fdfs_link_library.sh.in

Locate the following location

Change the lib64 to Lib, otherwise there will be an error that the file does not exist. The changes are as follows:

5. Start the installation

Execute the following command in the Fastdfs root directory to install, if there is no error, the installation is successful

./make.sh./make.sh install

Distributed File storage Fastdfs (ii) FASTDFS installation

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.