1. 安装准备

    yum install \
    vim \
    git \
    gcc \
    gcc-c++ \
    wget \
    make \
    libtool \
    automake \
    autoconf \
    -y \
  2. 安装libfastcommon

    cd /root
    git clone https://github.com/happyfish100/libfastcommon.git
    cd libfastcommon/
    ./make.sh
    ./make.sh install
  3. 安装fastdfs

    cd /root
    wget https://github.com/happyfish100/fastdfs/archive/V5.10.tar.gz
    tar -zxvf V5.10.tar.gz
    cd fastdfs-5.10
    ./make.sh
    ./make.sh install
  4. 如果只想安装FastDFS php客户端,请直接向下,找到php安装FastDFS扩展
  5. 创建目录

    mkdir /data/
    mkdir /data/fdfs
    # 代码服务器执行
    mkdir /data/fdfs/client
    # 存储服务器执行
    mkdir /data/fdfs/storage
    # 跟踪服务器执行
    mkdir /data/fdfs/tracker
  6. 配置的建议

    1. 每一台client配置上所有tracker服务器地址
    2. 每一台storage配置上所有tracker服务器地址
    3. 每一个group至少有2个storage服务互为备份机
    4. group name建议从group0开始命名(兼容FastDHT)
  7. 配置client(在client服务器[代码服务器])

    cp /etc/fdfs/client.conf.sample /etc/fdfs/client.conf
    vim /etc/fdfs/client.conf base_path=/data/fdfs/client
    tracker_server=192.168.1.101:22122 #tracker服务器1 ip地址
    tracker_server=192.168.1.102:22122 #tracker服务器2 ip地址 ESC
    :wq
  8. 配置storage(在storage服务器)

    cp /etc/fdfs/storage.conf.sample /etc/fdfs/storage.conf
    vim /etc/fdfs/storage.conf group_name=group0
    base_path=/data/fdfs/storage
    #这样配置只有M00
    store_path0=/data/fdfs/storage
    #这样配置就有M01(一般用于磁盘挂载的情况)
    #store_path1=/mnt/fdfs/storage
    #设置storage最大连接数
    max_connections=1024
    #tracker服务器1 ip地址
    tracker_server=192.168.1.101:22122
    #只有一台tracker不要增加这条↓!!!!!!!!
    #tracker_server=192.168.1.102:22122 #tracker服务器2 ip地址 #以下配置安装FastDHT才配置!!!!!!!!
    #以下配置安装FastDHT才配置!!!!!!!!
    #以下配置安装FastDHT才配置!!!!!!!! check_file_duplicate=1
    key_namespace=FastDFS
    keep_alive=1
    #include /etc/fdht/fdht_servers.conf ESC
    :wq
  9. 配置tracker(在tracker服务器)

    cp /etc/fdfs/tracker.conf.sample /etc/fdfs/tracker.conf
    vim /etc/fdfs/tracker.conf bind_addr=192.168.1.101
    base_path=/data/fdfs/tracker
    # 0轮询 1指定组 2最大剩余空间
    store_lookup=2
    max_connections=1024
    # work_threads <= max_connections
    work_threads=16 ESC
    :wq
  10. 启动及测试【注意】

    # 如果storage.conf做了FastDHT配置,一定要先安装FastDHT
  11. 启动tracker和storage

    # 用来做tracker的服务器执行
    /usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf # 用来做storage的服务器执行
    /usr/bin/fdfs_storaged /etc/fdfs/storage.conf
  12. 启动与停止

    # 只能在对应服务器上进行对应操作!!!!!!!!
    # 只能在对应服务器上进行对应操作!!!!!!!!
    # 只能在对应服务器上进行对应操作!!!!!!!!
    # 启动
    /usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf
    /usr/bin/fdfs_storaged /etc/fdfs/storage.conf # 关闭
    /usr/bin/stop.sh /usr/bin/fdfs_trackerd
    /usr/bin/stop.sh /usr/bin/fdfs_storaged # 重启
    /usr/bin/restart.sh /usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf
    /usr/bin/restart.sh /usr/bin/fdfs_storaged /etc/fdfs/storage.conf # 查看集群storage分布(在storage服务器执行)
    /usr/bin/fdfs_monitor /etc/fdfs/storage.conf # 删除某个group中的一个storage(在storage服务器执行)
    /usr/local/bin/fdfs_monitor /etc/fdfs/storage.conf delete [group name] [ip address]
  13. 开机启动

    # 用来做tracker的服务器执行
    vim /etc/rc.local /usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf ESC
    :wq chmod +x /etc/rc.local # 用来做storage的服务器执行
    vim /etc/rc.local /usr/bin/fdfs_storaged /etc/fdfs/storage.conf ESC
    :wq chmod +x /etc/rc.local
  14. 可通过日志查看是否启动成功

    # 用来做storage的服务器执行
    cat /data/fdfs/storage/logs/storaged.log|grep ERROR
    cat /data/fdfs/storage/logs/storaged.log|grep WARNING # 用来做tracker的服务器执行
    cat /data/fdfs/tracker/logs/trackerd.log|grep ERROR
    cat /data/fdfs/tracker/logs/trackerd.log|grep WARNING # 在storage服务器创建软连接
    # 配置Nginx才添加!!!!!!!!
    # 配置Nginx才添加!!!!!!!!
    # 配置Nginx才添加!!!!!!!!
    mkdir /www/fastdfs/group0
    ln -s /data/fdfs/storage/data/ /www/fastdfs/group0/M00
  15. 防火墙相关配置

    yum install firewalld
    
    systemctl enable firewalld
    systemctl start firewalld firewall-cmd --zone=public --add-port=11411/tcp --permanent
    firewall-cmd --zone=public --add-port=22122/tcp --permanent
    firewall-cmd --zone=public --add-port=23000/tcp --permanent firewall-cmd --reload
  16. 测试功能是否正常

    mkdir /test
    cd /test
    vim test.txt
    This is a test file.
    ESC
    :wq
    #上传
    /usr/bin/fdfs_test /etc/fdfs/client.conf upload /test/test.txt #下载
    /usr/bin/fdfs_download_file /etc/fdfs/client.conf group0/M00/00/00/xxx.txt
    #查看下载文件
    ll /test
    #删除下载文件
    rm /xxx.txt #删除
    /usr/bin/fdfs_delete_file /etc/fdfs/client.conf group0/M00/00/00/xxx.cfg
  17. 为php安装fastdfs_client扩展

    cd /root/fastdfs-5.10/php_client
    phpize
    ./configure make
    make install cat /root/fastdfs-5.10/php_client/fastdfs_client.ini >> /usr/local/php/lib/php.ini
    kill -USR2 `cat /usr/local/php/var/run/php-fpm.pid`
  18. 为php安装fastcommon扩展

    cd /root/libfastcommon/php-fastcommon
    phpize
    ./configure make
    make install vim /usr/local/php/lib/php.ini extension=fastcommon.so ESC
    :wq kill -USR2 `cat /usr/local/php-7.1.4/var/run/php-fpm.pid`

