Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ddd #484

Open
wants to merge 97 commits into
base: multi_ipaddr
Choose a base branch
from
Open

ddd #484

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
e39e96e
fix: mac 下php_client编译出错的问题
retamia Apr 16, 2019
5eb02fd
correct spell for tracker
happyfish100 Oct 21, 2019
9d2db48
make.sh fix TARGET_PREFIX
happyfish100 Oct 21, 2019
77da832
compress and uncompress binlog file by gzip when need
happyfish100 Oct 23, 2019
461e78c
remove debug info
happyfish100 Oct 23, 2019
ecca017
small change for config files
happyfish100 Oct 24, 2019
6b1f5e0
bugfix: must check and create data path
happyfish100 Oct 25, 2019
1943f3d
upgrade version to V6.0.1
happyfish100 Oct 25, 2019
fc8c6f8
log more info when recv timeout
happyfish100 Oct 25, 2019
0ed1881
add Wechat public account description
happyfish100 Oct 26, 2019
9cb1182
correct Wechat public account
happyfish100 Oct 26, 2019
1a54686
client/test OK
happyfish100 Oct 29, 2019
ee48562
set delay_seconds to 0 when delay_seconds < 0
happyfish100 Nov 3, 2019
57d2d81
add README_zh.md
happyfish100 Nov 5, 2019
cdb180a
get_file_info calculate CRC32 for appender file type
happyfish100 Nov 6, 2019
9f0a914
recovery download file to local temp file then rename
happyfish100 Nov 8, 2019
9c0bbce
support regenerate filename for appender file
happyfish100 Nov 10, 2019
c36419d
php ext support regenerate filename for appender file
happyfish100 Nov 11, 2019
6fb8fe2
modify php test for regenerate_appender_filename
happyfish100 Nov 12, 2019
9bc762b
sync regenerated appender file
happyfish100 Nov 12, 2019
ec34a1f
fdfs_file_info.c change crc32 output format
happyfish100 Nov 13, 2019
6712843
upgrade version to V6.0.2
happyfish100 Nov 13, 2019
86cd69e
Update Dockerfile
SaintKayLuk Nov 13, 2019
52ac538
Update Dockerfile
SaintKayLuk Nov 13, 2019
21c52cf
dual IPs support two different types of inner (intranet) IPs
happyfish100 Nov 14, 2019
41855a4
get_ipaddr_by_peer_ip refined
happyfish100 Nov 14, 2019
afc4fa2
code stype little adjust
happyfish100 Nov 15, 2019
6ea2f5e
my_status change to my_result
happyfish100 Nov 15, 2019
22865e0
storage server request tracker server to change it's status
happyfish100 Nov 15, 2019
017fff4
set my_status in storage join response
happyfish100 Nov 15, 2019
9dc6742
bugfix: fdfs_monitor fix get index of the specified tracker server
happyfish100 Nov 16, 2019
cb24cd8
storage server write to data_init_flag and mark file safely
happyfish100 Nov 16, 2019
3b10452
add func fdfs_set_server_info_index1
happyfish100 Nov 16, 2019
1ac2ced
upgrade version to v6.03
happyfish100 Nov 16, 2019
af4f075
code refine: extent struct FDFSStorePathInfo
happyfish100 Nov 17, 2019
4ed56c5
check store path's mark file to prevent confusion
happyfish100 Nov 17, 2019
132dbc0
change comments in the config files
happyfish100 Nov 18, 2019
afff529
skip status FDFS_STORAGE_STATUS_DELETED
happyfish100 Nov 18, 2019
358fff4
new selected tracker leader do NOT notify self by network
happyfish100 Nov 18, 2019
e4c2644
change sleep seconds when ping tracker leader fail
happyfish100 Nov 19, 2019
5557429
log more info when ping tracker leader fail
happyfish100 Nov 19, 2019
0551999
storage.conf add parameter check_store_path_mark
happyfish100 Nov 19, 2019
5a6acbd
remove debug info
happyfish100 Nov 19, 2019
9a29048
larger network_timeout for fetching one-store-path binlog
happyfish100 Nov 20, 2019
add02e7
a little change
happyfish100 Nov 20, 2019
2f94d24
Merge pull request #348 from SaintKayLuk/master
happyfish100 Nov 21, 2019
7455191
Merge pull request #279 from retamia/master
happyfish100 Nov 21, 2019
aeb171d
change .gitignore
happyfish100 Nov 21, 2019
da7300b
change comment/information in config files and codes
happyfish100 Nov 22, 2019
ad22505
change sync_log_buff_interval from 10 to 1
happyfish100 Nov 22, 2019
949f53b
INSTALL changed and modify website name
happyfish100 Nov 23, 2019
80c9930
INSTALL file changed
happyfish100 Nov 23, 2019
df2fd20
storage_report_ip_changed ignore result EEXIST
happyfish100 Nov 27, 2019
634d85e
support compress error log and access log
happyfish100 Nov 30, 2019
46171f2
add parameter compress_error_log_days_before
happyfish100 Dec 1, 2019
33b539e
disk recovery support multi-threads to speed up
happyfish100 Dec 4, 2019
867dc29
use fdfs_get_ipaddr_by_peer_ip
happyfish100 Dec 4, 2019
edb3f6b
pthread_kill alive recovery threads
happyfish100 Dec 4, 2019
856ef15
fix recovery_get_global_full_filename
happyfish100 Dec 4, 2019
0104170
calc hash use src_filename when it not empty
happyfish100 Dec 4, 2019
22824e5
bugfix: init pReader->binlog_buff.version/length to 0
happyfish100 Dec 4, 2019
6bfb821
upgrade version to 6.04
happyfish100 Dec 5, 2019
a424a06
should use memset to init pReader
happyfish100 Dec 5, 2019
983a21b
remove recovery_init_flag_file_ex
happyfish100 Dec 5, 2019
e0d3d44
sigQuitHandler: tcp_set_try_again_when_interrupt to false
happyfish100 Dec 5, 2019
322ee15
beautify config files
happyfish100 Dec 6, 2019
24bb1e9
change config files
happyfish100 Dec 8, 2019
a49735a
fdfs_trackerd and fdfs_storaged print the server version in usage
happyfish100 Dec 13, 2019
cf0ec7e
trunk server support compress the trunk binlog periodically
happyfish100 Dec 14, 2019
cab3a90
compress the trunk binlog gracefully
happyfish100 Dec 15, 2019
fd87729
check trunk binlog version before compressing
happyfish100 Dec 15, 2019
2c5955c
trunk binlog compression support transaction
happyfish100 Dec 18, 2019
4a6f89c
support backup binlog file when truncate trunk binlog
happyfish100 Dec 19, 2019
13ba096
trunk_binlog_truncate delete trunk data file
happyfish100 Dec 20, 2019
f55d8fa
support alignment size for trunk space allocation
happyfish100 Dec 20, 2019
8d2a04e
remove debug log
happyfish100 Dec 20, 2019
513894c
support merge free trunk spaces
happyfish100 Dec 21, 2019
1e56afb
remove trunk_file_lock and use atomic add/sub
happyfish100 Dec 22, 2019
2ab095b
bugfixed: ++ppTrunkInfo again
happyfish100 Dec 22, 2019
49d51e9
fix previous value in trunk_save_merged_spaces
happyfish100 Dec 23, 2019
b7447e5
support delete unused trunk files
happyfish100 Dec 23, 2019
7185685
bugfixed: delete first merged trunk node
happyfish100 Dec 23, 2019
ef31a31
trunk file id printf format change from %d to %u
happyfish100 Dec 24, 2019
aefb461
refine logging delete unused trunk files
happyfish100 Dec 24, 2019
e6ec41b
static variable expect_header
happyfish100 Dec 24, 2019
a885fd2
set all space to ascii 0 when delete trunk file
happyfish100 Dec 25, 2019
8c5a6b6
fdfs_monitor.c: do NOT call getHostnameByIp
happyfish100 Dec 25, 2019
4be26a5
fdfs_monitor code refine
happyfish100 Dec 25, 2019
a277a08
add conditions to call storage_trunk_save
happyfish100 Dec 26, 2019
1090667
change init alloc size
happyfish100 Dec 26, 2019
9442384
log more info when send timeout
happyfish100 Dec 26, 2019
a9e593e
bugfixed: fdfs_storaged can't quit normally
happyfish100 Dec 26, 2019
28f9c41
memset return ip address to ascii 0 for Java SDK
happyfish100 Dec 30, 2019
fde1109
upgrade version to v6.06
happyfish100 Dec 30, 2019
4aff731
fix action fetch in argv
happyfish100 Aug 31, 2020
b5534f9
use libfastcommon V1.44
happyfish100 Sep 8, 2020
55b2eea
correct spell iovent to ioevent follows libfastcommon
happyfish100 Sep 30, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 106 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# Makefile.in
storage/Makefile
tracker/Makefile
client/test/Makefile
client/Makefile

