To install and configure fastdfs in centos6.2:
1: Install libevent (libevent-2.0.16-stable)
# Uninstall the built-in 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 the libevent under the/lib library. The 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 a storage directory
Mkdir/home/ylh/fastdfs
# Modify the configuration file. Vim/etc/fdfs/tracker. conf, save the modification, and exit
# Start trackerd
/Usr/local/bin/fdfs_trackerd/etc/fdfs/tracker. conf
3: Install fastdfs for the storaged node, and the storaged Node also needs libevent. For installation steps, see step 1.
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 the Web server for the storaged node. The storaged node can use nginx or Apache to provide the HTTP download service. Nginx is used here.
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 the storaged Node
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: Save/etc/fdfs/mod_fastdfs.conf 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 a storage directory mkdir/home/ylh/fastdfs
# Modify the vim/etc/fdfs/storage. conf configuration and save and exit
# Start storaged
/Usr/local/bin/fdfs_storaged/etc/fdfs/storage. conf
9: Test
# Modify the client configuration file/etc/CONF/client. conf and save and exit
# Test upload
/Usr/local/bin/fs_test/etc/CONF/client. conf upload/home/a.jpg
If the upload succeeds and the Echo information contains the File URL, enter the URL address in the browser, and the tracker server will automatically redirect to the storage server of the stored file. The file is downloaded successfully.
So far, fastdfs has been successfully set up.
For more information about fastdfs configuration, see:
Http://bbs.chinaunix.net/thread-1941456-1-1.html
Http://bbs.chinaunix.net/thread-1920470-1-1.html