Steps to install and configure FastDFS under centos6.2 system:
1: Install libevent (libevent-2.0.16-stable)
## Uninstall system comes with libevent
rpm -qa | grep libevent rpm -e libevent*
## Install libevent for Trackerd and Storaged nodes
cd /home/ylh
wget https://github.com/downloads/libevent/libevent/libevent-2.0.16-stable.tar.gz
tar -zxvf libevent-2.0.16-stable.tar.gz
cd libevent-2.0.16-stable
make clean
./configure
make && make install
##Create a soft link for libevent to the /lib library, 64-bit system corresponds to /lib64
ln -s /usr/local/lib/libevent* /lib/
ln -s /usr/local/lib/libevent* /lib64/
2: Install FastDFS for the Trackerd node, and modify the configuration file /etc/fdfs/tracker.conf(
If Trackerd needs to use the built-in web server, you need to modify the make file, enable WITH_HTTPD=1 and then compile)
cd /home/ylh
wget http://fastdfs.googlecode.com/files/FastDFS_v3.06.tar.gz
tar -zxvf FastDFS_v3.06.tar.gz
cd FastDFS_v3.06
./make.sh
./make.sh install
##Create storage directory
mkdir /home/ylh/fastdfs
##Modify the configuration file. vim /etc/fdfs/tracker.conf Save and exit after modification
## start trackerd
/usr/local/bin/fdfs_trackerd /etc/fdfs/tracker.conf
3: Install FastDFS for the Storaged node, the Storaged node also needs libevent, see the first step for the installation steps
cd /home/ylh
wget http://fastdfs.googlecode.com/files/FastDFS_v3.06.tar.gz
tar -zxvf FastDFS_v3.06.tar.gz
cd FastDFS_v3.06
./make.sh
./make.sh install
4: Install a web server for the Storaged node. The Storaged node can use nginx or apache to provide http download service. Here we choose nginx.
cd /home/ylh
wget http://nginx.org/download/nginx-0.8.55.tar.gz
tar zxvf nginx-0.8.55.tar.gz
cd nginx-0.8.55
./configure –prefix=/opt/nginx
–with-http_stub_status_module
make && make install
5: Install fastdfs-nginx-module for Storaged nodes
cd /home/ylh
wget http://fastdfs.googlecode.com/files/fastdfs-nginx-module_v1.10.tar.gz
tar xzf fastdfs_nginx_module_v1.05.tar.gz
cd /home/ylh/nginx-0.8.55 ./configure
–add-module=/home/ylh/fastdfs-nginx-module/src
make; make install
6: Modify the nginx configuration file and save and exit (vim
/usr/local/nginx/conf/nginx.conf)
location /M00 {
root
/home/ylh/fastdfs/data;
ngx_fastdfs_module;
“
}
7: Copy and modify the nginx module configuration file
cp /home/ylh/fastdfs-nginx-module/src/mod_fastdfs.conf
/etc/fdfs
vim modify /etc/fdfs/mod_fastdfs.conf save and exit
##Start nginx
/usr/local/nginx/sbin/nginx
8: Modify the configuration file /etc/fdfs/storage.conf of the Storaged node and start Storaged
##Create storage directory mkdir /home/ylh/fastdfs
##Modify configuration vim /etc/fdfs/storage.conf Save and exit after modification
## Start Storaged
/usr/local/bin/fdfs_storaged /etc/fdfs/storage.conf
9: test
## Modify the client configuration file /etc/conf/client.conf file and save and exit
## test upload
/usr/local/bin/fs_test /etc/conf/client.conf upload
/home/a.jpg
If the upload is successful, there is a url of the file in the echo information, in the browser, enter the url address, tracker
The server will automatically redirect to the storage server where the file is stored, and the file is downloaded successfully.
So far, FastDFS has been successfully built.