Fastdfs HOWTO-File and directory structure

Source: Internet
Author: User
Tags server port
The FASTDFS server-side runtime directory structure is as follows:
${base_path}
|__data: Storing Data files
|__logs: Storing log files

Where ${base_path} is set by the parameter "Base_path" in the configuration file.

One, tracker server

Tracker Server directory and file structure:
${base_path}
|__data
| |__storage_groups.dat: Storing group information
| |__storage_servers.dat: Storage Server List
|__logs
|__trackerd.log:tracker Server log files

The records in the data file Storage_groups.dat and Storage_servers.dat are separated by newline characters (/n), and the fields are separated by a Latin comma (,).
The fields in Storage_groups.dat are:
1. Group_name: Group name
2. Storage_port:storage Server port number

Storage_servers.dat Records Storage server related information in the following fields:
1. Group_name: Group name
2. Ip_addr:ip Address
3. Status: State
4. SYNC_SRC_IP_ADDR: To synchronize the source server of an existing data file to the storage server
5. Sync_until_timestamp: The deadline for synchronizing existing data files (Unix timestamp)
6. Stat.total_upload_count: number of files uploaded
7. Stat.success_upload_count: Number of successful uploaded files
8. Stat.total_set_meta_count: Change meta data times
9. Stat.success_set_meta_count: Successful change of meta data times
Stat.total_delete_count: Number of deleted files
Stat.success_delete_count: Number of files deleted successfully
Stat.total_download_count: Download number of files
Stat.success_download_count: Number of successful downloads of files
Stat.total_get_meta_count: Get meta data times
Stat.success_get_meta_count: The number of meta data successfully obtained
Stat.last_source_update: Last Source Update time (update operation from client)
Stat.last_sync_update: Last Sync update time (update operation from other Storage server synchronization)

II. Storage Server

Storage Server directory and file structure:
${base_path}
|__data
| |__.data_init_flag: Current Storage server initialization information
| |__storage_stat.dat: Current Storage server Statistics
| |__sync: Storing data synchronization related files
|     | |__binlog.index: Current binlog (Update action Log) file index number
|     | |__binlog.###: Store update action record (log)
|     | |__${ip_addr}_${port}.mark: To store the completion of synchronization to the target server
| |
| |__ Directory: 256 directories containing data files with hexadecimal characters such as: 1F
| |__ Level Two directory: 256 directory containing data files, the directory name is hexadecimal characters, such as: 0A, CF
|__logs
|__storaged.log:storage Server log files

The. data_init_flag file format is the INI configuration file, with each parameter as follows:
# Storage_join_time: This storage server creation time
# Sync_old_done: This storage server has completed the synchronization flag (the source server synchronizes existing data to this server)
# Sync_src_server: To synchronize the existing data to the server IP address of the source server, no is null
# Sync_until_timestamp: Sync existing data file up time (Unix timestamp)

The Storage_stat.dat file format is the INI configuration file, with each parameter as follows:
# Total_upload_count: number of files uploaded
# Success_upload_count: Number of successful uploaded files
# Total_set_meta_count: Change meta data times
# Success_set_meta_count: Successfully changed meta data times
# Total_delete_count: Number of deleted files
# Success_delete_count: Number of files deleted successfully
# Total_download_count: Download number of files
# Success_download_count: Number of successfully downloaded files
# Total_get_meta_count: Get meta data times
# Success_get_meta_count: Successful acquisition of Meta data times
# last_source_update: Last Source Update time (update operation from client)
# last_sync_update: Last Sync update time (update operation from other storage server)

There is only one data item in the Binlog.index: The file index number of the current Binlog

binlog.###,## #为索引号对应的3位十进制字符, less than three digits, the front of 0. The index number is based on 0 and the maximum is 999. A binlog file has a maximum of 1GB. Records are separated by newline characters (/n), and fields are separated by a Latin space. The fields are:
1. Timestamp: Update occurrence time (Unix timestamp)
2. Op_type: Operation type, one character
3. FileName: The file name of the operation (update), including the relative path, such as: 5a/3d/fe_93_sjz7paaao_bxyd. S

${IP_ADDR}_${PORT}.MARK:IP_ADDR is the target server IP address for synchronization, port is the storage server port for this group. For example: 10.0.0.1_23000.mark. The file format is the INI configuration file, with each parameter as follows:
# Binlog_index: The Binlog index number that has been processed (synchronized)
# Binlog_offset: Processed (synchronized) to Binlog file offset (in bytes)
# Need_sync_old: Sync Existing Data file tags, 0 means no data files need to sync
# Sync_old_done: Sync existing data file to complete tag, 0 indicates incomplete, 1 indicates completed
# Until_timestamp: Sync existing data up to time Point (Unix timestamp)
# Scan_row_count: Number of Binlog Records scanned
# Sync_row_count: Number of synchronized Binlog records

The data file name is automatically generated by the system, including three parts: the current time (the Unix timestamp), the file size (in bytes), and the random number. File name length is 16 bytes. Files are distributed in a PJW hash algorithm hash to 65536 (256*256) directories.

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.