Linux Server---Fastdfs Distributed File server configuration

Source: Internet
Author: User

First, upload the required documents

Connect to the server via SECURECRT, upload using the sftp feature, file upload is located in the/~ directory.

Second, install the libvent kit first

Yum-y Install Libevent

Third, install the libfastcommonV1.0.7 kit.

Switch to the ~ directory, then unzip

Tar zxf libfastcommonv1.0.7.tar.gz

Enter the libfastcommonV1.0.7 directory, install

CD libfastcommonV1.0.7

./make.sh

./make.sh Install

And then

Cp/usr/lib64/libfastcommon.so/usr/lib

Iv. Installation of tracker services

Switch working directory first, then unzip

Enter the extracted file

./make.sh (wait for the machine to complete before proceeding to the next step)

./mkae.sh Install

Configuration files are placed in the/etc/fdfs folder

CD/

CD ~

CD fastdfs/conf

Assign all files to/etc/fdfs

Configure the Tracker service. Modify the/etc/fdfs/tracker.conf file.

Path is not the case, you create a good path

Configuration complete

Start Tracker. /usr/bin/fdfs_trackerd/etc/fdfs/tracker.conf

(Restart Word use command:/usr/bin/fdfs_trackerd/etc/fdfs/tracker.conf restart)

Fifth Step: Install storage Service

If it is installed on a different server, 1~4 needs to be re-executed.

Configure the storage service. Modify the Etc/fdfs/storage.conf file

Start the service:

/usr/bin/fdfs_storaged/etc/fdfs/storage.conf

VI, build Nginx to provide HTTP services to access

Fastdfs-nginx-module_v1.16.tar.gz

1, unzip the plugin compression package tar zxf fastdfs-nginx-module_v1.16.tar.gz

2, modify the/root/fastdfs-nginx-module/src/config file, the local removed.

3. Copy the libfdfsclient.so to the/usr/lib

cp/usr/lib64/libfdfsclient.so/usr/lib/

4. Install Nginx,

Re-config to Nginx

./configure \

--prefix=/usr/local/nginx \

--pid-path=/var/run/nginx/nginx.pid \

--lock-path=/var/lock/nginx.lock \

--error-log-path=/var/log/nginx/error.log \

--http-log-path=/var/log/nginx/access.log \

--with-http_gzip_static_module \

--http-client-body-temp-path=/var/temp/nginx/client \

--http-proxy-temp-path=/var/temp/nginx/proxy \

--HTTP-FASTCGI-TEMP-PATH=/VAR/TEMP/NGINX/FASTCGI \

--HTTP-UWSGI-TEMP-PATH=/VAR/TEMP/NGINX/UWSGI \

--HTTP-SCGI-TEMP-PATH=/VAR/TEMP/NGINX/SCGI \

--add-module=/root/fastdfs-nginx-module/src

Make

Make install

Copy the/root/fastdfs-nginx-module/src/mod_fastdfs.conf file to the/etc/fdfs directory. Edit:

1, the configuration of Nginx

Add a server to the Nginx configuration file:

server {

Listen 80;

server_name 192.168.101.3; (IP address)

location/group1/m00/{

#root/home/fastdfs/fdfs_storage/data;

Ngx_fastdfs_module;

}

}

3. Start Nginx

The configuration is complete and the Java side uses the method provided by Fastdfs_client.jar to upload the file.

Add a resource file client.properties

Content:tracker_server=192.168.25.133:22122

 Public void throws Exception {        new fastdfsclient ("classpath:client.properties");         = Client.uploadfile ("d:\\documents\\pictures\\images\\200811281555127886.jpg", "jpg");        System.out.println (UploadFile);    }
Path to HTTP://IP address/console output in Web pages
You can access the uploaded images.

Linux Server---Fastdfs Distributed File server configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.