FastDFS安装使用实战二(配置篇)

FastDFS安装使用实战二(配置篇)

Keywords:FastDFS、分布式文件系统、Ubuntu

Author:soartju

转载请注明出处:http://soartju.iteye.com/blog/803524

FastDFS的配置文件在%FastDFS%/conf目录下,其中包括 Client.conf    客户端上传配置文件 Storage.conf    文件存储服务器配置文件 Tracker.conf    负责均衡调度服务器配置文件 http.conf        http服务器配置文件
配置文件需要根据服务器环境的不同,进行不同的配置,具体可以参考FastDFS官方的安装配置文档http://code.google.com/p/fastdfs/wiki/Setup,以及FastDFS原理介绍文档http://code.google.com/p/fastdfs/wiki/Overview
在本例中,Tracker Server,Storage Server都安装在一台服务器上,IP:10.0.2.15

1、配置及启动Tracker Server

A、修改%FastDFS%/conf/tracker.conf文件,修改如下 #可以自己指定目录位置,但目录必须存在,用于存储日志及storage server等信息,否则tracker server无法启动

Txt代码

  1. base_path=/home/yuqing/fastdfs -> base_path=/home/soar/fastdfs_tracker
base_path=/home/yuqing/fastdfs -> base_path=/home/soar/fastdfs_tracker 

#改成你想要的http端口,将来http下载文件的端口就是他了

Txt代码

  1. http.server_port=8080 -> http.server_port=8090
http.server_port=8080 -> http.server_port=8090 

#http支持

Txt代码

  1. ##include http.conf -> #include http.conf
##include http.conf -> #include http.conf 

#默认4GB,如果空间不足,建议调小,否则会报no free space的异常,无法正常启动

Txt代码

  1. reserved_storage_space = 4GB -> reserved_storage_space = 1GB
reserved_storage_space = 4GB -> reserved_storage_space = 1GB  

#tracker server对storage server供服务的端口,使用默认的即可,也可以自定义

Txt代码

  1. port=22122
port=22122

B、将http.conf文件拷贝到/etc/fdfs目录下,执行

Shell代码

  1. sudo cp %FastDFS%/conf/http.conf /etc/fdfs/
sudo cp %FastDFS%/conf/http.conf /etc/fdfs/

注:为了支持http,必须将这个文件拷贝到此目录,否则无法启动,报param http.XXX not exist or is empty类似的错误

C、进入/usr/local/bin/目录,启动tracker服务器,执行

Shell代码

  1. sudo fdfs_trackerd %FastDFS%/conf/tracker.conf
sudo fdfs_trackerd %FastDFS%/conf/tracker.conf

D、进入/home/soar/fastdfs_tracker/logs/trackerd.log查看tracker的启动日志,如果看到类似

Shell代码

  1. [2010-11-04 16:21:25] INFO - FastDFS v2.02, base_path=/home/soar/fastdfs_tracker, connect_timeout=30s, network_timeout=60s, port=22122, bind_addr=, max_connections=256, work_threads=4, store_lookup=2, store_group=, store_server=0, store_path=0, reserved_storage_space=4MB, download_server=0, allow_ip_count=-1, sync_log_buff_interval=10s, check_active_interval=120s, thread_stack_size=64 KB, storage_ip_changed_auto_adjust=1, storage_sync_file_max_delay=86400s, storage_sync_file_max_time=300s
  2. [2010-11-04 16:21:25] INFO - HTTP supported: server_port=8090, default_content_type=application/octet-stream, anti_steal_token=0, token_ttl=0s, anti_steal_secret_key length=0, token_check_fail content_type=, token_check_fail buff length=0, check_active_interval=30, check_active_type=tcp, check_active_uri=/status.html
[2010-11-04 16:21:25] INFO - FastDFS v2.02, base_path=/home/soar/fastdfs_tracker, connect_timeout=30s, network_timeout=60s, port=22122, bind_addr=, max_connections=256, work_threads=4, store_lookup=2, store_group=, store_server=0, store_path=0, reserved_storage_space=4MB, download_server=0, allow_ip_count=-1, sync_log_buff_interval=10s, check_active_interval=120s, thread_stack_size=64 KB, storage_ip_changed_auto_adjust=1, storage_sync_file_max_delay=86400s, storage_sync_file_max_time=300s
[2010-11-04 16:21:25] INFO - HTTP supported: server_port=8090, default_content_type=application/octet-stream, anti_steal_token=0, token_ttl=0s, anti_steal_secret_key length=0, token_check_fail content_type=, token_check_fail buff length=0, check_active_interval=30, check_active_type=tcp, check_active_uri=/status.html

恭喜你,tracker server已经启动成功!

2、配置及启动Storage Server

A、修改%FastDFS%/conf/storage.conf文件,修改如下: #可以自定义,但必须存在此目录,用于存储storage相关的log、group内的相关信息

Txt代码

  1. base_path=/home/yuqing/fastdfs -> /home/soar/fastdfs_storge
