您当前的位置:首页 > 学海无涯 > 应用搭建网站首页应用搭建
GoFastDFS分布式存储使用指南
发布时间:2021-01-13作者:♂逸風★淩軒
私密存储:定义p为公共头,group开始于p1、p2......p(N),默认下载需要进行token校验
"host": "http://192.168.199.241:8070", "组号": "用于区别不同的集群(上传或下载)与support_group_manage配合使用,带在下载路径中", "group": "p1", "下载域名": "用于外网下载文件的域名,不包含http://", "download_domain": "file.52aiops.cn", "文件去重算法md5可能存在冲突,默认md5": "sha1|md5", "file_sum_arithmetic": "md5", "是否开启跨站访问": "默认开启", "enable_cross_origin": true, "下载是否需带token": "真假", "download_use_token": true, "下载token过期时间": "单位秒", "download_token_expire": 600, "是否开启Google认证,实现安全的上传、下载": "默认不开启", "enable_google_auth": false, "场景列表": "当设定后,用户指的场景必项在列表中,默认不做限制(注意:如果想开启场景认功能,格式如下:'场景名:googleauth_secret' 如 default:N7IET373HB2C5M6D ", "scenes": [], "默认场景": "默认default", "default_scene": "default", "认证url": "当url不为空时生效,注意:普通上传中使用http参数 auth_token 作为认证参数, 在断点续传中通过HTTP头Upload-Metadata中的auth_token作为认证参数,认证流程参考认证架构图", "auth_url": "", "下载是否认证": "默认不认证(注意此选项是在auth_url不为空的情况下生效)", "enable_download_auth": false, "默认是否下载": "默认下载", "default_download": true, "是否开启断点续传": "默认开启", "enable_tus": true, "同步单一文件超时时间(单位秒)": "默认为0,程序自动计算,在特殊情况下,自已设定", "sync_timeout": 0
参考Nginx配置:
upstream gofastdfs-g1 { server 192.168.199.241:8080; ip_hash; #notice:very important(注意) } upstream gofastdfs-p1 { server 192.168.199.241:8070; ip_hash; #notice:very important(注意) } server{ listen 80; server_name file.52aiops.cn; location / { rewrite ^(.*)$ https://file.52aiops.cn permanent; } } server{ listen 443 ssl; server_name file.52aiops.cn; ssl_certificate /web/certs/file.52aiops.cn/file.52aiops.cn.crt; ssl_certificate_key /web/certs/file.52aiops.cn/file.52aiops.cn.key; proxy_redirect ~/(\w+)/big/upload/(.*) /$1/big/upload/$2; if ( $request_uri ~ /g/g ) { # 注意group会随组的前缀改变而改变 rewrite ^/g/(.*)$ /$1 last; } if ( $request_uri ~ /p/p ) { # 注意group会随组的前缀改变而改变 rewrite ^/p/(.*)$ /$1 last; } location ~ /g/upload { #这是一个横向扩展配置,前期可能只有一个集群group1,当group1满后,只需将上传指向group2, #也就是将rewrite , proxy_pass 中的group1改为group2即可。 proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; rewrite ^/g/upload /g1/upload break; proxy_pass http://gofastdfs-g1; } location ~ /g/big/upload { #以上上类似。 proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; rewrite ^/g/upload /g1/big/upload break; proxy_pass http://gofastdfs-g1; } location ~ /g(\d) { #统一在url前增加godfs,以便统一出入口。 proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://gofastdfs-g$1; } location ~ /p/upload { #这是一个横向扩展配置,前期可能只有一个集群group1,当group1满后,只需将上传指向group2, #也就是将rewrite , proxy_pass 中的group1改为group2即可。 proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; rewrite ^/p/upload /p1/upload break; proxy_pass http://gofastdfs-p1; } location ~ /p/big/upload { #以上上类似。 proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; rewrite ^/p/upload /p1/big/upload break; proxy_pass http://gofastdfs-p1; } location ~ /p(\d) { #统一在url前增加godfs,以便统一出入口。 proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://gofastdfs-p$1; } }
关键字词:分布式存储,gofastdfs

相关文章
-
无相关信息