-
Notifications
You must be signed in to change notification settings - Fork 5
DFS
Bevis Pei edited this page Nov 6, 2017
·
1 revision
服务类型 | 端口 |
---|---|
服务器mserver | :9333 |
文件服务器地址 | :1104 |
- 文件上传
- 获取文件ID
- curl -X POST http://localhost:9333/dir/assign
- {"count":1,"fid":"3,01637037d6","url":"127.0.0.1:1104","publicUrl":"localhost:1104"}
- 上传文件并保存ID
- curl -X PUT -F file=@/home/chris/myphoto.jpg http://127.0.0.1:1104/3,01637037d6
- {"size": 43234}
- 文件删除
- curl -X DELETE http://127.0.0.1:1104/3,01637037d6
- 获取文件ID
- 文件访问
- 获取文件可用服务器
- curl http://localhost:9333/dir/lookup?volumeId=3
- {"locations":[{"publicUrl":"localhost:8080","url":"localhost:8080"}]}
- 选择结果中的一个服务器实现负载均衡
- 利用id访问文件服务器
- http://localhost:8080/3,01637037d6.jpg
- {"locations":[{"publicUrl":"localhost:8080","url":"localhost:8080"}]}
- 选择结果中的一个服务器实现负载均衡
- If you want to get a scaled version of an image, you can add some params:
- 获取文件可用服务器