Remember the process of installing and configuring fastdfs once

The system environment for this installation is ubuntu

1. Download related software

2. Install and configure related software

3. Verify

4. Problems encountered


1. Download related software
Install fastdfs First, you need to install libevent, because the integrated web function of fastdfs itself is weak , so

the software address of the software downloaded by nginx is integrated as follows:

https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz

https: //storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/fastdfs/FastDFS_v4.06.tar.gz

https://storage.googleapis.com/google-code-archive-downloads /v2/code.google.com/fastdfs/fastdfs-nginx-module_v1.15.tar.gz

http://nginx.org/download/nginx-1.10.2.tar.gz


After downloading the software, start installing

2. Install and configure related software

Install libevent,
decompress libevent (tar -zxvf libevent-2.0.22-stable.tar.gz), enter the libevent root directory and execute the installation steps
As follows:
cd libevent-2.0.22-stable
./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/





install fastdfs
After decompressing fastdfs (tar -zxvf FastDFS_v4.06.tar.gz), enter the fastdfs root directory and execute the installation steps as follows:
cd FastDFS
./make.sh
./make.sh install

There may be an error similar to 'pthread' not being found, mainly because the 'pthread' path of different systems is different, resulting in a failure during compilation. For details, please refer to:
http://blog.csdn.net/chen861201 /article/details/7341637







install fastdfs-nginx-module
decompress fastdfs-nginx-module (tar -zxvf fastdfs-nginx-module_v1.15.tar.gz)


install nginx
decompress nginx (tar -zxvf nginx-1.10.2. tar.gz), enter the nginx root directory and perform the installation steps as follows:
cd nginx-1.2.0
./configure --prefix=/usr/local/nginx --add-module=../fastdfs-nginx-module/src
make && make install

Note: the relative path of --add-module=fastdfs-nginx-module ( Fill in according to the location of your own system files)



After installing the above software, perform the relevant configuration as follows:
Configure the fastdfs related environment:
tracker configuration:
vi /etc/fdfs/tracker.conf
base_path=/opt/oracle/fastdfs/fastdfs_tracker

storage configuration
vi / etc/fdfs/storage.conf
base_path=/opt/oracle/fastdfs/fastdfs_storage
store_path0=/opt/oracle/fastdfs/fastdfs_storage
tracker_server=192.168.127.132:22122 As in the

above environment, please configure it according to the specific conditions of your system and configure the folder A file needs to be created before. For the specific attribute meaning, see the note

client configuration:
vi /etc/fdfs/client.conf
base_path=/opt/oracle/fastdfs/fastdfs_client
tracker_server=192.168.127.132:22122


ngnix configuration:
vi /usr/local/nginx/conf/nginx.conf
server {
    listen 80;
    server_name localhost;

    location /M00 {
        alias /opt/oracle/fastdfs/fastdfs_storage/data;     ngx_fastdfs_module
        ;     ...... } fastdfs-nginx-module configuration: copy mod_fastdfs.conf to /etc/fdfs/ cp fastdfs-nginx-module/src/mod_fastdfs.conf /etc/fdfs/ vi /etc/fdfs/mod_fastdfs.conf base_path=/opt/oracle/fastdfs/fastdfs_storage tracker_server=192.168.127.132:22122 store_path0=/opt/oracle/fastdfs/fastdfs_storage After configuring the relevant software, you can start the software for verification
















#Start tracker server
/usr/local/bin/fdfs_trackerd /etc/fdfs/tracker.conf #Start
storage server
/usr/local/bin/fdfs_storaged /etc/fdfs/storage.conf #Start
nginx
/usr/local/nginx/ sbin/nginx

can use the following command to see if the process is started:
ps aux | grep tracker
ps aux | grep storage
ps aux | grep nginx

If it is not started, please check the relevant software log
/opt/oracle/fastdfs/fastdfs_tracker/logs
/opt/oracle /fastdfs/fastdfs_storage/logs
/usr/local/nginx/logs/error.log

According to the log googole, bd related errors


3. Verify the
upload file
/usr/local/bin/fdfs_test /etc/fdfs/client.conf upload /opt/ After the test.txt

is successful, the address of the relevant file will be displayed, such as:
http://192.168.127.132:8080/group2/M00/00/00/wKh_hFgv_lWABkYXAAAADMBJXek506_big.txt

access and download (and cannot be accessed directly through nginx at the above address):
http://192.168.127.132/M00/00/00/wKh_hFgv_lWABkYXAAA6_AAAADMBJbigX
Please

visit .txt according to the nginx configuration. The uploaded files are generally under the relevant path:






4. Problems encountered
a. During the installation of fastdfs If it is a similar error of 'pthread', please refer to:
http://blog.csdn. net/chen861201/article/details/7341637

b.request has send,response await...
keep stopping here
to view the log
/opt/oracle/fastdfs/fastdfs_storage/logs
/usr/local/nginx/logs/error.log
google ,bd can generally find a solution



Follow-up :
If you encounter problems during the installation process, generally check the log first, then googole, bd can find the problem . Through the process of finding the problem, you can learn more about the


related website:
https://github.com/judasn/Linux-Tutorial/blob/master/FastDFS-Install-And-Settings.md

https://code.google.com/archive/p/fastdfs/downloads

http://www.cnblogs.com/adolfmc/p/4239575.html

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326891392&siteId=291194637