# client/fdfs_link_library.sh.in
client/fdfs_link_library.sh

# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dSYM
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app
client/fdfs_append_file
client/fdfs_appender_test
client/fdfs_appender_test1
client/fdfs_crc32
client/fdfs_delete_file
client/fdfs_download_file
client/fdfs_file_info
client/fdfs_monitor
client/fdfs_test
client/fdfs_test1
client/fdfs_upload_appender
client/fdfs_upload_file
client/fdfs_regenerate_filename
client/test/fdfs_monitor
client/test/fdfs_test
client/test/fdfs_test1
storage/fdfs_storaged
tracker/fdfs_trackerd
test/combine_result
test/100M
test/10M
test/1M
test/200K
test/50K
test/5K
test/gen_files
test/test_delete
test/test_download
test/test_upload
test/upload/
test/download/
test/delete/

# other
php_client/.deps
php_client/.libs/

php_client/Makefile
php_client/Makefile.fragments
php_client/Makefile.global
php_client/Makefile.objects
php_client/acinclude.m4
php_client/aclocal.m4
php_client/autom4te.cache/
php_client/build/
php_client/config.guess
php_client/config.h
php_client/config.h.in
php_client/config.log
php_client/config.nice
php_client/config.status
php_client/config.sub
php_client/configure
php_client/configure.ac
php_client/install-sh
php_client/libtool
php_client/ltmain.sh
php_client/missing
php_client/mkinstalldirs
php_client/run-tests.php