CentOS7.X安装FastDFS-5.10的更多相关文章

  1. Centos7 上安装FastDFS

    Centos7 上安装 FastDFS 本文章摘抄于 风止鱼歇  博客地址:https://www.cnblogs.com/yufeng218/p/8111961.html 1.安装gcc(编译时需要 ...

  2. Linux CentOS7下安装Zookeeper-3.4.10服务(最新)

    Linux CentOS7下安装Zookeeper-3.4.10服务(最新) 2017年10月27日 01:25:26 极速-蜗牛 阅读数:1933   版权声明:本文为博主原创文章,未经博主允许不得 ...

  3. Centos7 上安装 FastDFS

    1.安装gcc(编译时需要) FastDFS是C语言开发,安装FastDFS需要先将官网下载的源码进行编译,编译依赖gcc环境,如果没有gcc环境,需要安装gcc yum install -y gcc ...

  4. centos7.x 安装 fastDFS

    环境准备 使用的系统软件 名称 说明 centos 7.x libfatscommon FastDFS分离出的一些公用函数包 FastDFS FastDFS本体 fastdfs-nginx-modul ...

  5. Centos7编译安装lnmp(nginx1.10 php7.0.2)

    我使用的是阿里云的服务器 Centos7 64位的版本 1. 连接服务器 这个是Xshell5的版本 安装好之后我们开始连接服务器 2. 安装nginx 首先安装nginx的依赖 yum instal ...

  6. CentOS7.0安装Nginx 1.10.0

    首先由于nginx的一些模块依赖一些lib库,所以在安装nginx之前,必须先安装这些lib库,这些依赖库主要有g++.gcc.openssl-devel.pcre-devel和zlib-devel ...

  7. CentOS7.2 安装RabbitMQ3.6.10

    CentOS上面使用yum安装比较方便 先记录一些rabbitmq的基本操作命令: $ sudo chkconfig rabbitmq-server on # 添加开机启动RabbitMQ服务 $ s ...

  8. Centos7下安装MongoDB4.0.10

    前言 模式自由 :可以把不同结构的文档存储在同一个数据库里 面向集合的存储:适合存储 JSON风格文件的形式 完整的索引支持:对任何属性可索引 复制和高可用性:支持服务器之间的数据复制,支持主-从模式 ...

  9. Linux centOS7 下安装mysql5.7.10

    1:下载二进制安装包 http://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.10-linux-glibc2.5-x86_64.tar.gz 2:解压到 ...

  10. centos7下安装docker(10容器底层--cgroup和namespace)

    cgroup和namespace是实现容器底层的重要技术 cgroup:实现资源限制 namespace:实现资源隔离 1.cgroup:control group Linux操作系统通过cgroup ...

