Giter VIP home page Giter VIP logo

fastdfs's Introduction

基于c++分布式文件传输系统

技术栈

  • C++
  • Nginx
  • MySQL
  • Redis
  • Fastcgi
  • FastDFS

目录结构

.
├── cloud-disk
│   ├── bin_cgi
│   │   ├── dealfile
│   │   ├── dealsharefile
│   │   ├── login
│   │   ├── md5
│   │   ├── myfiles
│   │   ├── register
│   │   ├── sharefiles
│   │   └── upload
│   ├── cloud_disk.sql
│   ├── common
│   │   ├── base64.c
│   │   ├── base64.o
│   │   ├── cfg.c
│   │   ├── cfg.o
│   │   ├── cJSON.c
│   │   ├── cJSON.o
│   │   ├── deal_mysql.c
│   │   ├── deal_mysql.o
│   │   ├── des.c
│   │   ├── des.o
│   │   ├── make_log.c
│   │   ├── make_log.o
│   │   ├── md5.c
│   │   ├── md5.o
│   │   ├── redis_op.c
│   │   ├── redis_op.o
│   │   ├── util_cgi.c
│   │   └── util_cgi.o
│   ├── conf
│   │   ├── cfg.json
│   │   ├── client.conf
│   │   ├── redis.conf
│   │   ├── redis.log
│   │   ├── storage.conf
│   │   └── tracker.conf
│   ├── fastdfs.sh
│   ├── fcgi.sh
│   ├── include
│   │   ├── base64.h
│   │   ├── cfg.h
│   │   ├── cJSON.h
│   │   ├── deal_mysql.h
│   │   ├── des.h
│   │   ├── make_log.h
│   │   ├── md5.h
│   │   ├── redis_keys.h
│   │   ├── redis_op.h
│   │   └── util_cgi.h
│   ├── logs
│   │   ├── cgi
│   │   │   ├── 2017
│   │   │   └── 2023
│   │   └── database
│   ├── Makefile
│   ├── nginx.conf
│   ├── nginx.sh
│   ├── README
│   ├── redis
│   │   ├── dump.rdb
│   │   └── redis.log
│   ├── redis.sh
│   ├── src_cgi
│   │   ├── dealfile_cgi.c
│   │   ├── dealfile_cgi.o
│   │   ├── dealsharefile_cgi.c
│   │   ├── dealsharefile_cgi.o
│   │   ├── login_cgi.c
│   │   ├── login_cgi.o
│   │   ├── md5_cgi.c
│   │   ├── md5_cgi.o
│   │   ├── myfiles_cgi.c
│   │   ├── myfiles_cgi.o
│   │   ├── reg_cgi.c
│   │   ├── reg_cgi.o
│   │   ├── sharefiles_cgi.c
│   │   ├── sharefiles_cgi.o
│   │   ├── upload_cgi.c
│   │   └── upload_cgi.o
│   ├── start.sh
│   └── test
│       ├── a.out
│       ├── echo.c
│       ├── fastcgi_demo.c
│       ├── fdfs_api.c
│       ├── fdfs_api.h
│       ├── fdfs_upload_file.c
│       ├── main.c
│       ├── myredis.c
│       └── redis_example.c
├── main.cpp
├── main.exe
└── README.md
  • bin:可执行文件
  • cloud_disk.sql:数据库表创建
  • common:封装的一些接口
  • conf:Redis、MySQL、fastcgi、fastdfs配置
  • src_cgi:cgi进程,每个文件代表一个处理进程
  • test:测试用例
  • .sh:各种软件的启动的脚本

整体流程

在这里插入图片描述

文件上传流程

在这里插入图片描述

文件下载流程

在这里插入图片描述

快速下载流程

  • 在数据库中存储,存储节点的IP+port。
  • 当文件下载的时候,只需要通过cgi进程查询数据库来获取ip+port
  • 客户端直接通过ip+port请求存储节点

注意:因为fastdfs不能直接解析http请求,所以需要先安装nginx-fastdfs插件,也就是先让nginx解析,在发送给fastdfs

在这里插入图片描述

fastdfs's People

Contributors

xiaodainiao avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.