# fastdfs runtime paths
data/
logs/
84 changes: 83 additions & 1 deletion HISTORY
Original file line number Diff line number Diff line change
@@ -1,7 +1,88 @@

Version 6.07 2020-09-30
* use libfastcommon V1.44
NOTE: you MUST upgrade libfastcommon to V1.44 or later
* correct spell iovent to ioevent follows libfastcommon

Version 6.06 2019-12-30
* bugfixed: fdfs_storaged can't quit normally
* bugfixed: init/memset return ip address to ascii 0 for Java SDK

Version 6.05 2019-12-25
* fdfs_trackerd and fdfs_storaged print the server version in usage.
you can execute fdfs_trackerd or fdfs_storaged without parameters
to show the server version

* trunk server support compress the trunk binlog periodically,
the config items in tracker.conf: trunk_compress_binlog_interval
and trunk_compress_binlog_time_base

* trunk binlog compression support transaction

* support backup binlog file when truncate trunk binlog,
the config item in tracker.conf: trunk_binlog_max_backups

* support alignment size for trunk space allocation
the config item in tracker.conf: trunk_alloc_alignment_size

* support merge free trunk spaces
the config item in tracker.conf: trunk_free_space_merge

* support delete unused trunk files
the config item in tracker.conf: delete_unused_trunk_files

* fdfs_monitor.c: do NOT call getHostnameByIp

NOTE: you MUST upgrade libfastcommon to V1.43 or later


Version 6.04 2019-12-05
* storage_report_ip_changed ignore result EEXIST
* use get_gzip_command_filename from libfastcommon v1.42
* support compress error log and access log
* disk recovery support multi-threads to speed up
* bugfix: should use memset to init pReader in function
storage_reader_init, this bug is caused by v6.01

NOTE: you MUST upgrade libfastcommon to V1.42 or later


Version 6.03 2019-11-20
* dual IPs support two different types of inner (intranet) IPs
* storage server request tracker server to change it's status
to that of tracker leader when the storage server found
it's status inconsistence
* bugfix: fdfs_monitor fix get index of the specified tracker server
* storage server write to data_init_flag and mark file safely
(write to temp file then rename)
* code refine: combine g_fdfs_store_paths and g_path_space_list,
and extent struct FDFSStorePathInfo
* check store path's mark file to prevent confusion
* new selected tracker leader do NOT notify self by network
* larger network_timeout for fetching one-store-path binlog
when disk recovery

NOTE: the tracker and storage server must upgrade together


Version 6.02 2019-11-12
* get_file_info calculate CRC32 for appender file type
* disk recovery download file to local temp file then rename it
when the local file exists
* support regenerate filename for appender file
NOTE: the regenerated file will be a normal file!


