欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

FastDFS配置

程序员文章站 2022-07-02 17:46:25
...
原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。http://lxsym.blog.51cto.com/1364623/744899

FastDFS的配置文件在/usr/local/webserver/fastdfs/etc目录下,其中包括
 client.conf    客户端上传配置文件
 storage.conf    文件存储服务器配置文件
 tracker.conf    负责均衡调度服务器配置文件
 http.conf        http服务器配置文件
 
跟踪器tracker:192.168.0.6
存储节点Storage:192.168.0.5
 
一、配置及启动Tracker Server
1、修改tracker.conf文件,修改如下
base_path=/usr/local/webserver/fastdfs/    
http.server_port= 8090   # 指定端口   
#include http.conf       # HTTP支持
  
3、启动tracker服务器
/usr/local/webserver/fastdfs/bin/fdfs_trackerd /usr/local/webserver/fastdfs/etc/tracker.conf  
 
4、查看tracker的启动日志 
tailf /usr/local/webserver/fastdfs/logs/trackerd.log
[2011-12-09 10:34:44] INFO - FastDFS v3.02, base_path=/usr/local/webserver/fastdfs, run_by_group=, run_by_user=, 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=4096MB, 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, use_trunk_file=0, slot_min_size=256, slot_max_size=16 MB, trunk_file_size=64 MB
[2011-12-09 10:34:44] 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
[2011-12-09 10:34:44] ERROR - file: ../common/sockopt.c, line: 735, bind port 22122 failed, errno: 98, error info: Address already in use.
[2011-12-09 10:35:06] INFO - FastDFS v3.02, base_path=/usr/local/webserver/fastdfs, run_by_group=, run_by_user=, 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=4096MB, 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, use_trunk_file=0, slot_min_size=256, slot_max_size=16 MB, trunk_file_size=64 MB
[2011-12-09 10:35:06] 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启动成功。

二、配置及启动Storage Server
1、修改storage.conf文件,修改如下:
 #可以自定义,但必须存在此目录,用于存储storage相关的log、group内的相关信息
 group_name=lxsym         #自定义组
 base_path=/usr/local/webserver/fastdfs  #安装路径
 store_path0=/data/fastdfs   #数据存储路径(可以指定多个)
 tracker_server=192.168.0.6:22122   #跟踪器IP及端口
 http.server_port= 8090   # 指定端口
 #include http.conf       # HTTP支持
 
 2、启动storage服务器
 /usr/local/webserver/fastdfs/bin/fdfs_storaged /usr/local/webserver/fastdfs/etc/storage.conf
 
 3、查看storage服务器启动日志 
 tailf /usr/local/webserver/fastdfs/logs/storaged.log
[2011-12-18 18:13:28] INFO - FastDFS v3.02, base_path=/usr/local/webserver/fastdfs, store_path_count=1, subdir_count_per_path=256, group_name=group1, run_by_group=, run_by_user=, 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, disk_rw_direct=0, buff_size=256KB, heart_beat_interval=30s, stat_report_interval=60s, tracker_server_count=1, sync_wait_msec=50ms, 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=10s, 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=
[2011-12-18 18:13:28] 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
[2011-12-18 18:13:50] INFO - file: storage_param_getter.c, line: 97, storage_ip_changed_auto_adjust=1, store_path=0, reserved_storage_space=4096 MB, use_trunk_file=0, slot_min_size=0, slot_max_size=16 MB, trunk_file_size=64 MB
[2011-12-18 18:13:52] INFO - file: tracker_client_thread.c, line: 304, successfully connect to tracker server 192.168.0.6:22122, as a tracker client, my ip is 192.168.0.5
[2011-12-18 18:13:52] INFO - file: tracker_client_thread.c, line: 1100, tracker server 192.168.0.6:22122, set tracker leader: 192.168.0.6:22122
storage server启动成功。