base_path=/home/yuqing/fastdfs -> /home/soar/fastdfs_storge

#文件的存储位置,在一台storage server上可以指定多个存储位置

Txt代码

  1. store_path0=/home/yuqing/fastdfs -> store_path0=/home/soar/fastdfs_storge
store_path0=/home/yuqing/fastdfs -> store_path0=/home/soar/fastdfs_storge 

#必须指定

Txt代码

  1. group_name=group1
group_name=group1 

#修改成tracker server的IP和端口信息

Txt代码

  1. tracker_server=192.168.209.121:22122 -> tracker_server=10.0.2.15:22122
tracker_server=192.168.209.121:22122 -> tracker_server=10.0.2.15:22122

#http支持

Txt代码

  1. ##include http.conf ->#include http.conf
##include http.conf ->#include http.conf 

B、进入/usr/local/bin/目录,启动storage服务器,执行

Shell代码

  1. sudo fdfs_storaged %FastDFS%/conf/storage.conf
sudo fdfs_storaged %FastDFS%/conf/storage.conf

C、进入/home/soar/fastdfs_tracker/logs/storage.log查看storage服务器启动日志,如果看到类似

Shell代码

  1. [2010-11-04 16:37:16] INFO - FastDFS v2.02, base_path=/home/soar/fastdfs_storge, store_path_count=1, subdir_count_per_path=256, group_name=group1, connect_timeout=30s, network_timeout=60s, port=23000, bind_addr=, client_bind=1, max_connections=256, work_threads=4, disk_rw_separated=1, disk_reader_threads=1, disk_writer_threads=1, buff_size=256KB, heart_beat_interval=30s, stat_report_interval=60s, tracker_server_count=1, sync_wait_msec=200ms, sync_interval=0ms, sync_start_time=00:00, sync_end_time=23:59, write_mark_file_freq=500, allow_ip_count=-1, file_distribute_path_mode=0, file_distribute_rotate_count=100, fsync_after_written_bytes=0, sync_log_buff_interval=10s, sync_binlog_buff_interval=60s, sync_stat_file_interval=300s, thread_stack_size=512 KB, upload_priority=10, if_alias_prefix=, check_file_duplicate=0, FDHT group count=0, FDHT server count=0, FDHT key_namespace=, FDHT keep_alive=0, HTTP server port=8888, domain name=
  2. [2010-11-04 16:37:16] INFO - HTTP supported: server_port=8888, http_trunk_size=262144, default_content_type=application/octet-stream, anti_steal_token=0, token_ttl=0s, anti_steal_secret_key length=0, token_check_fail content_type=, token_check_fail buff length=0
  3. [2010-11-04 16:37:16] INFO - file: storage_param_getter.c, line: 48, storage_ip_changed_auto_adjust=1
  4. [2010-11-04 16:37:19] INFO - file: tracker_client_thread.c, line: 274, successfully connect to tracker server 10.0.2.15:22122, as a tracker client, my ip is 10.0.2.15
[2010-11-04 16:37:16] INFO - FastDFS v2.02, base_path=/home/soar/fastdfs_storge, store_path_count=1, subdir_count_per_path=256, group_name=group1, connect_timeout=30s, network_timeout=60s, port=23000, bind_addr=, client_bind=1, max_connections=256, work_threads=4, disk_rw_separated=1, disk_reader_threads=1, disk_writer_threads=1, buff_size=256KB, heart_beat_interval=30s, stat_report_interval=60s, tracker_server_count=1, sync_wait_msec=200ms, sync_interval=0ms, sync_start_time=00:00, sync_end_time=23:59, write_mark_file_freq=500, allow_ip_count=-1, file_distribute_path_mode=0, file_distribute_rotate_count=100, fsync_after_written_bytes=0, sync_log_buff_interval=10s, sync_binlog_buff_interval=60s, sync_stat_file_interval=300s, thread_stack_size=512 KB, upload_priority=10, if_alias_prefix=, check_file_duplicate=0, FDHT group count=0, FDHT server count=0, FDHT key_namespace=, FDHT keep_alive=0, HTTP server port=8888, domain name=
[2010-11-04 16:37:16] INFO - HTTP supported: server_port=8888, http_trunk_size=262144, default_content_type=application/octet-stream, anti_steal_token=0, token_ttl=0s, anti_steal_secret_key length=0, token_check_fail content_type=, token_check_fail buff length=0
[2010-11-04 16:37:16] INFO - file: storage_param_getter.c, line: 48, storage_ip_changed_auto_adjust=1
[2010-11-04 16:37:19] INFO - file: tracker_client_thread.c, line: 274, successfully connect to tracker server 10.0.2.15:22122, as a tracker client, my ip is 10.0.2.15

恭喜你,storage server已经启动成功!

时间: 2024-08-08 09:38:43

FastDFS安装使用实战二(配置篇)的相关文章

FastDFS安装使用实战三(使用篇)

