FastDFS集群-安装说明
一、简介

FastDFS服务端有两个角色:跟踪器(tracker)和存储节点(storage)。跟踪器主要做调度工作,在访问上起负载均衡的作用。

2.2、FastDFS系统结构图

说明
|
位置
|
所有安装包
|
/usr/local/src
|
数据存储位置
|
/home/dfs/
|

3.2、编译环境:
yum install git gcc gcc-c++ make automake autoconf libtool pcre pcre-devel zlib zlib-devel openssl-devel wget vim -y
4.1、修改tracker配置文件
vim /etc/fdfs/tracker.conf
# 修改的内容如下:
disabled=false # 启用配置文件
port=22122 # tracker服务器端口(默认22122)
base_path=/home/dfs # 存储日志和数据的根目录
store_lookup=0 # 轮询方式上传
4.2、启动tracker服务器
cp /usr/local/src/fastdfs/init.d/fdfs_storaged
chmod +x /etc/rc.d/init.d/fdfs_trackerd
/etc/init.d/fdfs_trackerd start
或者
systemctl start fdfs_trackerd
或者
fdfs_trackerd /etc/fdfs/tracker.conf start
初次启动,会在/data/fastdfs/tracker目录下生成logs、data两个目录。
drwxr-xr-x 2 root root 178 May 3 22:34 data
drwxr-xr-x 2 root root 26 May 2 18:57 logs
检查FastDFS Tracker Server是否启动成功:
ps aux | grep fdfs_trackerd
4.3、tracker server的关闭命令
/etc/init.d/fdfs_trackerd stop
或者
systemctl stop fdfs_trackerd
或者
fdfs_trackerd /etc/fdfs/tracker.conf stop
4.4、设置tracker server开机启动
chkconfig fdfs_trackerd on
配置文件准备:cp /etc/fdfs/storage.conf.sample /etc/fdfs/storage.conf
4.5、192.168.56.11、192.168.56.12修改storage配置文件
vim /etc/fdfs/storage.conf
# 修改的内容如下:
disabled=false # 启用配置文件
port=23000 # storage的端口号,同一个组的 storage 端口号必须相同
group_name=group1
base_path=/home/dfs # 存储日志和数据的根目录
store_path0=/home/dfs # 第一个存储目录
store_path_count=1 #存储路径个数,需要和store_path个数匹配
tracker_server=192.168.56.40:22122 # tracker服务器的IP地址和端口
tracker_server=192.168.56.45:22122 # 多个tracker直接添加多条配置
配置group_name
不同分组配置不同group_name,第一组为group1, 第二组为group2
4.6、192.168.56.13、192.168.56.14修改storage配置文件
vim /etc/fdfs/storage.conf
# 修改的内容如下:
disabled=false # 启用配置文件
port=23000 # storage的端口号,同一个组的 storage 端口号必须相同
group_name=group2
base_path=/home/dfs # 存储日志和数据的根目录
store_path0=/home/dfs # 第一个存储目录
store_path_count=1 #存储路径个数,需要和store_path个数匹配
tracker_server=192.168.56.40:22122 # tracker服务器的IP地址和端口
tracker_server=192.168.56.45:22122 # 多个tracker直接添加多条配置
4.7、启动storage服务器
/etc/init.d/fdfs_storaged start
或者
systemctl start fdfs_storaged
或者
fdfs_storaged /etc/fdfs/tracker.conf start
初次启动,会在/home/dfs目录下生成logs、data两个目录。
drwxr-xr-x 259 root root 8192 May 3 23:06 data
drwxr-xr-x 2 root root 26 May 2 19:12 logs
检查FastDFS Tracker Server是否启动成功:
ps aux | grep fdfs_storaged
所有 Storage 节点都启动之后,可以在任一 Storage 节点上使用如下命令查看集群信息:
/usr/bin/fdfs_monitor /etc/fdfs/storage.conf
部分截图信息




