fastdfs 설치 사용

3254 단어

환경 준비


컴파일 환경

yum install git gcc gcc-c++ make automake autoconf libtool pcre pcre-devel zlib zlib-devel openssl-devel -y

카탈로그


설명
위치:
모든 설치 키트
/usr/local/src
tracker 추적 서버 데이터
/data/tracker
스토리지 서버 데이터
/data/storage
mkdir -p /data/tracker  # 
mkdir -p /data/storage  # 
 # 
cd /usr/local/src 

libfatscommon 설치

git clone https://github.com/happyfish100/libfastcommon.git --depth 1
cd libfastcommon/
./make.sh && ./make.sh install

FastDFS 설치

git clone https://github.com/happyfish100/fastdfs.git --depth 1
cd fastdfs/
./make.sh && ./make.sh install
# 
cp /etc/fdfs/tracker.conf.sample /etc/fdfs/tracker.conf
cp /etc/fdfs/storage.conf.sample /etc/fdfs/storage.conf
cp /etc/fdfs/client.conf.sample /etc/fdfs/client.conf # , 
cp /usr/local/src/data/conf/http.conf /etc/fdfs/ # nginx 
cp /usr/local/src/data/conf/mime.types /etc/fdfs/ # nginx 

fastdfs-nginx-module 설치

git clone https://github.com/happyfish100/fastdfs-nginx-module.git --depth 1
cp /usr/local/src/fastdfs-nginx-module/src/mod_fastdfs.conf /etc/fdfs

설치nginx

wget http://nginx.org/download/nginx-1.12.2.tar.gz
tar -zxvf nginx-1.12.2.tar.gz
cd nginx-1.12.2/
# fastdfs-nginx-module 
./configure --add-module=/usr/local/src/fastdfs-nginx-module/src/
make && make install

독립 실행형 배포


tracker 구성

vim /etc/fdfs/tracker.conf
# 
port=22122  # tracker ( 22122, )
base_path=/data/tracker  #  
# 
/etc/init.d/fdfs_trackerd start # tracker 
chkconfig fdfs_trackerd on # tracker 

storage 구성

vim /etc/fdfs/storage.conf
# 
port=23000  # storage ( 23000, )
base_path=/data/storage  #  
store_path0=/data/storage  #  
tracker_server=192.168.0.xxx:22122  # tracker IP 
http.server_port=8888  # http ( 8888, , nginx )
# 
/etc/init.d/fdfs_storaged start # storage 
chkconfig fdfs_storaged on # storage 

client 테스트

vim /etc/fdfs/client.conf
# 
base_path=/data/tracker
tracker_server=192.168.1.xxx:22122    #tracker IP 
# , ID  eg:group1/M00/00/00/wKgAQ1pysxmAaqhAAA76tz-dVgg.tar.gz
fdfs_upload_file /etc/fdfs/client.conf /usr/local/src/nginx-1.12.2.tar.gz

nginx 접근 설정

vim /etc/fdfs/mod_fastdfs.conf
# 
tracker_server=192.168.0.xxx:22122
url_have_group_name=true
store_path0=/data/storage
# nginx.config
vi /usr/local/nginx/conf/nginx.conf
# 
server {
    listen       8888;    ##  storage.conf http.server_port 
    server_name  localhost;
    location ~/group[0-9]/ {
        ngx_fastdfs_module;
    }
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
    root   html;
    }
}
# , nginx , ID
http://192.168.0.xxx:8888/group1/M00/00/00/wKgAQ1pysxmAaqhAAA76tz-dVgg.tar.gz
# , , 。

fastdfs 소스 주소:
https://github.com/happyfish100/data/wiki
https://github.com/happyfish100/fastdfs
https://github.com/happyfish100/fastdfs-client-java
원본 주소:http://pnunu.cn/posts/20180720-fastfds-install

좋은 웹페이지 즐겨찾기