Steps for installing and configuring fastdfs under CentOS system


Steps for installing and configuring fastdfs under CentOS system:
1: Install libevent (libevent-2.0.16-stable)
##Uninstall the system’s own libevent
rpm -qa|grep libevent rpm -e libevent*
##Install libevent for trackerd and stored nodes
cd /home/ylh
tar -zxvf libevent-2.0.16-stable.tar.gz
cd libevent-2.0.16-stable
make clean
make && make install
##Create a soft link for libevent to the / lib library, and 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 trackerd node and modify the configuration file / etc / FDFS / tracker.conf (if trackerd needs to use the built-in web server, modify the make file and enable with_httpd = 1 for recompilation)
cd /home/ylh
tar -zxvf FastDFS_v3.06.tar.gz
cd FastDFS_v3.06
./ 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 stored node. The stored node also needs libevent. See Step 1 for the installation steps
cd /home/ylh
tar -zxvf FastDFS_v3.06.tar.gz
cd FastDFS_v3.06
./ install

4: Install a web server for the stored node. The stored node can use nginx or Apache to provide HTTP download services. Here we choose nginx.
cd /home/ylh
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 stored node
cd /home/ylh
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 to exit (VIM / usr / local / nginx / conf / nginx. CONF)
location /M00 {
root /home/ylh/fastdfs/data;

7: Copy and modify nginx module configuration file
cp /home/ylh/fastdfs-nginx-module/src/mod_fastdfs.conf /etc/fdfs
VIM modify / etc / FDFS / Mod_ Fastdfs.conf save exit
##Start nginx

8: Modify the configuration file / etc / FDFS / storage.conf of the stored node to start the stored node
##Create the storage directory MKDIR / home / YLH / fastdfs
##Modify the configuration VIM / etc / FDFS / storage.conf, save it and exit
##Start stored
/usr/local/bin/fdfs_storaged /etc/fdfs/storage.conf

9: Testing
##Modify the client configuration file / etc / conf / client.conf and save it to exit
##Test upload
/usr/local/bin/ fs_test /etc/conf/client.conf upload /home/a.jpg
If the upload is successful, the echo information contains the URL of the file. Enter the URL address in the browser, and the tracker server will automatically redirect to the storage server where the file is stored. The file is downloaded successfully.
So far, fastdfs has been successfully built

Recommended Today

Swift advanced (XV) extension

The extension in swift is somewhat similar to the category in OC Extension can beenumeration、structural morphology、class、agreementAdd new features□ you can add methods, calculation attributes, subscripts, (convenient) initializers, nested types, protocols, etc What extensions can’t do:□ original functions cannot be overwritten□ you cannot add storage attributes or add attribute observers to existing attributes□ cannot add parent […]