user nobody;
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 8888;
server_name localhost;
location ~/group[1-2]/M00
{
ngx_fastdfs_module;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html { root html;
}
}
}
user root;
worker_processes 1;
events {
worker_connections 1024;
use epoll;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
tcp_nopush on;
keepalive_timeout 65;
upstream fdfs_group1 {
server 192.168.56.11:8888 weight=1 max_fails=2 fail_timeout=30s;
server 192.168.56.12:8888 weight=1 max_fails=2 fail_timeout=30s;
}
upstream fdfs_group2 {
server 192.168.56.13:8888 weight=1 max_fails=2 fail_timeout=30s;
server 192.168.56.14:8888 weight=1 max_fails=2 fail_timeout=30s;
}
server {
listen 8000;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
#设置 group 的负载均衡参数
location /group1/M00 {
proxy_pass http://fdfs_group2;
}
location /group2/M00 {
proxy_pass http://fdfs_group2;
}
}
}
7.3、启动Nginx
user root;
worker_processes 1;
events {
worker_connections 1024;
use epoll;
}
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;
server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
client_max_body_size 300m;
proxy_redirect off;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 16k;
proxy_buffers 4 64k;
proxy_busy_buffers_size 128k;
proxy_temp_file_write_size 128k;
proxy_cache_path /tmp/cache/nginx/proxy_cache levels=1:2 keys_zone=http-cache:200m max_size=1g inactive=30d;
proxy_temp_path /tmp/cache/nginx/proxy_cache/tmp; upstream fdfs_group1 {
server 192.168.56.40:8000 weight=1 max_fails=2 fail_timeout=30s;
server 192.168.56.45:8000 weight=1 max_fails=2 fail_timeout=30s;
}
upstream fdfs_group2 {
server 192.168.56.40:8000 weight=1 max_fails=2 fail_timeout=30s;
server 192.168.56.45:8000 weight=1 max_fails=2 fail_timeout=30s;
}
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location /group1/M00 {
proxy_next_upstream http_502 http_504 error timeout invalid_header;
proxy_cache http-cache;
proxy_cache_valid 200 304 12h;
proxy_cache_key $uri$is_args$args;
proxy_pass http://fdfs_group1;
expires 30d;
}
location /group2/M00 {
proxy_next_upstream http_502 http_504 error timeout invalid_header;
proxy_cache http-cache;
proxy_cache_valid 200 304 12h;
proxy_cache_key $uri$is_args$args;
proxy_pass http://fdfs_group2;
expires 30d;
}
#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;
}
}
}


