FastDFSインストールのチュートリアル(シングル・ヴァージョン)

必要fastdfs「に関する研究」を学ぶことは、言われていないものを、涙があり、2日間のセキュリティは、それを得るために、ここでは最終的に取り付けますと始める二つの大きな神の書物に描きます

インストール前の準備

(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 / localにアップロードされて入れて、あなたのすべて

(1)インストールlibfastcommon

libfastcommon-master.zip解凍

libfastcommonマスターCD

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 / localへ

タール-zxvf fastdfs-5.11.tar.gzの実装

CDのfastdfs-5.11

./make.sh

./make.shインストール

 

実行可能なコマンドを見ます

LS -laは/ usr / binに/ FDFS *

次に、継続

[ルート@ localhostのsbinの]#のCDの/ etc / FDFS /
#LL [ローカルホストFDFS @ルート]
-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

 

私たちは、文書をコピーするには、これらの3つの例を必要とする、試料を取り出します

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


保存して、トラッカーポートリスニング状況を見ます

[ルート@ localhostののfastdfs_tracker]#netstatの-unltp | grepのFDFSの
TCP 0 0 0.0.0.0:22122 0.0.0.0:*は7850をLISTEN / fdfs_trackerd
このポート22122は成功をリッスンします。

(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に変更します。

Vimの/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 / binに/ fdfs_monitorの/etc/fdfs/storage.conf
成功の後を見ることができます。 

 

= 192.168.150.132 IP_ADDR(localhost.localdomainを)  ACTIVE単語
 

 

おすすめ

転載: blog.csdn.net/lil_a/article/details/94720875