经过前面的安装.配置.启动,马上就可以看到FastDFS的效果了,我们先上传一个文件,然后再通过http下载. 相关阅读: FastDFS安装使用实战一(安装篇) http://www.linuxidc.com/Linux/2012-01/52112.htm FastDFS安装使用实战二(配置篇) http://www.linuxidc.com/Linux/2012-01/52113.htm 一.上传文件 FastDFS安装包中,自带了客户端程序,通过程序可以进行文件上传.在使用这个客户端程序之

FastDFS安装使用实战一 (安装篇)

最近在研究负载均衡和集群,其中涉及到一个主要问题是,如何让集群中的real server共享一套文件系统.在网上查到FastDFS,国人(happy fish,感谢他的开源精神)开发的一套轻量级分布式文件系统.实际搭建了一下,感觉还不错,小巧易用,支持http下载. 虽然FastDFS官方网站 上已经有比较详细的按照使用手册,但在实际搭建过程中,还是遇到了很多问题,希望我的记录可以让后来的同学们少走一些弯路:) 下面进入正题. FastDFS安装使用实战(安装篇) Keywords:FastDF

网络设备-华三-防火墙F1020-IRF虚拟化实战终结配置篇

此篇h3c-IRF的实战配置,同样与前面华为的堆叠一样路子,我们先聊聊为啥要做这个?为什么不玩双机,要玩IRF.其实弄懂这一点,对于售前来讲,在外面做方案也是思路相当清晰的一点. 以前我们常规的双机方案如下图: 架构特点: 1.全网无单点故障,完整的解决因为单电源或者单一设备故障引起的业务不可用. 2.核心交换区-使用华为stack堆叠(前面有文章单独介绍) 3.防火墙HA(Juniper-NSRP协议,不懂度娘)(可能大家会问题,防火墙到华为交换机为什么没做lacp或者aggregate,大家

ELK Stack最新版本测试二配置篇

阅读本文前请浏览 ELK Stack最新版本测试一安装篇 http://jerrymin.blog.51cto.com/3002256/1720109 详细配置如下: 一,客户端 1,nginx日志格式 log_format logstash_json '{ "@timestamp": "$time_iso8601", '                         '"host": "$server_addr", '  

Windows Server 2012 R2工作文件夹之二配置篇

上一篇我们已经部署好了工作文件夹服务器,这一篇开始配置工作文件夹了. 选择文件和存储服务器,工作文件夹,点击任务下的新建同步共享 默认下一步 选择工作文件夹的存放本地路径 选择用户文件夹结构,一般建议用户别名就OK,对于大型企业,有多个域的话可以考虑用户别名@域模式 根据需求可以更改名称,我这里默认 点击"添加"按钮添加需要工作文件夹的用户,这里可以是组或成员 因为测试,我这里只输入了Lily这个账户 点击"下一步" 这里勾选加密工作文件夹和自动锁定屏幕复选框,点击

Windows Server 2012 DHCP高可用之二配置篇

在安装完DHCP角色后,我们需要在服务器管理器中进行部署后的配置,可以看到,这面小旗有个感叹好,点击小旗按钮 可以看到我们需要对部署后配置进行设定,点击DHCP01服务器下的"完成DHCP配置 接着进进入到DHCP安装后的配置向导中,点击"下一步" 在这里需要指定用于在AD DS中授权此DHCP服务器的凭据,默认一般都是我们的管理员Administrator账号,我们也可以指定一个拥有相同权限的账号,点击"提交"继续 我们可以看到,提交过程中完成了安全组的

MyBatis框架中Mapper映射配置的使用及原理解析(二) 配置篇 SqlSessionFactoryBuilder,XMLConfigBuilder

在 <MyBatis框架中Mapper映射配置的使用及原理解析(一) 配置与使用> 的demo中看到了SessionFactory的创建过程: SqlSessionFactory sessionFactory = null; String resource = "mybatisConfig.xml"; try { sessionFactory = new SqlSessionFactoryBuilder().build(Resources .getResourceAsRea

跨林拓扑中部署 Exchange 2013 GAL同步之二配置篇

4.配置管理代理MA 4.1 创建MA 开始配置管理代理(后面简称MA),在操作界面中,定位到Management Agents选项卡,点击"Create",开始创建ROBIN域中的MA 在Management agent for中选择"Active Directory global address list(GAL)",并输入MA名称,点击"Next" 输入Forest Name,User Name,Password,以及Domain,这里需要

Centos6.5 -- fastdfs安装(虚拟机搭建集群)

一.操作系统概述 电脑型号     X64 兼容 台式电脑  (扫描时间:2016年11月14日) 操作系统     Windows 7 旗舰版 64位 SP1 ( DirectX 11 ) 处理器  英特尔 Core i7-6700K @ 4.00GHz 四核 主板      华硕 B150M-A/M.2 ( 英特尔 Skylake-S - 100 Series/C230 Series 芯片组 Family - A148 ) 内存      16 GB ( Avexir DDR4 2400MH