Version 6.01 2019-10-25
* compress and uncompress binlog file by gzip when need,
config items in storage.conf: compress_binlog and compress_binlog_time
* bugfix: must check and create data path before write_to_pid_file
in fdfs_storaged.c


Version 6.00 2019-10-16
* tracker and storage server support dual IPs
1. you can config dual trackr IPs in storage.conf and client.conf,
1. you can config dual tracker IPs in storage.conf and client.conf,
the configuration item name is "tracker_server"
2. you can config dual storage IPs in storage_ids.conf
more detail please see the config files.
Expand All @@ -14,6 +95,7 @@ Version 6.00 2019-10-16
* tracker server check tracker list when storage server join
* use socketCreateExAuto and socketClientExAuto exported by libfastcommon


Version 5.12 2018-06-07
* code refine for rare case
* replace print format OFF_PRINTF_FORMAT to PRId64
Expand Down
79 changes: 48 additions & 31 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -3,50 +3,68 @@ Copy right 2009 Happy Fish / YuQing
FastDFS may be copied only under the terms of the GNU General
Public License V3, which may be found in the FastDFS source kit.
Please visit the FastDFS Home Page for more detail.
English language: http://english.csource.org/
Chinese language: http://www.csource.org/
Chinese language: http://www.fastken.com/

#step 1. download libfastcommon source package from github and install it,
the github address:
https://github.com/happyfish100/libfastcommon.git
# step 1. download libfastcommon source codes and install it,
# github address: https://github.com/happyfish100/libfastcommon.git
# gitee address: https://gitee.com/fastdfs100/libfastcommon.git
# command lines as:

#step 2. download FastDFS source package and unpack it,
tar xzf FastDFS_v5.x.tar.gz
#for example:
tar xzf FastDFS_v5.08.tar.gz
git clone https://github.com/happyfish100/libfastcommon.git
cd libfastcommon; git checkout V1.0.43
./make.sh clean && ./make.sh && ./make.sh install

#step 3. enter the FastDFS dir
cd FastDFS

#step 4. execute:
./make.sh
# step 2. download fastdfs source codes and install it,
# github address: https://github.com/happyfish100/fastdfs.git
# gitee address: https://gitee.com/fastdfs100/fastdfs.git
# command lines as:

#step 5. make install
./make.sh install
git clone https://github.com/happyfish100/fastdfs.git
cd fastdfs; git checkout V6.06
./make.sh clean && ./make.sh && ./make.sh install

#step 6. edit/modify the config file of tracker and storage

#step 7. run server programs
#start the tracker server:
# step 3. setup the config files
# the setup script does NOT overwrite existing config files,
# please feel free to execute this script (take easy :)

./setup.sh /etc/fdfs


# step 4. edit or modify the config files of tracker, storage and client
such as:
vi /etc/fdfs/tracker.conf
vi /etc/fdfs/storage.conf
vi /etc/fdfs/client.conf

and so on ...


# step 5. run the server programs
# start the tracker server:
/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf restart
#in Linux, you can start fdfs_trackerd as a service:
/sbin/service fdfs_trackerd start

#start the storage server:
# start the storage server:
/usr/bin/fdfs_storaged /etc/fdfs/storage.conf restart
#in Linux, you can start fdfs_storaged as a service:
/sbin/service fdfs_storaged start

#step 8. run test program
#run the client test program:
# (optional) in Linux, you can start fdfs_trackerd and fdfs_storaged as a service:
/sbin/service fdfs_trackerd restart
/sbin/service fdfs_storaged restart


# step 6. (optional) run monitor program
# such as:
/usr/bin/fdfs_monitor /etc/fdfs/client.conf


# step 7. (optional) run the test program
# such as:
/usr/bin/fdfs_test <client_conf_filename> <operation>
/usr/bin/fdfs_test1 <client_conf_filename> <operation>
#for example, upload a file:
/usr/bin/fdfs_test conf/client.conf upload /usr/include/stdlib.h

#step 9. run monitor program
#run the monitor program:
/usr/bin/fdfs_monitor <client_conf_filename>
# for example, upload a file for test:
/usr/bin/fdfs_test /etc/fdfs/client.conf upload /usr/include/stdlib.h


tracker server config file sample please see conf/tracker.conf
Expand All @@ -55,7 +73,6 @@ storage server config file sample please see conf/storage.conf

client config file sample please see conf/client.conf


