Linux environment Fastdfs Distributed File System and PHP extension library installation and configuration

Source: Internet
Author: User
Tags mkdir

introduction of Fastdfs

Fastdfs is an open source lightweight Distributed File system developed by HAPPY_FISH100, and she manages the files, including file storage, file synchronization, file access (file upload, file downloading), etc., which solves the problem of large capacity storage and load balancing. Especially suitable for the document as the carrier of online services, such as photo albums, video sites and so on. The FASTDFS server has two roles: Tracker (tracker) and storage node (storage). The tracker mainly does the dispatching work and plays the role of load balancing on the access. The system structure diagram looks like this:

More Documentation:

Project Address: http://code.google.com/p/fastdfs/

Fastdfs Introduction: http://linux.chinaunix.net/bbs/thread-1062461-1-1.html

Second, installation and configuration

The FASTDFS structure, including two servers, is described in the topology map for the Linux server cluster scenario--lvs+keepalived (1), based on the VMware Environment:

Tracker server:192.168.195.3 (port:22122)

Storage server:192.168.195.4 (port:23000)

1, install Fastdfs, download Fastdfs source package, Eg:fastdfs_v1.28.tar.gz,tracker server and Storage Server installation way, the process is as follows:

#wget http://fastdfs.googlecode.com/files/FastDFS_v1.28.tar.gz

#tar-ZVXF fastdfs_v1.28.tar.gz

#cd Fastdfs

#./make.sh (if HTTP support is required, remove "# with_httpd=1" in make.sh)

#./make.sh Install

#mkdir/etc/fdfs

#mkdir/home/yuqing/fastdfs

2, Start tracker server

#cp conf/tracker.conf/etc/fdfs/

#/usr/local/bin/fdfs_trackerd/etc/fdfs/tracker.conf

3, Start Storage server

#cp conf/storage.conf/etc/fdfs/

#/usr/local/bin/fdfs_storaged/etc/fdfs/storage.conf

Note: According to the real environment of their own modify tracker.conf and storage.conf, can also refer to the "Fastdfs configuration file detailed", this environment needs to be storage.conf Tracker_server value modified to 192.168.195.3 : 22122.

Installation and configuration of FASTDFS client PHP extension Library

Currently Fastdfs PHP extensions do not support the Windows platform, before installing PHP extensions, you should install the FASTDFS client (the client installation process Ibid.) and PHP, the extension library installation is as follows:

#cd php_client (enter FASTDFS installation package/fastdfs/php_client)

#/opt/php/bin/phpize

#./configure--with-php-config=/opt/php/bin/php-config

#make && make Install

#cp. /conf/client.conf/etc/fdfs/(Modify client.conf, eg:tracker_server=192.168.15.3:22122)

#cat Fastdfs_client.ini >>/opt/php/etc/php.ini

Modify the configuration items for php.ini, such as:

Fastdfs_client.tracker_group_count = 1

Fastdfs_client.tracker_group0 =/etc/fdfs/client.conf

Restart the Web server. Extension function Descriptions and program examples are already available in php_client.

P S: Thanks for Happy_fish100 's enthusiastic help.


If you want to reprint, please specify: This article from the source of infection blog [Http://blog.csdn.net/caleng]

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.