Recently in the study of load balancing and clustering, one of the main issues involved is how to get the real server in the cluster to share a set of file systems. On the Internet, Fastdfs, the Chinese (happy fish, thanks to his open source spirit) developed a set of lightweight distributed file systems. Actually built a bit, feel good, small and easy to use, support HTTP download. Although the official website of the FASTDFS has been more detailed in accordance with the manual, but in the actual construction process, still encountered a lot of problems, I hope that my record can let the later students take a few detours:) below into the topic.
Fastdfs Installation Use actual combat (Installation article)
KEYWORDS:FASTDFS, Distributed File System, Ubuntu
Author:soartju
Reprint Please specify source: http://soartju.iteye.com/blog/803477
At present, Fastdfs supports UNIX-like systems, tested under Linux and FreeBSD, this article uses Ubuntu10.4, it is recommended to briefly understand the principle of fastdfs before installation, which will have a good understanding of the subsequent configuration section.
I. Preparation-installation of Libevent
Fastdfs internal binding libevent as an HTTP server, the v2.x version must be installed Libevent, this article installs the V2.2 version, so you must install Libevent. (It is also recommended to download files using HTTP )
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. Ubuntu10.4 default is to install the libevent, you can uninstall it in the Software center and then follow the way described below to install.
This article installs the libevent1.4.14b-stable,: http://monkey.org/~provos/libevent/
Installation steps: Unzip the libevent and then enter the extracted directory to perform the following:
Shell Code
- ./configure--PREFIX=/USR
- Make clean;
- Make
- Make install
./configure--prefix=/usrmake Clean;makemake Install
Installation libevent complete.
Second, installation Fastdfs
1, download Fastdfs source program, http://code.google.com/p/fastdfs/downloads/list, download here is fastdfs_v2.02.tar.gz (It is recommended to install the V2.02 version, which is more stable than the v1.x version and significantly improved performance)
2, in the Fastdfs_v2.02.tar.gz folder under the execution:
Shell Code
- sudo tar vxzf fastdfs_v2. 02.tar.gz/home/soar/fastdfs
sudo tar vxzf fastdfs_v2.02.tar.gz/home/soar/fastdfs
Note:/home/soar/fastdfs can also be another directory, remember that this is the decompression directory, and later in%fastdfs% to express)
3, because to use the built-in HTTP service, so edit the%fastdfs%/make.sh file, find #WITH_HTTPD =1 modified to with_httpd=1 to support HTTP
4. Enter the%fastdfs% directory and execute:
Shell Code
- sudo./make.sh
sudo./make.sh
5, in the%fastdfs% directory, the implementation of:
Shell Code
- sudo./make.sh Install
sudo./make.sh Install
If you run the command-line message at the end, you see a similar
Shell Code
- #ln-fs/usr/local/lib/libfastcommon.so. 1/usr/local/lib/libfastcommon.so
- #ln-fs/usr/local/lib/libfdfsclient.so. 1/usr/local/lib/libfdfsclient.so
- Sh./fdfs_link_library.sh
#ln-fs/usr/local/lib/libfastcommon.so.1/usr/local/lib/libfastcommon.so#ln-fs/usr/local/lib/libfdfsclient.so.1/ Usr/local/lib/libfdfsclient.sosh./fdfs_link_library.sh
Congratulations, the installation has been successful!
Fastdfs installation Use actual combat one (Installation article)