fastdfs 安装配置

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 安装配置的更多相关文章
- fastDFS 安装 配置 使用
fastDFS 安装 配置 使用 关于安装 本文采用的是源码的安装方式,其他安装方式请自行百度 简单介绍 1.背景 FastDFS是一款开源的.分布式文件系统(Distributed File Sys ...
- FastDFS安装配置
FastDFS FastDFS为互联网量身定制,充分考虑了冗余备份.负载均衡.线性扩容等机制,并注重高可用.高性能等指标,使用FastDFS很容易搭建一套高性能的文件服务器集群提供文件上传.下载等服务 ...
- FastDFS安装配置手册
文件服务器分布式系统安装手册 本文档详细的介绍了FastDFS的最小集群安装过程.集群环境如下: tracker:20.2.64.133 .用于调度工作,在访问上起负载均衡的作用. group1: s ...
- 潭州课堂25班:Ph201805201 django 项目 第三十八课 后台 文章发布,FastDFS安装 配置(课堂笔记)
, .安装FastDFS # 从docker hub中拉取fastdfs镜像docker pull youkou1/fastdfs # 查看镜像是否拉取成功docker images # 安装trac ...
- 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 ...
- centos 系统下安装FastDFS+nginx+fastdfs-nginx-module安装配置
前言: 以前的项目上传的文件都是保存到本地或者是局域网内的共享文件夹下,由于数据量,服务器的负载均衡(分机的某些图片无法访问的问题处理)等因素的情况下,就想到用fastdfs来文件管理,花了几天时间硬 ...
- 分布式文件系统 FastDFS 5.0.5 & Linux CentOS 7 安装配置(单点安装)——第一篇
分布式文件系统 FastDFS 5.0.5 & Linux CentOS 7 安装配置(单点安装)--第一篇 简介 首先简单了解一下基础概念,FastDFS是一个开源的轻量级分布式文件系统,由 ...
- FastDFS 集群 安装 配置
这篇文章介绍如何搭建FastDFS 集群 FastDFS是一个开源的轻量级分布式文件系统,它对文件进行管理,功能包括:文件存储.文件同步.文件访问(文件上传.文件下载)等,解决了大容量存储和负载均衡的 ...
- FastDFS+Nginx安装配置
下载相关包: libevent-2.0.22-stable.tar.gz => https://github.com/libevent/libevent/releases/download/re ...
随机推荐
- Myeclipse闪退故障
Myeclipse在编辑代码是出现反复一个异常错误. Index out of bounds,而且窗口关闭后还是出现, 于是在任务管理器里强制关闭MyEclipse. 关闭后启动MyEclipse总是 ...
- Uncaught ReferenceError: XXX is not defined
Uncaught ReferenceError: XXX is not defined 这个问题困扰我很久,虽然找到了解决方法,但是还不是很明白. 如下所示:是报错的代码. 如果把它改成下面的形式就可 ...
- 数据结构《20》----Immutable stack
有趣的函数式数据结构<一>----不可变栈 什么是不可变?往栈中插入一个元素,原来的栈保持不变,返回一个新的栈(已插入新的元素). push, pop,getMax 等操作都要求在 常数时 ...
- 阿里云弹性Web托管的URL重写问题
今天将ThinkPHP写的网站搭到阿里云的弹性Web托管服务器上,出现路由问题 诸如访问 www.xxx.com/home/index.html会发生错误如下 页面报错: No input file ...
- 【Python】将4*4数组旋转90度新数组
需求:将一个4*4的数组90度旋转生成新的4*4数组 原来的4*4数组:[0, 1, 2, 3][0, 1, 2, 3][0, 1, 2, 3][0, 1, 2, 3]90度旋转后的4*4数组:[0, ...
- 【LeetCode OJ】Construct Binary Tree from Preorder and Inorder Traversal
Problem Link: https://oj.leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-trave ...
- JMS总结
一 什么是JMS 1.JMS,Java Message Service,Java消息服务是一种可以实现异步通讯的消息中间件MOM(Message Oriented Middleware,面向消息的中间 ...
- Scrollview嵌套Listview运行后最先显示出来的位置不在顶部而是中间问题
问题: Scrollview里面嵌套了一个Listview ,通过设置一个方法设置了Listview的高度,现在的情况就是进到这个界面的时候看到的不是最上面 而是中间 解决办法: 设置ListView ...
- C# 属性控件的应用(备忘)
自己定义的控件属性:[Browsable(true),Bindable(true),Category("数据"),DefaultValue(""),Locali ...
- Log4j的简要概述
读取配置文件的三种使用方式: 1.Java代码:BasicConfigurator.configure() 2.Java特性:键值对解析(properties文件) PropertyConfigura ...