fastdfs compile and install

Installation tracker (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 
  • Compile and install 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

In case of the above information, the installation was successful.

fastDFS command directory: / usr / bin

fastDFS profile directory: / etc / fdfs

  • Create a data directory fastdfs
  mkdir -pv /data/fastdfs/tracker
  • The modified tracker.conf base_path = / data / fastdfs / tracker, i.e. just configured data file directory
 cp etc/fdfs/tracker.conf.sample etc/fdfs/tracker.conf
 vi  etc/fdfs/tracker.conf
  • Start FASTDFS
  cd  /usr/bin
  fdfs_trackerd /etc/fdfs/tracker.conf restart
  • Verification, the default port is 22122
  [root@localhost bin]# netstat -antp|grep trackerd
  tcp        0      0 0.0.0.0:22122           0.0.0.0:*               LISTEN      31046/fdfs_trackerd 

storage installation (192.168.1.188,192.168.1.189)

storage installation and tracker similar installation, first compile and install fastdfs, and then modify the configuration file.

  • Create a profile
  cp etc/fdfs/storage.conf.sample etc/fdfs/storage.conf
  vi  etc/fdfs/storage.conf
  • The modification 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 地址和端口号
  • start up
 cd /usr/bin
  ./fdfs_storaged  /etc/fdfs/storage.conf restart

Nginx installed on the storage node, increase support http download

  • Compile and install nginx, download prce, zlib, fastdfs-nginx-module dependent on support, upload it to the storage usr / local / src directory. fastdfs-nginx-module is mainly used to solve the same set of files within the synchronization is not timely issues.

Modify fastdfs-nginx-module-1.20 / src / config file the entire file into the following

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
  • Copy fastdfs / conf / http.conf mime.types two files to the / etc / fdfs /

Guess you like

Origin blog.csdn.net/weixin_33860147/article/details/90779597