8000 GitHub - AlexYinHan/mdfs: A distributed file system built with microservices
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

AlexYinHan/mdfs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mdfs

A distributed file system built with microservices

实现的功能

使用Spring Boot和Spring Cloud Eureka实现了一个基于微服务架构的分布式文件系统,通过与name node结点通信实现文件的上传、下载和删除功能。
实现了弹性扩展,并且使用一致性hash策略实现负载均衡,在增加或删除数据结点时会动态进行数据迁移。

接口说明

name node结点提供如下形式的接口:

使用说明

Name Node

启动name node:

$ cd namenode
$ mvn spring-boot:run

name node的配置文件为application.yml,部分参数如下

block:
  default-size: 40000
  default-replicas: 2
load-balancer:
  num-visual-node: 31
test-mode: true

其中,test-mode设为true时,会在namenode端输出更多调试信息。

Data Node

启动data node(最好不少于两个,以存放数据副本):

$ cd datanode
$ mvn spring-boot:run -Dserver.port=8081
$ mvn spring-boot:run -Dserver.port=8082
$ mvn spring-boot:run -Dserver.port=8083

运行截图

上传若干个文件后:

所有文件

文件块的分布:

blocks

增加一个结点(8084端口):

blocks2

删除一个结点(8082端口):

blocks3

About

A distributed file system built with microservices

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0