FastDFS教程IV-文件服务器集群搭建
2017-12-13 22:54
543 查看
1.简介
本文主要介绍FastDFS文件服务器的集群搭建,在阅读本文之前,您需具备FastDFS文件服务器单节点安装,扩容,迁移等方面的知识。同时,您还需了解Keepalived,nginx方面的知识。阅读本文您可参考如下辅助文章:FastDFS文件服务器单节点安装:FastDFS教程Ⅰ-文件服务器安装与Nginx配置
FastDFS文件服务器扩容:FastDFS教程Ⅲ-文件服务器扩容
nginx和keepalived实现nginx高可用:nginx和keepalived实现虚拟ip配置
2.搭建环境
服务器1:ip 10.63.0.154,在上面安装FastDFS,nginx,keepalived服务器2:ip 10.63.0.155,在上面安装FastDFS,nginx,keepalived
本次采用两台服务器,都分别安装完整的单节点文件服务器。安装完成后,设置服务器1和服务器2上面的storage分别属于group1和group2。两个storage的tracker地址设置为两个,具体关系如下:
#user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; upstream fastdfs_tracker { server 10.63.0.154:8888 weight=1 max_fails=2 fail_timeout=30s; server 10.63.0.155:8888 weight=1 max_fails=2 fail_timeout=30s; } server { listen 8888; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location /fastdfs { root html; index index.html index.htm; proxy_pass http://fastdfs_tracker/; proxy_set_header Host $http_host; proxy_set_header Cookie $http_cookie; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; client_max_body_size 300m; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } }
View Code
在实际使用中,通常是把tracker服务和storage服务安装在不同的服务器上,参考CSDN一位大牛的明细设计方案如下:
设计介绍文档地址:手把手教你搭建FastDFS集群(下) ,该博主一共发布了上中下三篇文章,明确详细的介绍了文件服务器的搭建过程,经过测试可用,可谓是业界良心。在整个方案中,没有涉及到文件服务器迁移模块的知识,没有采用storage_ids.conf的id配置模式,不便迁移。
相关文章推荐
- fastdfs集群搭建
- Spark2.2.0分布式集群搭建教程
- Centos 7 搭建hadoop-2.6.0和spark1.6.0完全分布式集群教程 (最小化配置)
- mysql集群搭建教程-基础篇
- 入门级Hadoop集群搭建详细教程(七):SSH免密码登陆
- 全文搜索引擎 Elasticsearch 集群搭建入门教程
- springCloud系列教程01:Eureka 注册中心集群搭建
- Redis高可用集群-哨兵模式(Redis-Sentinel)搭建配置教程【Windows环境】
- 分布式文件存储 搭建FastDFS-5.0.5集群
- Redis 集群搭建和测试教程
- Redis集群搭建教程
- Ambari 与hdp 集群搭建教程
- Hadoop平台搭建使用系列教程(2)-预定义集群环境
- FastDFS教程Ⅰ-文件服务器安装与Nginx配置
- FastDFS集群环境搭建
- Hadoop cdh版本分布式集群搭建图文教程
- Kafka 教程(二) 集群搭建和容错性测试
- 大数据教程(一)—— Hadoop集群坏境搭建配置
- Redis中sentinel集群的搭建和Jedis测试 图文教程[二]
- fastDFS集群理解+搭建笔记