FastDFS集群-安装说明的更多相关文章
- FastDFS 集群 安装 配置
这篇文章介绍如何搭建FastDFS 集群 FastDFS是一个开源的轻量级分布式文件系统,它对文件进行管理,功能包括:文件存储.文件同步.文件访问(文件上传.文件下载)等,解决了大容量存储和负载均衡的 ...
- FastDFS集群安装
集群安装1.FastDFS安装 Tracker,nginx 192.168.56.113 192.168.56.114 storage group1 192.168.56.115 ...
- fastdfs集群安装过程_学习笔记
最终效果 初始化为6个节点 在/usr/local/software 目录下上传需要用到tar包,分别在各个节点上传 使用scp 将本地software目录复制到其他节点上 73.74为 tracke ...
- 集群 安装 配置FastDFS
FastDFS 集群 安装 配置 这篇文章介绍如何搭建FastDFS 集群 FastDFS是一个开源的轻量级分布式文件系统,它对文件进行管理,功能包括:文件存储.文件同步.文件访问(文件上传.文件下载 ...
- 一张图讲解最少机器搭建FastDFS高可用分布式集群安装说明
很幸运参与零售云快消平台的公有云搭建及孵化项目.零售云快消平台源于零售云家电3C平台私有项目,是与公司业务强耦合的.为了适用于全场景全品类平台,集团要求项目平台化,我们抢先并承担了此任务.并由我来主 ...
- Dubbo入门到精通学习笔记(十七):FastDFS集群的安装、FastDFS集群的配置
文章目录 FastDFS集群的安装 FastDFS 介绍(参考:http://www.oschina.net/p/fastdfs) FastDFS 上传文件交互过程: FastDFS 下载文件交互过程 ...
- Linux安装fastdfs集群部署
过程问题: make: gcc:命令未找到 解决: yum -y install gcc 一.环境和版本: Linux环境:CentOS 7.6 libfastcommon版本:1.0.39 Fast ...
- 19.fastDFS集群理解+搭建笔记
软件架构理解 1FastDFS介绍 1.1什么是FastDFS FastDFS是用c语言编写的一款开源的分布式文件系统.FastDFS为互联网量身定制,充分考虑了冗余备份.负载均衡.线性扩容等机制,并 ...
- FastDfs集群docker化部署
初识分布式文件系统FastDFS- 1.分布式与集群的区别 区别:集群是个物理形态,分布式是个工作方式.只要是一堆机器,就可以叫集群,他们是不是一起协作着干活,这个谁也不知道:一个程序或系统,只要运行 ...
随机推荐
- [Leetcode][动态规划] 零钱兑换
一.题目描述 给定不同面额的硬币 coins 和一个总金额 amount.编写一个函数来计算可以凑成总金额所需的最少的硬币个数.如果没有任何一种硬币组合能组成总金额,返回 -1. 示例 1: 输入: ...
- Redis数据库安装与配置调试
主要培养自我对Redis数据库安装能力, 并且进行个性化的数据库配置.掌握本实验的重点,即在于数据库的安装与启动参数的配置.同时,理解NOSQL数据库的体系结构. ①下载Redis安装包进行数据库平台 ...
- 基于 HTML5 和 WebGL 的地铁站 3D 可视化系统
前言 工业互联网,物联网,可视化等名词在我们现在信息化的大背景下已经是耳熟能详,日常生活的交通,出行,吃穿等可能都可以用信息化的方式来为我们表达,在传统的可视化监控领域,一般都是基于 Web SCAD ...
- 基 B/S 平台的机房监控云平台-U位篇
前言 机柜 U 位管理是一项突破性创新技术--继承了 RFID 标签(电子标签)的优点的同时,完全解决了 RFID 技术(非接触式的自动识别技术)在机房 U 位资产监控场应用景中的四大缺陷,采用工业互 ...
- 我的mongoDb之旅(一)
开发环境 php版本:7.0.10 mongodb版本:1.5 开发框架:tp5 数据库工具:navicat12formongodb 可以参考的外部文件链接 tp5中mongodb的扩展说明:http ...
- 图解Mongo Shell的使用
mongo shell是一个MongoDB的交互式JavaScript接口.您可以使用mongo shell来查询和更新数据以及执行管理操作. 本篇经验将和大家介绍Mongo Shell的使用方法,希 ...
- MySql自定义函数-关于保留小数位的特殊需求
背景 昨天,关于价格详情接口又来了一个小需求,而且有点特别.价格显示:改为保留两位小数,没错,就是保留两位小数.大家是不是想说这没啥特别的...数据库都有函数搞定了.例如四舍五入的ROUND(x,d) ...
- 【Java】获取当前操作系统桌面路径
//当前用户桌面 File desktopDir = FileSystemView.getFileSystemView() .getHomeDirectory(); String desktopPat ...
- 关于MySQL的经典例题50道
--1.学生表Student(S,Sname,Sage,Ssex) --S 学生编号,Sname 学生姓名,Sage 出生年月,Ssex 学生性别--2.课程表 Course(C,Cname,T) - ...
- A-01 最小二乘法
目录 最小二乘法 一.最小二乘法--代数法 二.最小二乘法--矩阵法 三.最小二乘法优缺点 3.1 优点 3.2 缺点 更新.更全的<机器学习>的更新网站,更有python.go.数据结构 ...