介绍文档
 

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. ASP.NET 中HTML和Form辅助方法

    Form辅助方法 Form最重要的属性就是action和method,action指明form中的数据被提交到哪里,method指明用什么方法,默认为GET,下面是一个简单的例子: <form ...

  2. PHP 单引号 与双引号区别

    在PHP中,字符串的定义可以使用单引号,也可以使用双引号. PHP允许我们在双引号串中直接包含字串变量,双引号串中的变量将被解释而且替换,而单引号串中的内容总被认为是普通字符.例如: $foo = 2 ...

  3. 招聘信息:无线产品研发总监 60-100W

    招聘信息:某知名电商公司诚招: 无线产品研发总监 60-100W 招聘人数:1名 岗位描述: 熟悉互联网产品业务流程,完成产品功能的概念设计个原型展示: 进行市场调查和分析,相关用户研究和信息整理,提 ...

  4. Caliburn.Micro学习笔记目录——Zhouyongh

    解析Caliburn.Micro(一) 解析Caliburn.Micro(二) 解析Caliburn.Micro(三) 解析Caliburn.Micro(四) Illusion = Caliburn. ...

  5. jquery判断div是否隐藏实例

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  6. Xor && 线性基练习

    #include <cstdio> #include <cstring> ; ; int cnt,Ans,b,x,n; inline int Max(int x,int y) ...

  7. 初学SQL常用到的一些指令

    一.库 查看有哪些库:show databases; 进入某个库:use 库名; 新增库:create database atm; (atm为库名) 删除库:drop database if exis ...

  8. Python Django 数据库操作

    1. 建立app 在自己的工程项目目录下输入: python manage.py startapp myapp(你想建立的app名称) 建立一个叫myapp的app 这样,在你的工程项目目录下会出现一 ...

  9. 用手机自带uc浏览器查看静态页面,css样式不显示

    问题描述: 这个问题是一个同事在写手机页面用UC浏览器测试以后遇到的,其他浏览器静态页面显示正常,唯独UC浏览器不显示页面样式. 我测试过代码是没有问题的,因为临时没有找到安卓手机,就猜想PC端的应该 ...

  10. ssh整合--struts

    一 struts(jar+web.xml+struts.xml+Action) 1import min_jars-------struts-2.3.20.3-all(struts2-blank.war ...