nginx + FastDFS 파일 시스템 구축
8400 단어 파일 시스템FDFSNginx파일 시스템 - FDFS
yum -y groupinstall 'Development Tools'
yum -y install wget
2. libfastcommon 설치 다운로드
git clone https://github.com/happyfish100/libfastcommon.git
cd libfastcommon/
./make.sh
./make.sh install
3. 설치 fastdfs 다운로드
https://github.com/happyfish100/fastdfs/archive/V5.05.tar.gz
tar -zxvf V5.05.tar.gz
cd fastdfs-5.05/
./make.sh
./make.sh install
4. 프로필 수정
-data
-fdfs
-tracker
-storage
-client
5. 트 래커 설정
cd /etc/fdfs
mv tracker.conf.sample tracker.conf
vi tracker.conf
//...
base_path=/data/fdfs/tracker
//...
스토리 지 설정
cd /etc/fdfs
mv storage.conf.sample storage.conf
vi storage.conf
//...
base_path=/data/fdfs/storage #
store_path0=/data/fdfs/storage #
tracker_server=192.168.153.130:22122 # tracker
//...
클 라 이언 트 설정
cd /etc/fdfs
mv client.conf.sample client.conf
vi client.conf
//...
base_path=/data/fdfs/client
tracker_server=192.168.153.130:22122
//...
6. tracker 와 storage 시작
/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf
/usr/bin/fdfs_storaged /etc/fdfs/storage.conf
7. 테스트
#
/usr/bin/fdfs_test /etc/fdfs/client.conf upload /home/lily/a.txt
#
/usr/bin/fdfs_download_file /etc/fdfs/client.conf group1/M00/00/00/wKiZglauvkmANC2wAAAAPpWmuhI171.txt
#
/usr/bin/fdfs_delete_file /etc/fdfs/client.conf group1/M00/00/00/wKiZglauvkmANC2wAAAAPpWmuhI171.txt
Nginx + fastdfs - nginx - module 설치 1. nginx 와 fastdfs - nginx - module 의 설치 패 키 지 를 다운로드 합 니 다.
tar -zxvf nginx-1.10.1.tar.gz
cd nginx-1.10.1
./configure --prefix=/usr/local/nginx (--prefix )
make
make install
2. nginx 설치 후 nginx 설정
cd /usr/local/nginx/conf
vi nginx.conf //
3. server 노드 에 아래 설정 추가
location /group1/M00{
root /data/fdfs/storage/data; //
ngx_fastdfs_module;
}
4. nginx 플러그 인 fastdfs - nginx - module 설치 및 설정
tar -zxvf fastdfs-nginx-module_v1.16.tar.gz
cd fastdfs-nginx-module/src/
vi config (
CORE_INCS="$CORE_INCS /usr/local/include/fastdfs /usr/local/include/fastcommon/"
CORE_LIBS="$CORE_LIBS -L/usr/lib -lfastcommon -lfdfsclient")// ,
5. 다음 에 플러그 인 을 nginx 에 추가 해 야 합 니 다.
cd /root/nginx-1.10.1/
./configure --add-module=/root/fastdfs-nginx-module/src/ // nginx
make
make install
6. fastdfs - nginx - module 설정 파일 복사 및 수정
cp /root/fastdfs-nginx-module/src/mod_fastdfs.conf /etc/fdfs
vim 수정 / etc / fdfs / modfastdfs. conf 저장 종료 수정 사항 은 다음 과 같 습 니 다.
tracker_server=192.168.1.188:22122 store_path0=/data/fastdfs/storage base_path=/data/fastdfs/storage/data url_have_group_name = true (여러 트랙 터 를 설정 할 때 이 항목 을 true 로 설정 해 야 합 니 다)
소프트 연결 만 들 기 (프로필 에 storage 가 데 이 터 를 저장 하 는 경로 설정)
ln -s /data/fastdfs/storage/data /data/fastdfs/storage/data/M00
FastDFSv 4.06 설정 디 렉 터 리 에 있 는 2 개의 파일 을 / etc / fdfs 디 렉 터 리 에 복사 합 니 다:
cp /usr/local/fastdfs-5.05/conf/http.conf . cp /usr/local/fastdfs-5.05/conf/mime.types .
마지막:
// nginx
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
// fdfs
/usr/bin/fdfs_trackerd /usr/soft/fastdfs-5.05/conf/tracker.conf start
/usr/bin/fdfs_storaged /usr/soft/fastdfs-5.05/conf/storage.conf start
테스트 업로드 다운로드
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Linux에서 하드 드라이브 파티션이나 파일 시스템의 UUID를 가져오는 7가지 방법Linux 시스템 관리자로서 파티션의 UUID나 파일 시스템의 UUID를 보는 방법을 알아야 합니다.현재 대부분의 Linux 시스템에서 UUID를 사용하여 파티션을 마운트하기 때문입니다.당신은 /etc/fstab 파...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.