Introduction
FastDFS is a high performance distributed file system (DFS). Its major functions include: file storing, file syncing and file accessing, and design for high capacity and load balancing.
You may not mount a FastDFS volume directly to FreeBSD, however, you can access the volume(s) through the provided Nginx/Apache module and/or several languages such as C++, PHP, .NET, Java, Python
The software works in the same manner a RAID 10 volume would be configured, but instead of harddrives you configure the array with servernodes. One can read more about it here: http://code.google.com/p/fastdfs/wiki/Overview
Installation
FastDFS is a high performance distributed file system (DFS). Its major functions include: file storing, file syncing and file accessing, and design for high capacity and load balancing.
You may not mount a FastDFS volume directly to FreeBSD, however, you can access the volume(s) through the provided Nginx/Apache module and/or several languages such as C++, PHP, .NET, Java, Python
The software works in the same manner a RAID 10 volume would be configured, but instead of harddrives you configure the array with servernodes. One can read more about it here: http://code.google.com/p/fastdfs/wiki/Overview
Installation
- Let's start with installing the only dependency:
Code:cd /usr/ports/devel/libevent make install clean
- Create and add pre-make stuff that FastDFS needs to be able to be built properly without errors:
Code:mkdir /usr/lib64 echo '' >> /usr/include/sys/errno.h echo '#ifndef ENONET' >> /usr/include/sys/errno.h echo '#define ENONET 64 /* Machine is Not on the Network */' >> /usr/include/sys/errno.h echo '#endif' >> /usr/include/sys/errno.h
Note that the line
Code:echo '#define ENONET 64 /* Machine is Not on the Network */' >> /usr/include/sys/errno.h
- Let's download FastDFS and install:
Code:cd ~/ fetch "http://fastdfs.googlecode.com/files/FastDFS_v4.06.tar.gz" tar -zxvf FastDFS_v4.06.tar.gz cd ~/FastDFS sh make.sh sh make.sh install
- Init scripts:
FastDFS does not provide any native FreeBSD init scripts for its daemons so I did create them. I have also provided them upstream so at the time of installing you might be able to skip this step depending on if they have been added or not.
- Download http://forums.freebsd.org/attachment.php?attachmentid=1963&d=1380026763 and place it in /usr/local/etc/rc.d/
Code:cd /usr/local/etc/rc.d/ tar -zxvf fdfs_init_scripts.tar.gz rm fdfs_init_scripts.tar.gz chmod 555 fdfs*
- Enable the daemon you want to run on the specific server:
echo 'fdfs_trackerd_enable="YES"' >> /etc/rc.conf
echo 'fdfs_storaged_enable="YES"' >> /etc/rc.conf
You may also specify a different configuration location withCode:fdfs_trackerd_config=""
Code:fdfs_storaged_config=""