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 ...
随机推荐
- tab标签切换
<script>$(document).ready(function(){ $(".drtitle li").click(function(m){ $(this).ad ...
- BZOJ 1537 二维偏序
#include <iostream> #include <cstring> #include <cstdio> #include <algorithm> ...
- 继续向peersim的event-driven模式开火!(新手勿喷)
昨天学习了peersim的cycle模式,今天开始继续悟事件模式. 总的来说,我个人认为事件模式是周期模式的升级版,或者说,周期模式只是事件模式的一个子功能. 事件模式是基于时间和事件的(没打错),每 ...
- C#中隐藏(new)、方法重写(override)、重载(overload)的区别
转自:http://www.cnblogs.com/glife/archive/2009/12/28/1633947.html 重载.重写和隐藏的定义: 重载:public string ToStri ...
- android view:布局优化
今天在图书馆看了一个android性能优化. 关于布局优化有几个小技巧: 1.尽量减少布局的嵌套,而使用相对布局,这样的话会减少布局对象的创建,并且可以再事件传递的时候减少传递嵌套. 2.使用incl ...
- 黑苹果-IOS学习的开始
深知安装黑苹果的不易,在这里写一下关于我的Thinkpad E430c安装黑苹果教程(Mac版本:Yosemite 10.10.4),希望能够帮助有需要的朋友. 首先贴上我的电脑配置报表: ----- ...
- iOS的UIDevice,NSBundle,NSLocale
iOS的APP的应用开发的过程中,有时为了bug跟踪或者获取用反馈的需要自动收集用 户设备.系统信息.应用信息等等,这些信息方便开发者诊断问题,当然这些信息是用户的非隐私信息,是通过开发api可以获取 ...
- 解决getElementsByClassName的兼容性问题
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...
- xpath轴的正确使用姿势
网上看了许多关于轴的介绍,只介绍了语法,而没有明说具体实际中该怎么使用,百思不得其解. 背景--python中使用xpath: ----------------------------------- ...
- PARSEC-3.0编译错误
OS: Ubuntu 14.04 LTS (x86_64) ***error 1 OpenSSL 1.0.1e 与 perl5.18 不兼容 POD document had syntax error ...