Centos7 builds fastdfs image server

1. Relevant dependencies required for installation

yum -y install make cmake gcc gcc-c++

insert image description here
insert image description here
Because my server has already installed gcc, so omit

Use gcc -v to check the version
insert image description here

yum -y install zip unzip

Install the performance event notification library

yum -y install libevent

insert image description here
Install nginx dependencies

yum -y install libevent

insert image description here

yum -y install zlib*

insert image description here

yum -y install openssl openssl--devel 

insert image description here
install git

yum -y install git

2. Install Fastdfs

The installation directory of all packages used /home/soft
insert image description here
1. Install libfastcommon first

git clone https://github.com/happyfish100/libfastcommon.git

cd libfastcommon

insert image description here

./make.sh

insert image description here

install

insert image description here
2. Install fastdfs

cd /home/soft

git clone https://github.com/happyfish100/fastdfs.git

insert image description here

./make.sh

insert image description here
Error resolution:

2.1 Install libserverframe

cd /home/soft
git clone https://github.com/happyfish100/libserverframe.git --depth 1

cd libserverframe/

./make.sh

insert image description here

./make.sh install

insert image description here
Return to the fastdfs directory after the libserverframe installation is complete

cd /home/soft/fastdfs/

insert image description here
insert image description here
After compiling and installing, generate the configuration file to the /etc/fdfs/ directory

3. Tracker configuration

cd /etc/fdfs
vim tracker.conf

Modify the configuration, store_lookup is changed to 0 rotation training strategy, the default is 2 load balancing strategy, if the value is 1, it means that upload and download operations must always be performed to a certain group, then store_group will work Create a tracker data directory and set
insert image description here
permissions

mkdir -p /home/fastdfs/tracker
chmod 777 /home/fastfds/*

start fastdfs tracker

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

insert image description here

4. Configure storage

cd /etc/fdfs
vim storage.conf

Change setting

group_name=group1
base_path=/home/fastdfs/storage

insert image description here

Create a storage folder and set permissions

mkdir /home/fastdfs/storage
chmod 777 /home/fastdfs/*

insert image description here

start storage

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

insert image description here

Client testing, and server testing on the same machine

insert image description here

Five, configure nginx

1. Install fastdfs-nginx-module on the storage server

insert image description here

vim config

Remove local, because it is installed under /usr/include during installation

insert image description here

2. Install nginx

 cd /home/soft

git clone http://nginx.org/download/nginx-1.8.0.tar.gz

insert image description here

tar -zxvf nginx-1.8.0.tar.gz -C /home/soft/

insert image description here

./configure --add-module=/home/soft/fastdfs-nginx-module/src

insert image description here
insert image description here
insert image description here
After the installation is successful, the nginx folder will be generated under /usr/local
insert image description here

3. fdfs-nginx configuration

Perform the following operations in the fastdfs-nginx-module/src directory
insert image description here

cd /etc/fdfs
vim mod_fastdfs.conf

Change the following configuration

base_path=/home/fastdfs

insert image description here
insert image description here
insert image description here
Create fastdfs configuration

Copy the configuration file in the fastfds installation package directory to /etc/fdfs/
insert image description here
to create a soft connection
insert image description here

4. Configure nginx

insert image description here
Change nginx.conf configurationinsert image description here

start nginx

/usr/local/nginx/sbin/nginx

restart nginx

/usr/local/nginx/sbin/nginx -s reload

Verify that the modified configuration file is correct

/usr/local/nginx/sbin/nginx -t

insert image description here

Permanently release port 8888 of the firewall

insert image description here

6. Verification

insert image description here
Original text: https://www.xjx100.cn/news/251513.html?action=onClick

Guess you like

Origin blog.csdn.net/weixin_49177159/article/details/130845241