---
title: "【FastDFS专题】fastdfs使用实战（配置篇）"
author: "Josh_Persistence"
date: "2014-05-12T23:53:30Z"
tags: ["Storage", "tracker", "配置"]
categories: ["行业应用"]
slug: "fastdfs-fastdfs"
draft: false
lastmod: "2014-05-13T22:11:05Z"
id: 2065577
url: "https://josh-persistence.iteye.com/blog/2065577"
---

FastDFS的配置文件在/etc/fdfs或者是解压的FastDFS目录下，其中包括  
 client.conf    客户端上传配置文件  
 storage.conf    文件存储服务器配置文件  
 tracker.conf    负责均衡调度服务器配置文件  
 http.conf        http服务器配置文件

 

**跟踪器tracker：192.168.1.188**  
**存储节点Storage:192.168.1.179**  
 

预备工作：创建工作目录：fastdfs

cd /usr/local/ 

mkdir fastdfs

**一、配置及启动Tracker Server: 192.168.1.188**  
1、修改/etc/fdfs/tracker.conf文件,修改如下

base\_path=/usr/local/fastdfs   

http.server\_port= 8090   # 指定端口     
#include http.conf       # HTTP支持

 

2、启动tracker服务器

/usr/local/bin/fdfs\_trackerd /etc/fdfs/tracker.conf

 

3\. 判断是否启动成功：

netstat -anp |grep 22122

如果出现类似

tcp 0 0 0.0.0.0:22122  0.0.0.0:* LISTEN 13092/fdfs\_trackerd,

则表示启动成功，当然也可以通过查看log来判断是否启动成功：

tailf /usr/local/fastdfs/logs/trackerd.log

**查看traker.conf占用的端口号：cat tracker.conf | grep -i port**

 

**二、配置及启动Storage Server: 192.168.1.179**

1、修改storage.conf文件,修改如下：  
 #可以自定义，但必须存在此目录，用于存储storage相关的log、group内的相关信息  
 group\_name=wangsheng         #自定义组  
 base\_path=/home/josh/fastdfs    
 store\_path0=/home/josh/fastdfs   #数据存储路径(可以指定多个)  
 tracker\_server=**192.168.1.188**:22122   #跟踪器IP及端口  
 http.server\_port= 8090   # 指定端口  
 #include http.conf       # HTTP支持

 

2、启动storage服务器

/usr/local/bin/fdfs\_storaged /etc/fdfs/storage.conf

 

3\. 判断是否启动成功：

3.1 netstat -anp |grep 23000

3.2 或者查看日志：

tailf /usr/local/fastdfs/logs/storaged.log

3.3 如果成功，会在控制台上打印mkdir data Path: 00 - mkdir data Path:FF

data path:/home/josh/fastdfs/data, mkdir sub dir done