FASTDFS Installation Use Combat II (Configuration chapter)

Source: Internet
Author: User

FASTDFS Installation Use Combat II (Configuration chapter)

KEYWORDS:FASTDFS, Distributed File System, Ubuntu

Author:soartju

Reprint Please specify source: http://soartju.iteye.com/blog/803524

Fastdfs configuration file in%fastdfs%/conf directory, which includes client.conf client upload profile storage.conf file Storage Server Profile tracker.conf responsible for balancing dispatch server profile HTT p.conf HTTP Server configuration file
The configuration file needs to be configured differently depending on the server environment, refer to the FASTDFS official installation configuration document Http://code.google.com/p/fastdfs/wiki/Setup, and the Fastdfs principle document HTTP ://code.google.com/p/fastdfs/wiki/overview
In this example, Tracker server,storage server is installed on a single server, ip:10.0.2.15

1. Configure and start tracker Server

A, modify the%fastdfs%/conf/tracker.conf file, modify the following #可以自己指定目录位置, but the directory must exist for storing logs and storage server information, or tracker server cannot start

TXT code
    1. Base_path=/home/yuqing/fastdfs-Base_path=/home/soar/fastdfs_tracker

#改成你想要的http端口, the port of the future HTTP download file is him.

TXT code
    1. http.server_port=8080, http.server_port=8090

#http支持

TXT code
    1. # #include http.conf #include http.conf

#默认4GB, if the space is insufficient, it is recommended to small, otherwise it will be reported to no free space exception, unable to start normally

TXT code
    1. Reserved_storage_space = 4GB-Reserved_storage_space = 1GB
Reserved_storage_space = 4GB-Reserved_storage_space = 1GB  

#tracker server to the port that storage server serves, use the default, or you can customize

TXT code
    1. port=22122
port=22122

B. Copy the http.conf file to the/etc/fdfs directory and execute

Shell Code
    1. sudo cp%fastdfs%/conf/http.conf/etc/fdfs/
sudo cp%fastdfs%/conf/http.conf/etc/fdfs/

Note: In order to support HTTP, this file must be copied to this directory, otherwise it will not start, reported Param http.xxx not exist or is empty similar error

C, enter the/usr/local/bin/directory, start the tracker server, execute

Shell Code
    1. sudo fdfs_trackerd%fastdfs%/conf/tracker.conf
sudo fdfs_trackerd%fastdfs%/conf/tracker.conf

D, enter/home/soar/fastdfs_tracker/logs/trackerd.log to view tracker's boot log, if you see a similar

Shell Code
  1. [2010-11-04 16:21:25] Info-fastdfs v2. 02, Base_path=/home/soar/fastdfs_tracker, connect_timeout=30s, network_timeout=60s, port=< Span class= "number" >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

Congratulations, Tracker server has started successfully!

2. Configure and start storage Server

A, modify the%fastdfs%/conf/storage.conf file, modified as follows: #可以自定义, but must exist in this directory, to store storage related log, group information

TXT code
    1. Base_path=/home/yuqing/fastdfs-/home/soar/fastdfs_storge
Base_path=/home/yuqing/fastdfs-/home/soar/fastdfs_storge

#文件的存储位置, you can specify multiple storage locations on a single storage server

TXT code
    1. Store_path0=/home/yuqing/fastdfs-Store_path0=/home/soar/fastdfs_storge

#必须指定

TXT code
    1. Group_name=group1

IP and port information for #修改成tracker server

TXT code
    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 code
    1. # #include http.conf #include http.conf

B, enter the/usr/local/bin/directory, start the storage server, execute

Shell Code
    1. sudo fdfs_storaged%fastdfs%/conf/storage.conf
sudo fdfs_storaged%fastdfs%/conf/storage.conf

C, enter/home/soar/fastdfs_tracker/logs/storage.log view storage Server boot log, if you see a similar

Shell Code
  1. [2010-11-0416:37:[] Info-fastdfs v2.Base_path=/home/soar/fastdfs_storge, store_path_count=1, subdir_count_per_path=Group_name=group1, connect_timeout=30s, network_timeout=60s, port=23000, Bind_addr=, client_bind=1, max_connections=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=& nbsp
  2. [2010-11- :notoginseng:] 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- : Notoginseng:] info-file:storage_param_getter.c, line: 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, Domai n 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.1 5

Congratulations, Storage server has started successfully!

FASTDFS Installation Use Combat II (Configuration chapter)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.