Centos system installation and configuration FastDFS steps to share

  

FastDFS is an open source lightweight distributed file system, which manages files, including: file storage, file synchronization, file access (file upload, file download), etc. , solve the problem of mass storage and load balancing. Especially suitable for file-based online services, such as photo album sites, video sites, etc.

Centos system installation and configuration of FastDFS steps: 1: install libevent (libevent-2.0.16-stable) ##Uninstall system from With libevent rpm -qa| Grep libevent rpm -e libevent* ##Install libevent cd /home/ylh wget for Trackerd and Storaged node nodes http://unclelu-server.googlecode.com/files/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 corresponding /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 compile again) 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 the 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, S for Storaged nodes The toraged node also needs libevent. For the installation steps, see the first step 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 the nginx or apache to provide the http download service. Here we use 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 cd /home/ylh wget for the Storaged node 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 Exit ##Start nginx /usr/local/nginx/sbin/nginx

8: Modify the configuration file /etc/fdfs/storage.conf of the Storaged node, start Storaged ##Create the storage directory mkdir /home/ylh /fastdfs ##Modify Configure vim /etc/fdfs/storage.conf Save and exit after modification ##Start Storaged /usr/local/bin/fdfs_storaged /etc/fdfs/storage.conf

9: Test ## Modify 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 succeeds, the file has the url of the file. In the browser, enter the url address, the tracker server will automatically redirect to the storage server where the file is stored, and the file download is successful. At this point, the FastDFS has been successfully built

Copyright © Windows knowledge All Rights Reserved