fastdfsコンパイルとインストール

インストールトラッカー(192.168.1.177)

  [root@localhost usr]# unzip libfastcommon-master.zip
  [root@localhost usr]# cd libfastcommon-master
  [root@localhost usr]# ./make.sh
  [root@localhost usr]# ./make.sh install
  [root@localhost usr]# yum install perl 
  • コンパイルとインストールfastdfs
 [root@localhost usr] # tar -zxvf fastdfs-5.08.tar.gz
  [root@localhost usr] # cd fastdfs-5.08
  [root@localhost fastdfs-5.08] # ./make.sh
  [root@localhost fastdfs-5.08] # ./make.sh  install
  [root@localhost fastdfs-5.08]# ./make.sh  install
  mkdir -p /usr/bin
  mkdir -p /etc/fdfs
  cp -f fdfs_trackerd /usr/bin
  if [ ! -f /etc/fdfs/tracker.conf.sample ]; then cp -f ../conf/tracker.conf /etc/fdfs/tracker.conf.sample; fi
  mkdir -p /usr/bin
  mkdir -p /etc/fdfs
  cp -f fdfs_storaged  /usr/bin
  if [ ! -f /etc/fdfs/storage.conf.sample ]; then cp -f ../conf/storage.conf /etc/fdfs/storage.conf.sample; fi
  mkdir -p /usr/bin
  mkdir -p /etc/fdfs
  mkdir -p /usr/lib64
  mkdir -p /usr/lib
  cp -f fdfs_monitor fdfs_test fdfs_test1 fdfs_crc32 fdfs_upload_file fdfs_download_file fdfs_delete_file fdfs_file_info fdfs_appender_test fdfs_appender_test1 fdfs_append_file fdfs_upload_appender /usr/bin
  if [ 0 -eq 1 ]; then cp -f libfdfsclient.a /usr/lib64; cp -f libfdfsclient.a /usr/lib/;fi
  if [ 1 -eq 1 ]; then cp -f libfdfsclient.so /usr/lib64; cp -f libfdfsclient.so /usr/lib/;fi
  mkdir -p /usr/include/fastdfs
  cp -f ../common/fdfs_define.h ../common/fdfs_global.h ../common/mime_file_parser.h ../common/fdfs_http_shared.h ../tracker/tracker_types.h ../tracker/tracker_proto.h ../tracker/fdfs_shared_func.h ../storage/trunk_mgr/trunk_shared.h tracker_client.h storage_client.h storage_client1.h client_func.h client_global.h fdfs_client.h /usr/include/fastdfs
  if [ ! -f /etc/fdfs/client.conf.sample ]; then cp -f ../conf/client.conf /etc/fdfs/client.conf.sample; fi

上記の情報の場合には、インストールは成功しました。

fastDFSコマンドディレクトリ:は/ usr / binに

fastDFSプロファイルディレクトリ:の/ etc / FDFS

  • データディレクトリを作成します。fastdfs
  mkdir -pv /data/fastdfs/tracker
  • 修飾tracker.confのBASE_PATH = /データ/ fastdfs /追跡、すなわちちょうど構成されたデータ・ファイル・ディレクトリ
 cp etc/fdfs/tracker.conf.sample etc/fdfs/tracker.conf
 vi  etc/fdfs/tracker.conf
  • スタートFASTDFS
  cd  /usr/bin
  fdfs_trackerd /etc/fdfs/tracker.conf restart
  • 検証、デフォルトのポートは22122です
  [root@localhost bin]# netstat -antp|grep trackerd
  tcp        0      0 0.0.0.0:22122           0.0.0.0:*               LISTEN      31046/fdfs_trackerd 

ストレージのインストール(192.168.1.188,192.168.1.189)

ストレージのインストールとトラッカー同様のインストール、最初のコンパイルとfastdfsをインストールし、設定ファイルを変更します。

  • プロフィールを作成
  cp etc/fdfs/storage.conf.sample etc/fdfs/storage.conf
  vi  etc/fdfs/storage.conf
  • 変更tracker.conf
  disabled=false #启用配置文件
  group_name=group1 #组名,根据实际情况修改
  port=23000 #设置 storage 的端口号
  base_path=/data/fastdfs/storage #设置 storage 的日志目录(需预先创建)
  store_path_count=1 #存储路径个数,需要和 store_path 个数匹配
  store_path0=/data/fastdfs/storage #存储路径
  tracker_server=192.168.1.177:22122 #tracker 服务器的 IP 地址和端口号
  • スタート
 cd /usr/bin
  ./fdfs_storaged  /etc/fdfs/storage.conf restart

nginxのは、サポートHTTPダウンロードを増やし、ストレージノードにインストールされています

  • コンパイルとnginxの、ダウンロードprce、zlibのサポートに依存fastdfs-nginxのモジュールをインストールし、ストレージUSR /ローカル/ srcディレクトリにアップロードします。fastdfs-nginxのモジュールは、主に、同期内のファイルの同じセットを解決するために使用されるタイムリーな問題ではありません。

fastdfs-nginxのモジュール-1.20を変更/ SRC / configには、次のようにファイル全体を提出

ngx_addon_name=ngx_http_fastdfs_module

if test -n "${ngx_module_link}"; then
ngx_module_incs="/usr/include/fastdfs /usr/include/fastcommon/"
else
CORE_INCS="$CORE_INCS /usr/include/fastdfs /usr/include/fastcommon/"
fi
  • コピーfastdfs / confに/のhttp.conf mime.typesの二つのファイルは/ etc / FDFSへ/

おすすめ

転載: blog.csdn.net/weixin_33860147/article/details/90779597