介绍文档
 

1.安装

# wget

# tar xf download

# cd FastDFS/

# ./make.sh 运行文件

有报错信息

compilation terminated.

make: *** [../common/fdfs_global.o] Error 1

2.查看官方文档,需要安装libfastcommon

#  wget https://github.com/happyfish100/libfastcommon/archive/master.zip

# unzip master.zip

# cd libfastcommon-master/

#  ./make.sh

# ./make.sh install

3.继续安装FastDFS

# cd FastDFS/

#  ./make.sh

# ./make.sh install

4.配置

# cd /etc/fdfs/

# cp tracker.conf.sample tracker.conf

修改配置文件

disabled=false        #启用配置文件

port=22122          #设置tracker的端口号

base_path=/data/fastdfs/trackerd  #设置tracker的数据文件和日志目录(需预先创建)

http.server_port=18080    #设置http端口号

5.启动

# mkdir -p /data/fastdfs/trackerd

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

设置开机启动

# echo '/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf restart' >> /etc/rc.d/rc.local

六、安装storage(两台都一样,本出给出一台配置)

1.安装 与tracker 安装步骤相同

2.配置

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=172.16.8.8:22122 #tracker服务器的IP地址和端口号

http.server_port=18888    #设置http端口号

3.启动

# mkdir -p /data/fastdfs/storage

# /usr/bin/fdfs_storaged /etc/fdfs/storage.conf restart

设置开机启动

# echo '/usr/bin/fdfs_storaged /etc/fdfs/storage.conf restart' >> /etc/rc.d/rc.local

4.查看状态

/usr/bin/fdfs_monitor /etc/fdfs/storage.conf

七、在storage安装nginx

在storage上安装nginx主要为了提高http的访问服务,同时解决group中的storage服务的同步延迟问题

1.nginx安装,在编译安装时添加 --add-module=/root/fastdfs-nginx-module/src/

2.配置

# wget

# tar xf download.1

3.解决报错

make的时候会报一下错误,

root/fastdfs-nginx-module/src//common.c:21:25: fatal error: fdfs_define.h: No such file or directory

#include "fdfs_define.h"

^

compilation terminated.

make[1]: *** [objs/addon/src/ngx_http_fastdfs_module.o] Error 1

解决办法:

vim /root/fastdfs-nginx-module/src/config

CORE_INCS="$CORE_INCS /usr/local/include/fastdfs /usr/local/include/fastcommon/"

CORE_LIBS="$CORE_LIBS -L/usr/lib -lfastcommon -lfdfsclient"

重新编译,安装即可

4.配置

# cp /root/fastdfs-nginx-module/src/mod_fastdfs.conf /etc/fdfs/.

# cp /root/FastDFS/conf/http.conf /etc/fdfs/.

/root/FastDFS/conf/mime.types /etc/fdfs/.

修改nginx的配置文件

server {

listen      18888;

server_name  localhost;

location  ~/group1/M00 {

root /fdfs/storage/data;

ngx_fastdfs_module;

}

error_page  500 502 503 504  /50x.html;

location = /50x.html {

root  /usr/share/nginx/html;

}

}

6.启动nginx

八、在tracker安装nginx

在tracker上安装的nginx主要为了提供http访问的反向代理、负载均衡已经缓存服务

1.安装配置与storage上相同

2.配置负载功能

upstream fdfs_group3 {

server 172.16.1.207:8080 weight=1 max_fails=2 fail_timeout=30s;

server 172.16.1.208:8080 weight=1 max_fails=2 fail_timeout=30s;

}