随机推荐

  1. HDFS中NameNode发生故障没有备份从SecondNameNode恢复

    1.Secondary NameNode目录结构 Secondary NameNode用来监控HDFS状态的辅助后台程序,每隔一段时间获取HDFS元数据的快照. 在/opt/module/hadoop ...

  2. [BNDSOJ] #1106代码

    #include<bits/stdc++.h> using namespace std; ]; ][]; int n; bool check(int i,int j) { ]==]==]= ...

  3. 饿了吗开源组件库Element模拟购物车系统

    传统的用html+jquery来实现购物车系统要非常的复杂,但是购物车系统完全是一个数据驱动的系统,因此采用诸如Vue.js.angular.js这些框架要简单的多.饿了吗开源的组件库Element是 ...

  4. python学习第四十六天dir( )函数用法

    dir( )函数有点像目录的意思,但是他是包含由模块定义的名称的字符串的排序列表.这个列表包含模块中定义的所有模块,变量和函数的名称. 列举其用法 import time content = dir( ...

  5. LED音乐频谱之点阵

    转载请注明出处:http://blog.csdn.net/ruoyunliufeng/article/details/37967455 一.硬件 watermark/2/text/aHR0cDovL2 ...

  6. R语言常用数据管理

    1.变量的重命名 (1)交互式编辑器修改变量名 若要修改数据集x中的变量名,键入fix(x)即可打开交互式编辑器的界面.若数据集为矩阵或数据框,单击交互式编辑器界面中对应要修改的变量名,可手动输入新的 ...

  7. 《死磕 Elasticsearch 方法论》:普通程序员高效精进的 10 大狠招!(完整版)

    原文:<死磕 Elasticsearch 方法论>:普通程序员高效精进的 10 大狠招!(完整版) 版权声明:本文为博主原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链 ...

  8. 【问题解决方案】git clone失败的分析和解决

    参考链接 git_clone资源获取失败解决 使用Git clone代码失败的解决方法 [Git] Clone failed 克隆失败的解决方法 问题描述: 无论是git clone还是pull,均失 ...

  9. Webstorm上已有的本地项目上传到Github

    1.Webstorm左上角File —— Settings—— Github, Auth Type改成password,在Login和Password中输入自己的github账户和密码,点Test测试 ...

  10. ASE Beta Sprint - backend scrum 1

    本次scrum于2019.12.2与前端组和模型组一起在sky garden进行,持续50分钟. 参与人: Xin Kang, Zhikai Chen, Lihao Ran, Hao Wang 请假: ...