Item detail
1. server common items
---------------------------------------------------
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ Copyright (C) 2008 Happy Fish / YuQing
FastDFS may be copied only under the terms of the GNU General
Public License V3, which may be found in the FastDFS source kit.
Please visit the FastDFS Home Page for more detail.
English language: http://english.csource.org/
Chinese language: http://www.csource.org/
Chinese language: http://www.fastken.com/


FastDFS is an open source high performance distributed file system. It's major
Expand Down Expand Up @@ -42,3 +41,6 @@ The identification of a file is composed of two parts: the volume name and
the file name.

Client test code use client library please refer to the directory: client/test.

For more FastDFS related articles, please subscribe the Wechat/Weixin public account
(Chinese Language): fastdfs
20 changes: 20 additions & 0 deletions README_zh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FastDFS是一款开源的分布式文件系统,功能主要包括:文件存储、文件同步、文件访问(文件上传、文件下载)等,解决了文件大容量存储和高性能访问的问题。FastDFS特别适合以文件为载体的在线服务,如图片、视频、文档等等。

FastDFS作为一款轻量级分布式文件系统,版本V6.01代码量6.3万行。FastDFS用C语言实现,支持Linux、FreeBSD、MacOS等类UNIX系统。FastDFS类似google FS,属于应用级文件系统,不是通用的文件系统,只能通过专有API访问,目前提供了C和Java SDK,以及PHP扩展SDK。

FastDFS为互联网应用量身定做,解决大容量文件存储问题,追求高性能和高扩展性。FastDFS可以看做是基于文件的key value存储系统,key为文件ID,value为文件内容,因此称作分布式文件存储服务更为合适。

FastDFS的架构比较简单,如下图所示:
![architect](images/architect.png)

FastDFS特点如下:
1)分组存储,简单灵活;
2)对等结构,不存在单点;
3)文件ID由FastDFS生成,作为文件访问凭证。FastDFS不需要传统的name server或meta server;
4)大、中、小文件均可以很好支持,可以存储海量小文件;
5)一台storage支持多块磁盘,支持单盘数据恢复;
6)提供了nginx扩展模块,可以和nginx无缝衔接;
7)支持多线程方式上传和下载文件,支持断点续传;
8)存储服务器上可以保存文件附加属性。

FastDFS更多更详细的功能和特性介绍,请参阅FastDFS微信公众号的其他文章,搜索公众号:fastdfs。
4 changes: 2 additions & 2 deletions client/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ENABLE_SHARED_LIB = $(ENABLE_SHARED_LIB)
INC_PATH = -I../common -I../tracker -I/usr/include/fastcommon
LIB_PATH = $(LIBS) -lfastcommon
TARGET_PATH = $(TARGET_PREFIX)/bin
TARGET_LIB = $(TARGET_PREFIX)/lib64
TARGET_LIB = $(TARGET_PREFIX)/$(LIB_VERSION)
TARGET_INC = $(TARGET_PREFIX)/include
CONFIG_PATH = $(TARGET_CONF_PATH)

Expand Down Expand Up @@ -39,7 +39,7 @@ ALL_OBJS = $(STATIC_OBJS) $(FDFS_SHARED_OBJS)
ALL_PRGS = fdfs_monitor fdfs_test fdfs_test1 fdfs_crc32 fdfs_upload_file \
fdfs_download_file fdfs_delete_file fdfs_file_info \
fdfs_appender_test fdfs_appender_test1 fdfs_append_file \
fdfs_upload_appender
fdfs_upload_appender fdfs_regenerate_filename

STATIC_LIBS = libfdfsclient.a

Expand Down
2 changes: 1 addition & 1 deletion client/client_func.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* FastDFS may be copied only under the terms of the GNU General
* Public License V3, which may be found in the FastDFS source kit.
* Please visit the FastDFS Home Page http://www.csource.org/ for more detail.
* Please visit the FastDFS Home Page http://www.fastken.com/ for more detail.
**/

//client_func.c
Expand Down
4 changes: 3 additions & 1 deletion client/client_func.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* FastDFS may be copied only under the terms of the GNU General
* Public License V3, which may be found in the FastDFS source kit.
* Please visit the FastDFS Home Page http://www.csource.org/ for more detail.
* Please visit the FastDFS Home Page http://www.fastken.com/ for more detail.
**/

//client_func.h
Expand All @@ -16,6 +16,8 @@
#define _CLIENT_FUNC_H_

typedef struct {
short file_type;
bool get_from_server;
time_t create_timestamp;
int crc32;
int source_id; //source storage id
Expand Down
Loading