server {

#

设置服务器端口

listen      8080;

#

设置

group1

的负载均衡参数

location /group1/M00 {

proxy_next_upstream http_502 http_504 error timeout invalid_header;

proxy_cache http-cache;

proxy_cache_valid  200 304 12h;

proxy_cache_key $uri$is_args$args;

proxy_pass http://fdfs_group1;

expires 30d;

九。测试

cd /etc/fdfs/

cp client.conf.sample client.conf

base_path=/data/fdfs/tracker                    #

日志存放路径

tracker_server=172.16.8.8:22122          #tracker

服务器

IP

地址和端口号

http.tracker_server_port=8080              #tracker

服务器的

http

端口号

上传文件

/usr/bin/fdfs_upload_file /etc/fdfs/client.conf /root/install3.sh

group1/M00/00/00/rBAIClZB6ySAYFbtAAAGpOjLUVA6601.sh

日志报错

[2015-11-10 21:04:04] ERROR - file: ../common/fdfs_global.c, line: 52, the format of filename "group1/M00/00/00/rBAIClZB6ySAYFbtAAAGpOjLUVA6601.sh" is invalid

vi /etc/fdfs/mod_fastdfs.conf

url_have_group_name = true

再次测试上传

[root@vrvap2 fdfs]# /usr/bin/fdfs_upload_file /etc/fdfs/client.conf /root/new.jpg

group1/M00/00/00/rBAIClZB7fWAF2BmAADCkWSm8AA128.jpg

 

附件列表

fastdfs 安装配置的更多相关文章

  1. fastDFS 安装 配置 使用

    fastDFS 安装 配置 使用 关于安装 本文采用的是源码的安装方式,其他安装方式请自行百度 简单介绍 1.背景 FastDFS是一款开源的.分布式文件系统(Distributed File Sys ...

  2. FastDFS安装配置

    FastDFS FastDFS为互联网量身定制,充分考虑了冗余备份.负载均衡.线性扩容等机制,并注重高可用.高性能等指标,使用FastDFS很容易搭建一套高性能的文件服务器集群提供文件上传.下载等服务 ...

  3. FastDFS安装配置手册

    文件服务器分布式系统安装手册 本文档详细的介绍了FastDFS的最小集群安装过程.集群环境如下: tracker:20.2.64.133 .用于调度工作,在访问上起负载均衡的作用. group1: s ...

  4. 潭州课堂25班:Ph201805201 django 项目 第三十八课 后台 文章发布,FastDFS安装 配置(课堂笔记)

    , .安装FastDFS # 从docker hub中拉取fastdfs镜像docker pull youkou1/fastdfs # 查看镜像是否拉取成功docker images # 安装trac ...

  5. FastDFS安装配置过程中出现错误提示"/home/yuqing/fastdfs" can't be accessed, error info: No such file or directory

    解决: mkdir -p /home/yuqing/fastdfs 这回正常了,查看启动成功与否 [root@localhost FastDHT]# ps -ef |grep track |grep ...

  6. centos 系统下安装FastDFS+nginx+fastdfs-nginx-module安装配置

    前言: 以前的项目上传的文件都是保存到本地或者是局域网内的共享文件夹下,由于数据量,服务器的负载均衡(分机的某些图片无法访问的问题处理)等因素的情况下,就想到用fastdfs来文件管理,花了几天时间硬 ...

  7. 分布式文件系统 FastDFS 5.0.5 & Linux CentOS 7 安装配置(单点安装)——第一篇

    分布式文件系统 FastDFS 5.0.5 & Linux CentOS 7 安装配置(单点安装)--第一篇 简介 首先简单了解一下基础概念,FastDFS是一个开源的轻量级分布式文件系统,由 ...

  8. FastDFS 集群 安装 配置

    这篇文章介绍如何搭建FastDFS 集群 FastDFS是一个开源的轻量级分布式文件系统,它对文件进行管理,功能包括:文件存储.文件同步.文件访问(文件上传.文件下载)等,解决了大容量存储和负载均衡的 ...

  9. FastDFS+Nginx安装配置

    下载相关包: libevent-2.0.22-stable.tar.gz => https://github.com/libevent/libevent/releases/download/re ...

随机推荐

  1. 黑马程序员——【Java高新技术】——类加载器

    ---------- android培训.java培训.期待与您交流! ---------- 一.概述 (一)类加载器(class loader) 用来动态加载Java类的工具,它本身也是Java类. ...

  2. storm 源码笔记

    (reify DistributedRPC$Iface (^String execute  [this ^String function ^String args]  (log-debug " ...

  3. 【Python】列表各种操作

    # -*- coding:utf-8 -*- #列表操作name_list = ['zhangsan','lisi','wangwu'] #append 在最后插入name_list.append(& ...

  4. 多线程随笔知识点总结-NSThread4.1

    线程的状态 状态说明 a.新建 实例化线程对象 b.就绪 向线程对象发送start消息,线程对象被加入可调度线程池等待CPU调度;detach方法和performSelectorInBackGroun ...

  5. React Native 的绑定 this

    在React Native开发中,如果使用ES6语法的话,最好绑定this.但是使用ES5语法的话不需要绑定this.因为ES5会autobinding. this所指的就是直至包含this指针的上层 ...

  6. Protobuf - 使用scons编译proto文件

    使用protobuf过程中,需要先对消息结构进行定义,文件以.proto格式结尾.然后要使用google提供的protoc命令行,把.proto文件转成对应的代码文件. protoc --proto_ ...

  7. Java(三)

    任意整数求和: (1) import java.util.Scanner; public class sum { @SuppressWarnings("resource") pub ...

  8. Win10/UWP开发—凭据保险箱PasswordVault

    PasswordVault用户凭据保险箱其实并不算是Win10的新功能,早在Windows 8.0时代就已经存在了,本文仅仅是介绍在UWP应用中如何使用凭据保险箱进行安全存储和检索用户凭据. 那么什么 ...

  9. Isostorespy 数据库无法打开的解决方案

    重装Sql Server Compact http://download.microsoft.com/download/0/9/D/09D6ECB6-7F46-4B93-BB45-586A30A778 ...

  10. Hadoop是什么?一句话理解

    Hadoop(MapReduce&HDFS) 1.学习目的(前言) 在从业了六年IT生涯里,做个实施顾问.业务顾问.BA需求分析师.项目经理,现在重新定位自己,在新公司做起了开发顾问,虽然经历 ...