博客
关于我
fastdfs详细安装教程
阅读量:431 次
发布时间:2019-03-06

本文共 1775 字,大约阅读时间需要 5 分钟。

FastDFS 安装与配置指南

前言

近年来,我开始涉及到 FastDFS 的项目部署,为了确保项目顺利进行,我自己搭建了一套 FastDFS 服务器。通过这次实践,我总结了一套完整的安装流程,希望能为有类似需求的朋友提供一份清晰的参考。

前期准备

在正式开始安装之前,需要准备以下环境:

  • 操作系统:CentOS 7
  • 软件包:FastDFS_v5.05.tar.gz
  • 依赖库:libfastcommon

开始安装

安装 Tracker

  • 安装 GCC 环境
  • yum install gcc-c++
    1. 安装 Libevent
    2. yum -y install libevent
      1. 安装 Libfastcommon
      2. cd /usr/localtar -zxvf libfastcommonV1.0.7.tar.gzcd libfastcommon-1.0.7./make.sh./make.sh install

        安装完成后,如果遇到 perl 未找到 的错误,请执行以下命令:

        yum -y install perl unzip net-tools wget
        1. 配置 Libfastcommon/usr/lib64/libfastcommon.so 拷贝至 /usr/lib

        2. 安装 FastDFS

        3. tar -zxvf FastDFS_v5.05.tar.gzcd FastDFS./make.sh./make.sh install
          1. 配置 FastDFS将安装目录下的 conf 文件拷贝至 /etc/fdfs,包含以下文件:client.conf、http.conf、mime.conf、storage.conf、storage_ids.conf、tracker.conf。

          2. 创建 Tracker 配置文件

          3. cp tracker.conf.sample tracker.confvi tracker.conf

            修改 base_path 为:

            base_path=/home/FastDFS
            1. 启动 Tracker 服务
            2. /usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf restart
              1. 设置开机自动启动
              2. vim /etc/rc.d/rc.local

                在文件末尾添加以下内容:

                /usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf restart

                安装 Storage

              3. 配置 Storage
              4. cp storage.conf.sample storage.confvi storage.conf

                修改以下内容:

                group_name=group1base_path=/home/FastDFSstore_path0=/home/FastDFS/fdfs_storage

                如果有多个存储路径,可以添加更多 store_path

                1. 配置 Tracker 服务器地址
                2. tracker_server=192.168.20.1:22122

                  将地址替换为实际的服务器 IP 地址。

                  1. 启动 Storage 服务
                  2. /usr/bin/fdfs_storaged /etc/fdfs/storage.conf restart
                    1. 设置开机自动启动
                    2. vim /etc/rc.d/rc.local

                      在文件末尾添加以下内容:

                      /usr/bin/fds_storaged /etc/fdfs/storage.conf restart

                      上传测试

                    3. 配置 Client
                    4. vi /etc/fdfs/client.conf

                      修改以下内容:

                      base_path=/home/FastDFStracker_server=192.168.20.1:22122
                      1. 上传文件
                      2. /usr/bin/fdfs_test /etc/fdfs/client.conf upload /path/to/your/file

                        例如,上传 /home/图片/1.png 到 FastDFS:

                        /usr/bin/fdfs_test /etc/fdfs/client.conf upload /home/图片/1.png

                        通过以上步骤,您可以在 CentOS 7 环境下成功搭建并配置 FastDFS 服务器。安装完成后,请根据实际需求进行路径和配置文件的调整。

    转载地址:http://lquyz.baihongyu.com/

    你可能感兴趣的文章
    Python pip 国内镜像大全及使用办法
    查看>>
    Python输入输出练习,运算练习,turtle初步练习
    查看>>
    Python pip工具使用
    查看>>
    Python pip配置国内源
    查看>>
    Python Plotly 将轴数格式化为 %
    查看>>
    Redis 键值过期操作
    查看>>
    python predictabel_基于R语言PredictABEL包对Logistic回归模型外部验证
    查看>>
    Python psycopg2 超时
    查看>>
    Python Pyinstaller Matplotlibrary
    查看>>
    Python Pypi 修改 国内源(以豆瓣源为例)
    查看>>
    Python PyQt5 将不再显示此消息复选框添加到 QMessageBox
    查看>>
    Python PyQt5:如何使用 PyQt5 显示错误消息
    查看>>
    Python PYSFTP-以字符串/文本形式传递私钥,而不是传递文件路径
    查看>>
    Python pytest 面试题!
    查看>>
    Python pytz 时区函数返回一个相差 9 分钟的时区
    查看>>
    python rabbitmq实现简单/持久/广播/组播/topic/rpc消息异步发送可配置Django
    查看>>
    Python random和json模块
    查看>>
    Python random模块seed理解
    查看>>
    python range()函数
    查看>>
    Python rdflib可传递查询
    查看>>