FastDFS 설치 튜토리얼 (싱글 버전)

필요 fastdfs "에 대한 연구를"학습 말했다되지 무엇을, 눈물이, 이틀 동안 보안이 그걸 얻기 위해, 여기에 궁극적으로 연결하고 시작하는 두 개의 큰 하나님의 글에 그립니다

설치 전 준비

(1) 환경 CentOS7 먼저 필요한 모든 도구를 다운로드

yum -y install zlib zlib-devel pcre pcre-devel gcc gcc-c++ openssl openssl-devel libevent libevent-devel perl unzip net-tools wget

(2) 모든 도구는 스크린 샷을 구축

링크 : HTTPS : //pan.baidu.com/s/1t-ZwmqtanT4Q4LHrQaQzhA 추출 코드 : o7xv 

(3) 좋은 추적기 및 저장 폴더를 생성

mkdir -p /home/mm/fastdfs/tracker
mkdir -p /home/mm/fastdfs/storage

설치를 시작

나는 모든 파일은 /는 / usr 지역을 다시 업로드됩니다 넣어, 당신의 모든

(1) 설치 libfastcommon

libfastcommon-master.zip 압축을 풉니 다

CD를 libfastcommon 마스터

make.sh 컴파일

설치는 설치 make.sh

 

소프트 링크를 수행

LN -s /usr/lib64/libfastcommon.so /usr/local/lib/libfastcommon.so
LN -s /usr/lib64/libfastcommon.so /usr/lib/libfastcommon.so
LN -s는 / usr / lib64에 / libfdfsclient. 그래서 /usr/local/lib/libfdfsclient.so
LN -s /usr/lib64/libfdfsclient.so /usr/lib/libfdfsclient.so


(2) 설치 FastDFS

위로 지역은 / usr /

타르 -zxvf의 구현 fastdfs-5.11.tar.gz

CD를 fastdfs - 5.11

./make.sh

./make.sh 설치

 

실행 명령을보기

LS -la는 / usr / 빈 / fdfs *

다음, 계속

[루트 @ localhost를 sbin 디렉토리] #에서 cd / 등은 / fdfs /
[루트 @ 로컬 호스트의 fdfs] # LL
-rw-R - r-- 사용. 1 개 루트 루트 1461 6月24 13시 19분 client.conf.sample
-rw-R - r-- 사용. 1 개 루트 루트 7927 6月24 13시 19분 storage.conf.sample
-rw-R - r-- 사용. 1 개 루트 루트 7389 6月24 13시 19분 tracker.conf.sample

 

우리는 샘플을 제거, 문서를 복사하려면 다음 세 가지 예를 필요

cp client.conf.sample client.conf
cp storage.conf.sample storage.conf
cp tracker.conf.sample tracker.conf

이 ~ FastDFS 설치의 끝. 

(3) 구성 서비스 추적기

편집 tracker.conf : VI tracker.conf, 관련 매개 변수를 수정

base_path=/home/mm/fastdfs/tracker  #tracker存储data和log的跟路径,必须提前创建好
http.server_port=80 #http端口,需要和nginx相同

다음과 같이 시작 추적기 명령입니다.

service fdfs_trackerd start

당신이 성공적으로 시작 할 수없는 경우, 당신은 systemctl를 통해 주문할 수 있습니다

systemctl start fdfs_trackerd

 

성공을 볼 수 있습니다 후

[root@localhost fdfs]# service fdfs_trackerd start
Starting fdfs_trackerd (via systemctl):                    [  OK  ]

 

그래서 우리는 항상 추적을 시작할 수 없습니다, 우리는 시작 추적기에 가입해야

우리는 첫째, 권한을 실행해야

chmod를 + X /etc/rc.d/rc.local에
다음 rc.local 파일을 수정하기 시작


VI에 /etc/rc.d/rc.local
프로필에 마지막 문장에서 마지막 증가

#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot.

touch /var/lock/subsys/local
service fdfs_trackerd start


저장하고 추적 포트를 듣고 상황을 볼

[루트 @ 로컬 호스트의 fastdfs_tracker] #에서 netstat -unltp | 그렙 FDFS의
TCP는 0 0.0.0.0:22122 0.0.0.0:* 0 7850 / fdfs_trackerd을 LISTEN
이 포트 22,122 성공을 수신합니다.

(4) 구성 저장소 서비스

VI /etc/fdfs/storage.conf, 관련 매개 변수를 수정 :

base_path=/home/mm/fastdfs/storage   #storage存储data和log的跟路径,必须提前创建好
store_path0=/home/mm/fastdfs/storage  #如果为空,则使用base_path
tracker_server=192.168.1.134:22122 #配置该storage监听的tracker的ip和port

저장 한 후 부드러운 참조 만들기

ln -s /usr/bin/fdfs_storaged /usr/local/bin

저장을 시작합니다

service fdfs_storaged start


명령이 시작 할 수없는 경우 마찬가지로, 다음으로 표현 될 수있다

systemctl start fdfs_storaged


다음과 같이 성공해야한다

[root@localhost fdfs]# service fdfs_stroaged start
Starting fdfs_storaged (via systemctl):                    [  OK  ]

또한 부팅 설정

rc.local에 수정

정력에 /etc/rc.d/rc.local

#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot.

touch /var/lock/subsys/local
service fdfs_trackerd start
service fdfs_storaged start


서비스가 시작될 경우 참조

[root@localhost 00]# netstat -unltp | grep fdfs
tcp        0      0 0.0.0.0:22122           0.0.0.0:*               LISTEN      7850/fdfs_trackerd  
tcp        0      0 0.0.0.0:23000           0.0.0.0:*               LISTEN      8077/fdfs_storaged


서비스 시작이 fastdfs이 완료되었습니다! 마지막으로, 우리는 다시 저장 갈 추적기에 등록, 확인합니다. 

는 / usr / 빈 / fdfs_monitor의 /etc/fdfs/storage.conf
성공 후에는 볼 수 있습니다 : 

 

= 192.168.150.132 IP_ADDR (localhost.localdomain)  활성 단어
 

 

추천

출처blog.csdn.net/lil_a/article/details/94720875