1024programmer Nginx Installation and configuration method of CentOS6.2 system fastdfs

Installation and configuration method of CentOS6.2 system fastdfs

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.

This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/installation-and-configuration-method-of-centos6-2-system-fastdfs/

author: admin

Previous article
Next article

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索