FastDFS 分布式文件系统部署实战及基本使用
FastDFS 分布式文件系统部署实战及基本使用
作者:尹正杰
版权声明:原创作品,谢绝转载!否则将追究法律责任。
FastDFS是一个开源的高性能分布式文件系统。它的主要功能包括:文件存储,文件同步和文件访问(文件上传和文件下载),它可以解决高容量和负载平衡问题。FastDFS应满足基于照片共享站点和视频共享站点等文件服务的网站的要求。它的应用场景非常适合存储大于4k小于500M左右的音频,图片,APP安装包等二进制文件。FastDFS典型用户有UC,支付宝,京东,飞信,58同城,51CTO等等。GitHub地址为:https://github.com/happyfish100/fastdfs。
一.FastDFS基础知识
1>.什么是FastDFS
FastDFS是一个开源的轻量级分布式文件系统。它解决了大数据量存储和负载均衡等问题。特别适合以中小文件(建议范围:4KB < file_size <500MB)为载体的在线服务,如相册网站、视频网站等等。在UC基于FastDFS开发向用户提供了:网盘,社区,广告和应用下载等业务的存储服务。
FastDFS是一款开源的轻量级分布式文件系统纯C实现,支持Linux、FreeBSD等UNIX系统类google FS,不是通用的文件系统,只能通过专有API访问,目前提供了C、Java和PHP API为互联网应用量身定做,解决大容量文件存储问题,追求高性能和高扩展性FastDFS可以看做是基于文件的key value pair存储系统,称作分布式文件存储服务更为合适。
2>.FastDFS的特性
2.1>.文件不分块存储,上传的文件和OS文件系统中的文件一一对应;
2.2>.支持相同内容的文件只保存一份,节约磁盘空间;
2.3>.下载文件支持HTTP协议,可以使用内置Web Server,也可以和其他Web Server配合使用;
2.4>.支持在线扩容;
2.5>.支持主从文件;
2.6>.存储服务器上可以保存文件属性(meta-data)V2.0网络通信采用libevent,支持大并发访问,整体性能更好;
3>.FastDFS架构
FastDFS相关概念 FastDFS服务端有三个角色:跟踪服务器(tracker server)、存储服务器(storage server)和客户端(client)。 tracker server:跟踪服务器,主要做调度工作,起负载均衡的作用。在内存中记录集群中所有存储组和存储服务器的状态信息,是客户端和数据服务器交互的枢纽。相比GFS中的master更为精简,不记录文件索引信息,占用的内存量很少。 Tracker是FastDFS的协调者,负责管理所有的storage server和group,每个storage在启动后会连接Tracker,告知自己所属的group等信息,并保持周期性的心跳,tracker根据storage的心跳信息,建立group==>[storage server list]的映射表。 Tracker需要管理的元信息很少,会全部存储在内存中;另外tracker上的元信息都是由storage汇报的信息生成的,本身不需要持久化任何数据,这样使得tracker非常容易扩展,直接增加tracker机器即可扩展为tracker cluster来服务,cluster里每个tracker之间是完全对等的,所有的tracker都接受stroage的心跳信息,生成元数据信息来提供读写服务。 storage server:存储服务器(又称:存储节点或数据服务器),文件和文件属性(meta data)都保存到存储服务器上。Storage server直接利用OS的文件系统调用管理文件。 Storage server(后简称storage)以组(卷,group或volume)为单位组织,一个group内包含多台storage机器,数据互为备份,存储空间以group内容量最小的storage为准,所以建议group内的多个storage尽量配置相同,以免造成存储空间的浪费。 以group为单位组织存储能方便的进行应用隔离、负载均衡、副本数定制(group内storage server数量即为该group的副本数),比如将不同应用数据存到不同的group就能隔离应用数据,同时还可根据应用的访问特性来将应用分配到不同的group来做负载均衡;缺点是group的容量受单机存储容量的限制,同时当group内有机器坏掉时,数据恢复只能依赖group内地其他机器,使得恢复时间会很长。 group内每个storage的存储依赖于本地文件系统,storage可配置多个数据存储目录,比如有10块磁盘,分别挂载在/data/disk1-/data/disk10,则可将这10个目录都配置为storage的数据存储目录。 storage接受到写文件请求时,会根据配置好的规则(后面会介绍),选择其中一个存储目录来存储文件。为了避免单个目录下的文件数太多,在storage第一次启动时,会在每个数据存储目录里创建2级子目录,每级256个,总共65536个文件,新写的文件会以hash的方式被路由到其中某个子目录下,然后将文件数据直接作为一个本地文件存储到该目录中。 client:客户端,作为业务请求的发起方,通过专有接口,使用TCP/IP协议与跟踪器服务器或存储节点进行数据交互。FastDFS向使用者提供基本文件访问接口,比如upload、download、append、delete等,以客户端库的方式提供给用户使用。 另外两个概念: group :组, 也可称为卷。 同组内服务器上的文件是完全相同的 ,同一组内的storage server之间是对等的, 文件上传、 删除等操作可以在任意一台storage server上进行 。 meta data :文件相关属性,键值对( Key Value Pair) 方式,如:width=1024,heigth=768 。
FastDFS有两个角色:跟踪器和存储。 跟踪服务器(Tracker)负责文件访问的调度和负载平衡。在内存中记录集群中group(同一个group的数据是相同的,和raid1原理很相似,group是支持在线添加的,各个group之间并不互相通信!它们只和追踪服务器通信!)和storage server的状态信息,是连接client和storage server的枢纽。因为相关信息全部在内存中,Tracker server的性能非常高,一个较大的集群(比如上百个group)中有3台就足够了。
存储服务器(Storage)负责存储文件及其功能是文件管理,包括:文件存储,文件同步,提供文件访问接口。它还管理元数据(meta data),这些元数据表示为文件的键值对。例如:width = 1024,键为“width”,值为“1024”。 跟踪器和存储器包含一个或多个服务器。可以随时向集群中添加或删除跟踪器或存储集群中的服务器,而不会影响在线服务。跟踪器集群中的服务器是对等的。 由文件卷/组组织的storarge服务器以获得高容量。存储系统包含一个或多个卷,这些卷的文件在这些卷中是独立的。整个存储系统的容量等于所有容量的总和。文件卷包含一个或多个存储服务器,这些服务器的文件在这些服务器中相同。文件卷中的服务器相互备份,所有这些服务器都是负载平衡的。将存储服务器添加到卷时,此卷中已存在的文件会自动复制到此新服务器,完成此复制后,系统将在线将此服务器切换为提供存储服务。 当整个存储容量不足时,您可以添加一个或多个卷以扩展存储容量。为此,您需要添加一个或多个存储服务器。 文件的标识由两部分组成:卷名和文件名。
Tracker相当于FastDFS的大脑,不论是上传还是下载都是通过tracker来分配资源;客户端一般可以使用ngnix等静态服务器来调用或者做一部分的缓存;存储服务器内部分为卷(或者叫做组),卷于卷之间是平行的关系,可以根据资源的使用情况随时增加,卷内服务器文件相互同步备份,以达到容灾的目的。
4>.FastDFS上传文件
首先客户端请求Tracker服务获取到存储服务器的ip地址和端口,然后客户端根据返回的IP地址和端口号请求上传文件,存储服务器接收到请求后生产文件,并且将文件内容写入磁盘并返回给客户端file_id、路径信息、文件名等信息,客户端保存相关信息上传完毕。
内部机制如下: 1、选择tracker server 当集群中不止一个tracker server时,由于tracker之间是完全对等的关系,客户端在upload文件时可以任意选择一个trakcer。 选择存储的group 当tracker接收到upload file的请求时,会为该文件分配一个可以存储该文件的group,支持如下选择group的规则: 1、Round robin,所有的group间轮询 2、Specified group,指定某一个确定的group 3、Load balance,剩余存储空间多多group优先 2、选择storage server 当选定group后,tracker会在group内选择一个storage server给客户端,支持如下选择storage的规则: 1、Round robin,在group内的所有storage间轮询 2、First server ordered by ip,按ip排序 3、First server ordered by priority,按优先级排序(优先级在storage上配置) 3、选择storage path 当分配好storage server后,客户端将向storage发送写文件请求,storage将会为文件分配一个数据存储目录,支持如下规则: 1、Round robin,多个存储目录间轮询 2、剩余存储空间最多的优先 4、生成Fileid 选定存储目录之后,storage会为文件生一个Fileid,由storage server ip、文件创建时间、文件大小、文件crc32和一个随机数拼接而成,然后将这个二进制串进行base64编码,转换为可打印的字符串。 选择两级目录 当选定存储目录之后,storage会为文件分配一个fileid,每个存储目录下有两级256*256的子目录,storage会按文件fileid进行两次hash(猜测),路由到其中一个子目录,然后将文件以fileid为文件名存储到该子目录下。 5、生成文件名 当文件存储到某个子目录后,即认为该文件存储成功,接下来会为该文件生成一个文件名,文件名由group、存储目录、两级子目录、fileid、文件后缀名(由客户端指定,主要用于区分文件类型)拼接而成。
5>.FastDFS下载文件
客户端带上文件名信息请求Tracker服务获取到存储服务器的ip地址和端口,然后客户端根据返回的IP地址和端口号请求下载文件,存储服务器接收到请求后返回文件给客户端。
跟upload file一样,在download file时客户端可以选择任意tracker server。tracker发送download请求给某个tracker,必须带上文件名信息,tracke从文件名中解析出文件的group、大小、创建时间等信息,然后为该请求选择一个storage用来服务读请求。由于group内的文件同步时在后台异步进行的,所以有可能出现在读到时候,文件还没有同步到某些storage server上,为了尽量避免访问到这样的storage,tracker按照如下规则选择group内可读的storage。 1、该文件上传到的源头storage - 源头storage只要存活着,肯定包含这个文件,源头的地址被编码在文件名中。 2、文件创建时间戳==storage被同步到的时间戳 且(当前时间-文件创建时间戳) > 文件同步最大时间(如5分钟) - 文件创建后,认为经过最大同步时间后,肯定已经同步到其他storage了。 3、文件创建时间戳 < storage被同步到的时间戳。 - 同步时间戳之前的文件确定已经同步了 4、(当前时间-文件创建时间戳) > 同步延迟阀值(如一天)。 - 经过同步延迟阈值时间,认为文件肯定已经同步了。
6>.精巧的文件ID-FID
说到下载就不得不提文件索引(又称:FID)的精巧设计了。文件索引结构如下图,是客户端上传文件后存储服务器返回给客户端,用于以后访问该文件的索引信息。文件索引信息包括:组名,虚拟磁盘路径,数据两级目录,文件名。
组名:文件上传后所在的存储组名称,在文件上传成功后有存储服务器返回,需要客户端自行保存。 虚拟磁盘路径:存储服务器配置的虚拟路径,与磁盘选项store_path*对应。 数据两级目录:存储服务器在每个虚拟磁盘路径下创建的两级目录,用于存储数据文件。 文件名:与文件上传时不同。是由存储服务器根据特定信息生成,文件名包含:源存储服务器IP地址、文件创建时间戳、文件大小、随机数和文件拓展名等信息。
7>.快速定位文件
知道FastDFS FID的组成后,我们来看看FastDFS是如何通过这个精巧的FID定位到需要访问的文件。 1、通过组名tracker能够很快的定位到客户端需要访问的存储服务器组,并将选择合适的存储服务器提供客户端访问; 2、存储服务器根据“文件存储虚拟磁盘路径”和“数据文件两级目录”可以很快定位到文件所在目录,并根据文件名找到客户端需要访问的文件。
以上信息引用自:https://www.cnblogs.com/ityouknow/p/8240976.html。
二.安装libfastcommon类库(安装FastDFS必须先安装libfastcommon类库,否则会导致报错)
1>.查看
2>.下载libfastcommon安装包
[root@node101 ~]# yum -y install gcc gcc-c++ libstdc++-devel pcre-devel zlib-devel wget make Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirror.jdcloud.com * extras: mirror.jdcloud.com * updates: mirror.jdcloud.com base | 3.6 kB 00:00:00 extras | 3.4 kB 00:00:00 myglusterfs | 2.9 kB 00:00:00 mysql-connectors-community | 2.5 kB 00:00:00 mysql-tools-community | 2.5 kB 00:00:00 mysql80-community | 2.5 kB 00:00:00 updates | 3.4 kB 00:00:00 Package gcc-4.8.5-36.el7.x86_64 already installed and latest version Package wget-1.14-18.el7.x86_64 already installed and latest version Package 1:make-3.82-23.el7.x86_64 already installed and latest version Resolving Dependencies --> Running transaction check ---> Package gcc-c++.x86_64 0:4.8.5-36.el7 will be installed ---> Package libstdc++-devel.x86_64 0:4.8.5-36.el7 will be installed ---> Package pcre-devel.x86_64 0:8.32-17.el7 will be installed ---> Package zlib-devel.x86_64 0:1.2.7-18.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved =================================================================================================================================================================================================================== Package Arch Version Repository Size =================================================================================================================================================================================================================== Installing: gcc-c++ x86_64 4.8.5-36.el7 base 7.2 M libstdc++-devel x86_64 4.8.5-36.el7 base 1.5 M pcre-devel x86_64 8.32-17.el7 base 480 k zlib-devel x86_64 1.2.7-18.el7 base 50 k Transaction Summary =================================================================================================================================================================================================================== Install 4 Packages Total download size: 9.2 M Installed size: 26 M Downloading packages: (1/4): libstdc++-devel-4.8.5-36.el7.x86_64.rpm | 1.5 MB 00:00:01 (2/4): zlib-devel-1.2.7-18.el7.x86_64.rpm | 50 kB 00:00:01 (3/4): pcre-devel-8.32-17.el7.x86_64.rpm | 480 kB 00:00:03 (4/4): gcc-c++-4.8.5-36.el7.x86_64.rpm | 7.2 MB 00:00:10 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 895 kB/s | 9.2 MB 00:00:10 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : libstdc++-devel-4.8.5-36.el7.x86_64 1/4 Installing : gcc-c++-4.8.5-36.el7.x86_64 2/4 Installing : zlib-devel-1.2.7-18.el7.x86_64 3/4 Installing : pcre-devel-8.32-17.el7.x86_64 4/4 Verifying : gcc-c++-4.8.5-36.el7.x86_64 1/4 Verifying : pcre-devel-8.32-17.el7.x86_64 2/4 Verifying : zlib-devel-1.2.7-18.el7.x86_64 3/4 Verifying : libstdc++-devel-4.8.5-36.el7.x86_64 4/4 Installed: gcc-c++.x86_64 0:4.8.5-36.el7 libstdc++-devel.x86_64 0:4.8.5-36.el7 pcre-devel.x86_64 0:8.32-17.el7 zlib-devel.x86_64 0:1.2.7-18.el7 Complete! [root@node101 ~]#
[root@node101 ~]# wget https://github.com/happyfish100/libfastcommon/archive/V1.0.39.tar.gz --2019-02-19 17:38:02-- https://github.com/happyfish100/libfastcommon/archive/V1.0.39.tar.gz Resolving github.com (github.com)... 52.74.223.119, 13.229.188.59, 13.250.177.223 Connecting to github.com (github.com)|52.74.223.119|:443... connected. HTTP request sent, awaiting response... 302 Found Location: https://codeload.github.com/happyfish100/libfastcommon/tar.gz/V1.0.39 [following] --2019-02-19 17:38:03-- https://codeload.github.com/happyfish100/libfastcommon/tar.gz/V1.0.39 Resolving codeload.github.com (codeload.github.com)... 54.251.140.56, 13.250.162.133, 13.229.189.0 Connecting to codeload.github.com (codeload.github.com)|54.251.140.56|:443... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [application/x-gzip] Saving to: ‘V1.0.39.tar.gz’ [ <=> ] 153,951 75.6KB/s in 2.0s 2019-02-19 17:38:07 (75.6 KB/s) - ‘V1.0.39.tar.gz’ saved [153951] [root@node101 ~]# [root@node101 ~]# ls glusterfs-rhel8.repo V1.0.39.tar.gz [root@node101 ~]# [root@node101 ~]#
3>. 安装libfastcommon(本实验使用的是CentOS 7.6,两台配置一样的虚拟机测试,因此2台虚拟机都需要做同的操作)
[root@node101 ~]# tar -zxf V1.0.39.tar.gz -C /yinzhengjie/softwares/ [root@node101 ~]# [root@node101 ~]# ll /yinzhengjie/softwares/libfastcommon-1.0.39/ total 40 drwxrwxr-x 2 root root 4096 Jul 31 2018 doc -rw-rw-r-- 1 root root 9099 Jul 31 2018 HISTORY -rw-rw-r-- 1 root root 566 Jul 31 2018 INSTALL -rw-rw-r-- 1 root root 1607 Jul 31 2018 libfastcommon.spec -rwxrwxr-x 1 root root 3248 Jul 31 2018 make.sh drwxrwxr-x 2 root root 4096 Jul 31 2018 php-fastcommon -rw-rw-r-- 1 root root 2763 Jul 31 2018 README drwxrwxr-x 3 root root 4096 Jul 31 2018 src [root@node101 ~]#
[root@node101 ~]# cd /yinzhengjie/softwares/libfastcommon-1.0.39/ [root@node101 libfastcommon-1.0.39]# [root@node101 libfastcommon-1.0.39]# ./make.sh cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o hash.o hash.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o chain.o chain.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o shared_func.o shared_func.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o ini_file_reader.o ini_file_reader.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o logger.o logger.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o sockopt.o sockopt.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o base64.o base64.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o sched_thread.o sched_thread.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o http_func.o http_func.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o md5.o md5.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o pthread_func.o pthread_func.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o local_ip_func.o local_ip_func.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o avl_tree.o avl_tree.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o ioevent.o ioevent.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o ioevent_loop.o ioevent_loop.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o fast_task_queue.o fast_task_queue.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o fast_timer.o fast_timer.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o process_ctrl.o process_ctrl.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o fast_mblock.o fast_mblock.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o connection_pool.o connection_pool.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o fast_mpool.o fast_mpool.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o fast_allocator.o fast_allocator.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o fast_buffer.o fast_buffer.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o multi_skiplist.o multi_skiplist.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o flat_skiplist.o flat_skiplist.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o system_info.o system_info.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o fast_blocked_queue.o fast_blocked_queue.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o id_generator.o id_generator.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o char_converter.o char_converter.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o char_convert_loader.o char_convert_loader.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o common_blocked_queue.o common_blocked_queue.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o multi_socket_client.o multi_socket_client.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o skiplist_set.o skiplist_set.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o hash.lo hash.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o chain.lo chain.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o shared_func.lo shared_func.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o ini_file_reader.lo ini_file_reader.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o logger.lo logger.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o sockopt.lo sockopt.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o base64.lo base64.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o sched_thread.lo sched_thread.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o http_func.lo http_func.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o md5.lo md5.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o pthread_func.lo pthread_func.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o local_ip_func.lo local_ip_func.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o avl_tree.lo avl_tree.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o ioevent.lo ioevent.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o ioevent_loop.lo ioevent_loop.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o fast_task_queue.lo fast_task_queue.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o fast_timer.lo fast_timer.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o process_ctrl.lo process_ctrl.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o fast_mblock.lo fast_mblock.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o connection_pool.lo connection_pool.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o fast_mpool.lo fast_mpool.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o fast_allocator.lo fast_allocator.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o fast_buffer.lo fast_buffer.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o multi_skiplist.lo multi_skiplist.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o flat_skiplist.lo flat_skiplist.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o system_info.lo system_info.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o fast_blocked_queue.lo fast_blocked_queue.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o id_generator.lo id_generator.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o char_converter.lo char_converter.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o char_convert_loader.lo char_convert_loader.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o common_blocked_queue.lo common_blocked_queue.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o multi_socket_client.lo multi_socket_client.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o skiplist_set.lo skiplist_set.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -o libfastcommon.so -shared hash.lo chain.lo shared_func.lo ini_file_reader.lo logger.lo sockopt.lo base64.lo sched_thread.lo http_func.lo md5.lo pthread_func.lo local_ip_func.lo avl_tree.lo ioevent.lo ioevent_loop.lo fast_task_queue.lo fast_timer.lo process_ctrl.lo fast_mblock.lo connection_pool.lo fast_mpool.lo fast_allocator.lo fast_buffer.lo multi_skiplist.lo flat_skiplist.lo system_info.lo fast_blocked_queue.lo id_generator.lo char_converter.lo char_convert_loader.lo common_blocked_queue.lo multi_socket_client.lo skiplist_set.lo -lm -lpthread ar rcs libfastcommon.a hash.o chain.o shared_func.o ini_file_reader.o logger.o sockopt.o base64.o sched_thread.o http_func.o md5.o pthread_func.o local_ip_func.o avl_tree.o ioevent.o ioevent_loop.o fast_task_queue.o fast_timer.o process_ctrl.o fast_mblock.o connection_pool.o fast_mpool.o fast_allocator.o fast_buffer.o multi_skiplist.o flat_skiplist.o system_info.o fast_blocked_queue.o id_generator.o char_converter.o char_convert_loader.o common_blocked_queue.o multi_socket_client.o skiplist_set.o [root@node101 libfastcommon-1.0.39]# echo $? 0 [root@node101 libfastcommon-1.0.39]#
[root@node101 libfastcommon-1.0.39]# ./make.sh install mkdir -p /usr/lib64 mkdir -p /usr/lib mkdir -p /usr/include/fastcommon install -m 755 libfastcommon.so /usr/lib64 install -m 644 common_define.h hash.h chain.h logger.h base64.h shared_func.h pthread_func.h ini_file_reader.h _os_define.h sockopt.h sched_thread.h http_func.h md5.h local_ip_func.h avl_tree.h ioevent.h ioevent_loop.h fast_task_queue.h fast_timer.h process_ctrl.h fast_mblock.h connection_pool.h fast_mpool.h fast_allocator.h fast_buffer.h skiplist.h multi_skiplist.h flat_skiplist.h skiplist_common.h system_info.h fast_blocked_queue.h php7_ext_wrapper.h id_generator.h char_converter.h char_convert_loader.h common_blocked_queue.h multi_socket_client.h skiplist_set.h fc_list.h /usr/include/fastcommon if [ ! -e /usr/lib/libfastcommon.so ]; then ln -s /usr/lib64/libfastcommon.so /usr/lib/libfastcommon.so; fi [root@node101 libfastcommon-1.0.39]#
[root@node102 ~]# yum -y install gcc gcc-c++ libstdc++-devel pcre-devel zlib-devel wget make Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.aliyun.com * extras: mirrors.aliyun.com * updates: mirrors.huaweicloud.com base | 3.6 kB 00:00:00 extras | 3.4 kB 00:00:00 myglusterfs | 2.9 kB 00:00:00 updates | 3.4 kB 00:00:00 Package gcc-4.8.5-36.el7.x86_64 already installed and latest version Package 1:make-3.82-23.el7.x86_64 already installed and latest version Resolving Dependencies --> Running transaction check ---> Package gcc-c++.x86_64 0:4.8.5-36.el7 will be installed ---> Package libstdc++-devel.x86_64 0:4.8.5-36.el7 will be installed ---> Package pcre-devel.x86_64 0:8.32-17.el7 will be installed ---> Package wget.x86_64 0:1.14-18.el7 will be installed ---> Package zlib-devel.x86_64 0:1.2.7-18.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved =================================================================================================================================================================================================================== Package Arch Version Repository Size =================================================================================================================================================================================================================== Installing: gcc-c++ x86_64 4.8.5-36.el7 base 7.2 M libstdc++-devel x86_64 4.8.5-36.el7 base 1.5 M pcre-devel x86_64 8.32-17.el7 base 480 k wget x86_64 1.14-18.el7 base 547 k zlib-devel x86_64 1.2.7-18.el7 base 50 k Transaction Summary =================================================================================================================================================================================================================== Install 5 Packages Total download size: 9.7 M Installed size: 28 M Downloading packages: (1/5): libstdc++-devel-4.8.5-36.el7.x86_64.rpm | 1.5 MB 00:00:02 (2/5): wget-1.14-18.el7.x86_64.rpm | 547 kB 00:00:00 (3/5): pcre-devel-8.32-17.el7.x86_64.rpm | 480 kB 00:00:01 (4/5): zlib-devel-1.2.7-18.el7.x86_64.rpm | 50 kB 00:00:00 (5/5): gcc-c++-4.8.5-36.el7.x86_64.rpm | 7.2 MB 00:00:08 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 1.1 MB/s | 9.7 MB 00:00:08 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : libstdc++-devel-4.8.5-36.el7.x86_64 1/5 Installing : gcc-c++-4.8.5-36.el7.x86_64 2/5 Installing : zlib-devel-1.2.7-18.el7.x86_64 3/5 Installing : wget-1.14-18.el7.x86_64 4/5 Installing : pcre-devel-8.32-17.el7.x86_64 5/5 Verifying : gcc-c++-4.8.5-36.el7.x86_64 1/5 Verifying : pcre-devel-8.32-17.el7.x86_64 2/5 Verifying : wget-1.14-18.el7.x86_64 3/5 Verifying : zlib-devel-1.2.7-18.el7.x86_64 4/5 Verifying : libstdc++-devel-4.8.5-36.el7.x86_64 5/5 Installed: gcc-c++.x86_64 0:4.8.5-36.el7 libstdc++-devel.x86_64 0:4.8.5-36.el7 pcre-devel.x86_64 0:8.32-17.el7 wget.x86_64 0:1.14-18.el7 zlib-devel.x86_64 0:1.2.7-18.el7 Complete! [root@node102 ~]#
[root@node102 ~]# wget https://github.com/happyfish100/libfastcommon/archive/V1.0.39.tar.gz --2019-02-19 17:47:30-- https://github.com/happyfish100/libfastcommon/archive/V1.0.39.tar.gz Resolving github.com (github.com)... 13.229.188.59, 13.250.177.223, 52.74.223.119 Connecting to github.com (github.com)|13.229.188.59|:443... connected. HTTP request sent, awaiting response... 302 Found Location: https://codeload.github.com/happyfish100/libfastcommon/tar.gz/V1.0.39 [following] --2019-02-19 17:47:31-- https://codeload.github.com/happyfish100/libfastcommon/tar.gz/V1.0.39 Resolving codeload.github.com (codeload.github.com)... 54.251.140.56, 13.229.189.0, 13.250.162.133 Connecting to codeload.github.com (codeload.github.com)|54.251.140.56|:443... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [application/x-gzip] Saving to: ‘V1.0.39.tar.gz’ [ <=> ] 153,951 264KB/s in 0.6s 2019-02-19 17:47:32 (264 KB/s) - ‘V1.0.39.tar.gz’ saved [153951] [root@node102 ~]#
[root@node102 ~]# mkdir -pv /yinzhengjie/softwares mkdir: created directory ‘/yinzhengjie’ mkdir: created directory ‘/yinzhengjie/softwares’ [root@node102 ~]# [root@node102 ~]# tar -zxf V1.0.39.tar.gz -C /yinzhengjie/softwares/ [root@node102 ~]# [root@node102 ~]# ll /yinzhengjie/softwares/libfastcommon-1.0.39/ total 40 drwxrwxr-x 2 root root 4096 Jul 31 2018 doc -rw-rw-r-- 1 root root 9099 Jul 31 2018 HISTORY -rw-rw-r-- 1 root root 566 Jul 31 2018 INSTALL -rw-rw-r-- 1 root root 1607 Jul 31 2018 libfastcommon.spec -rwxrwxr-x 1 root root 3248 Jul 31 2018 make.sh drwxrwxr-x 2 root root 4096 Jul 31 2018 php-fastcommon -rw-rw-r-- 1 root root 2763 Jul 31 2018 README drwxrwxr-x 3 root root 4096 Jul 31 2018 src [root@node102 ~]# [root@node102 ~]# cd /yinzhengjie/softwares/libfastcommon-1.0.39/ [root@node102 libfastcommon-1.0.39]# [root@node102 libfastcommon-1.0.39]# ./make.sh cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o hash.o hash.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o chain.o chain.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o shared_func.o shared_func.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o ini_file_reader.o ini_file_reader.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o logger.o logger.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o sockopt.o sockopt.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o base64.o base64.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o sched_thread.o sched_thread.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o http_func.o http_func.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o md5.o md5.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o pthread_func.o pthread_func.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o local_ip_func.o local_ip_func.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o avl_tree.o avl_tree.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o ioevent.o ioevent.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o ioevent_loop.o ioevent_loop.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o fast_task_queue.o fast_task_queue.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o fast_timer.o fast_timer.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o process_ctrl.o process_ctrl.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o fast_mblock.o fast_mblock.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o connection_pool.o connection_pool.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o fast_mpool.o fast_mpool.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o fast_allocator.o fast_allocator.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o fast_buffer.o fast_buffer.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o multi_skiplist.o multi_skiplist.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o flat_skiplist.o flat_skiplist.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o system_info.o system_info.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o fast_blocked_queue.o fast_blocked_queue.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o id_generator.o id_generator.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o char_converter.o char_converter.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o char_convert_loader.o char_convert_loader.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o common_blocked_queue.o common_blocked_queue.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o multi_socket_client.o multi_socket_client.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -o skiplist_set.o skiplist_set.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o hash.lo hash.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o chain.lo chain.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o shared_func.lo shared_func.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o ini_file_reader.lo ini_file_reader.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o logger.lo logger.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o sockopt.lo sockopt.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o base64.lo base64.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o sched_thread.lo sched_thread.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o http_func.lo http_func.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o md5.lo md5.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o pthread_func.lo pthread_func.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o local_ip_func.lo local_ip_func.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o avl_tree.lo avl_tree.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o ioevent.lo ioevent.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o ioevent_loop.lo ioevent_loop.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o fast_task_queue.lo fast_task_queue.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o fast_timer.lo fast_timer.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o process_ctrl.lo process_ctrl.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o fast_mblock.lo fast_mblock.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o connection_pool.lo connection_pool.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o fast_mpool.lo fast_mpool.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o fast_allocator.lo fast_allocator.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o fast_buffer.lo fast_buffer.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o multi_skiplist.lo multi_skiplist.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o flat_skiplist.lo flat_skiplist.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o system_info.lo system_info.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o fast_blocked_queue.lo fast_blocked_queue.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o id_generator.lo id_generator.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o char_converter.lo char_converter.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o char_convert_loader.lo char_convert_loader.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o common_blocked_queue.lo common_blocked_queue.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o multi_socket_client.lo multi_socket_client.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -c -fPIC -o skiplist_set.lo skiplist_set.c cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O3 -o libfastcommon.so -shared hash.lo chain.lo shared_func.lo ini_file_reader.lo logger.lo sockopt.lo base64.lo sched_thread.lo http_func.lo md5.lo pthread_func.lo local_ip_func.lo avl_tree.lo ioevent.lo ioevent_loop.lo fast_task_queue.lo fast_timer.lo process_ctrl.lo fast_mblock.lo connection_pool.lo fast_mpool.lo fast_allocator.lo fast_buffer.lo multi_skiplist.lo flat_skiplist.lo system_info.lo fast_blocked_queue.lo id_generator.lo char_converter.lo char_convert_loader.lo common_blocked_queue.lo multi_socket_client.lo skiplist_set.lo -lm -lpthread ar rcs libfastcommon.a hash.o chain.o shared_func.o ini_file_reader.o logger.o sockopt.o base64.o sched_thread.o http_func.o md5.o pthread_func.o local_ip_func.o avl_tree.o ioevent.o ioevent_loop.o fast_task_queue.o fast_timer.o process_ctrl.o fast_mblock.o connection_pool.o fast_mpool.o fast_allocator.o fast_buffer.o multi_skiplist.o flat_skiplist.o system_info.o fast_blocked_queue.o id_generator.o char_converter.o char_convert_loader.o common_blocked_queue.o multi_socket_client.o skiplist_set.o [root@node102 libfastcommon-1.0.39]#
[root@node102 libfastcommon-1.0.39]# ./make.sh install mkdir -p /usr/lib64 mkdir -p /usr/lib mkdir -p /usr/include/fastcommon install -m 755 libfastcommon.so /usr/lib64 install -m 644 common_define.h hash.h chain.h logger.h base64.h shared_func.h pthread_func.h ini_file_reader.h _os_define.h sockopt.h sched_thread.h http_func.h md5.h local_ip_func.h avl_tree.h ioevent.h ioevent_loop.h fast_task_queue.h fast_timer.h process_ctrl.h fast_mblock.h connection_pool.h fast_mpool.h fast_allocator.h fast_buffer.h skiplist.h multi_skiplist.h flat_skiplist.h skiplist_common.h system_info.h fast_blocked_queue.h php7_ext_wrapper.h id_generator.h char_converter.h char_convert_loader.h common_blocked_queue.h multi_socket_client.h skiplist_set.h fc_list.h /usr/include/fastcommon if [ ! -e /usr/lib/libfastcommon.so ]; then
三.部署FastDFS
1>.查看
2>.选择FastDFS的版本
3>.安装FastDFS
[root@node101 ~]# wget https://github.com/happyfish100/fastdfs/archive/V5.11.tar.gz --2019-02-19 17:55:08-- https://github.com/happyfish100/fastdfs/archive/V5.11.tar.gz Resolving github.com (github.com)... 13.229.188.59, 13.250.177.223, 52.74.223.119 Connecting to github.com (github.com)|13.229.188.59|:443... connected. HTTP request sent, awaiting response... 302 Found Location: https://codeload.github.com/happyfish100/fastdfs/tar.gz/V5.11 [following] --2019-02-19 17:55:09-- https://codeload.github.com/happyfish100/fastdfs/tar.gz/V5.11 Resolving codeload.github.com (codeload.github.com)... 13.250.162.133, 54.251.140.56, 13.229.189.0 Connecting to codeload.github.com (codeload.github.com)|13.250.162.133|:443... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [application/x-gzip] Saving to: ‘V5.11.tar.gz’ [ <=> ] 336,939 480KB/s in 0.7s 2019-02-19 17:55:11 (480 KB/s) - ‘V5.11.tar.gz’ saved [336939] [root@node101 ~]#
[root@node101 ~]# tar -zxf V5.11.tar.gz -C /yinzhengjie/softwares/ [root@node101 ~]# [root@node101 ~]# ll /yinzhengjie/softwares/fastdfs-5.11/ total 136 drwxrwxr-x 3 root root 4096 Jun 3 2017 client drwxrwxr-x 2 root root 4096 Jun 3 2017 common drwxrwxr-x 2 root root 4096 Jun 3 2017 conf -rw-rw-r-- 1 root root 35067 Jun 3 2017 COPYING-3_0.txt -rw-rw-r-- 1 root root 3171 Jun 3 2017 fastdfs.spec -rw-rw-r-- 1 root root 33100 Jun 3 2017 HISTORY drwxrwxr-x 2 root root 4096 Jun 3 2017 init.d -rw-rw-r-- 1 root root 7755 Jun 3 2017 INSTALL -rwxrwxr-x 1 root root 5548 Jun 3 2017 make.sh drwxrwxr-x 2 root root 4096 Jun 3 2017 php_client -rw-rw-r-- 1 root root 2380 Jun 3 2017 README.md -rwxrwxr-x 1 root root 1768 Jun 3 2017 restart.sh -rwxrwxr-x 1 root root 1680 Jun 3 2017 stop.sh drwxrwxr-x 4 root root 4096 Jun 3 2017 storage drwxrwxr-x 2 root root 4096 Jun 3 2017 test drwxrwxr-x 2 root root 4096 Jun 3 2017 tracker [root@node101 ~]#
[root@node101 ~]# cd /yinzhengjie/softwares/fastdfs-5.11/ [root@node101 fastdfs-5.11]# [root@node101 fastdfs-5.11]# ./make.sh cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o ../common/fdfs_global.o ../common/fdfs_global.c -I../common -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o tracker_proto.o tracker_proto.c -I../common -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o tracker_mem.o tracker_mem.c -I../common -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o tracker_service.o tracker_service.c -I../common -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o tracker_status.o tracker_status.c -I../common -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o tracker_global.o tracker_global.c -I../common -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o tracker_func.o tracker_func.c -I../common -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o fdfs_shared_func.o fdfs_shared_func.c -I../common -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o tracker_nio.o tracker_nio.c -I../common -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o tracker_relationship.o tracker_relationship.c -I../common -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o tracker_dump.o tracker_dump.c -I../common -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -o fdfs_trackerd fdfs_trackerd.c ../common/fdfs_global.o tracker_proto.o tracker_mem.o tracker_service.o tracker_status.o tracker_global.o tracker_func.o fdfs_shared_func.o tracker_nio.o tracker_relationship.o tracker_dump.o -L/usr/lib64 -lpthread -lfastcommon -I../common -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o tracker_client_thread.o tracker_client_thread.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o storage_global.o storage_global.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o storage_func.o storage_func.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o storage_service.o storage_service.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o storage_sync.o storage_sync.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o storage_nio.o storage_nio.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o storage_dio.o storage_dio.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o storage_ip_changed_dealer.o storage_ip_changed_dealer.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o storage_param_getter.o storage_param_getter.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o storage_disk_recovery.o storage_disk_recovery.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o trunk_mgr/trunk_mem.o trunk_mgr/trunk_mem.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o trunk_mgr/trunk_shared.o trunk_mgr/trunk_shared.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o trunk_mgr/trunk_sync.o trunk_mgr/trunk_sync.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o trunk_mgr/trunk_client.o trunk_mgr/trunk_client.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o trunk_mgr/trunk_free_block_checker.o trunk_mgr/trunk_free_block_checker.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o ../client/client_global.o ../client/client_global.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o ../client/tracker_client.o ../client/tracker_client.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o ../client/storage_client.o ../client/storage_client.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o ../client/client_func.o ../client/client_func.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o fdht_client/fdht_proto.o fdht_client/fdht_proto.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o fdht_client/fdht_client.o fdht_client/fdht_client.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o fdht_client/fdht_func.o fdht_client/fdht_func.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o fdht_client/fdht_global.o fdht_client/fdht_global.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o storage_dump.o storage_dump.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -o fdfs_storaged fdfs_storaged.c ../common/fdfs_global.o ../tracker/fdfs_shared_func.o ../tracker/tracker_proto.o tracker_client_thread.o storage_global.o storage_func.o storage_service.o storage_sync.o storage_nio.o storage_dio.o storage_ip_changed_dealer.o storage_param_getter.o storage_disk_recovery.o trunk_mgr/trunk_mem.o trunk_mgr/trunk_shared.o trunk_mgr/trunk_sync.o trunk_mgr/trunk_client.o trunk_mgr/trunk_free_block_checker.o ../client/client_global.o ../client/tracker_client.o ../client/storage_client.o ../client/client_func.o fdht_client/fdht_proto.o fdht_client/fdht_client.o fdht_client/fdht_func.o fdht_client/fdht_global.o storage_dump.o -L/usr/lib64 -lpthread -lfastcommon -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o ../common/fdfs_http_shared.o ../common/fdfs_http_shared.c -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o ../common/mime_file_parser.o ../common/mime_file_parser.c -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -fPIC -o ../common/fdfs_global.lo ../common/fdfs_global.c -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -fPIC -o ../common/fdfs_http_shared.lo ../common/fdfs_http_shared.c -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -fPIC -o ../common/mime_file_parser.lo ../common/mime_file_parser.c -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -fPIC -o ../tracker/tracker_proto.lo ../tracker/tracker_proto.c -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -fPIC -o ../tracker/fdfs_shared_func.lo ../tracker/fdfs_shared_func.c -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -fPIC -o ../storage/trunk_mgr/trunk_shared.lo ../storage/trunk_mgr/trunk_shared.c -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -fPIC -o tracker_client.lo tracker_client.c -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -fPIC -o client_func.lo client_func.c -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -fPIC -o client_global.lo client_global.c -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -fPIC -o storage_client.lo storage_client.c -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -o fdfs_monitor fdfs_monitor.c ../common/fdfs_global.o ../common/fdfs_http_shared.o ../common/mime_file_parser.o ../tracker/tracker_proto.o ../tracker/fdfs_shared_func.o ../storage/trunk_mgr/trunk_shared.o tracker_client.o client_func.o client_global.o storage_client.o -L/usr/lib64 -lpthread -lfastcommon -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -o fdfs_test fdfs_test.c ../common/fdfs_global.o ../common/fdfs_http_shared.o ../common/mime_file_parser.o ../tracker/tracker_proto.o ../tracker/fdfs_shared_func.o ../storage/trunk_mgr/trunk_shared.o tracker_client.o client_func.o client_global.o storage_client.o -L/usr/lib64 -lpthread -lfastcommon -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -o fdfs_test1 fdfs_test1.c ../common/fdfs_global.o ../common/fdfs_http_shared.o ../common/mime_file_parser.o ../tracker/tracker_proto.o ../tracker/fdfs_shared_func.o ../storage/trunk_mgr/trunk_shared.o tracker_client.o client_func.o client_global.o storage_client.o -L/usr/lib64 -lpthread -lfastcommon -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -o fdfs_crc32 fdfs_crc32.c ../common/fdfs_global.o ../common/fdfs_http_shared.o ../common/mime_file_parser.o ../tracker/tracker_proto.o ../tracker/fdfs_shared_func.o ../storage/trunk_mgr/trunk_shared.o tracker_client.o client_func.o client_global.o storage_client.o -L/usr/lib64 -lpthread -lfastcommon -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -o fdfs_upload_file fdfs_upload_file.c ../common/fdfs_global.o ../common/fdfs_http_shared.o ../common/mime_file_parser.o ../tracker/tracker_proto.o ../tracker/fdfs_shared_func.o ../storage/trunk_mgr/trunk_shared.o tracker_client.o client_func.o client_global.o storage_client.o -L/usr/lib64 -lpthread -lfastcommon -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -o fdfs_download_file fdfs_download_file.c ../common/fdfs_global.o ../common/fdfs_http_shared.o ../common/mime_file_parser.o ../tracker/tracker_proto.o ../tracker/fdfs_shared_func.o ../storage/trunk_mgr/trunk_shared.o tracker_client.o client_func.o client_global.o storage_client.o -L/usr/lib64 -lpthread -lfastcommon -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -o fdfs_delete_file fdfs_delete_file.c ../common/fdfs_global.o ../common/fdfs_http_shared.o ../common/mime_file_parser.o ../tracker/tracker_proto.o ../tracker/fdfs_shared_func.o ../storage/trunk_mgr/trunk_shared.o tracker_client.o client_func.o client_global.o storage_client.o -L/usr/lib64 -lpthread -lfastcommon -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -o fdfs_file_info fdfs_file_info.c ../common/fdfs_global.o ../common/fdfs_http_shared.o ../common/mime_file_parser.o ../tracker/tracker_proto.o ../tracker/fdfs_shared_func.o ../storage/trunk_mgr/trunk_shared.o tracker_client.o client_func.o client_global.o storage_client.o -L/usr/lib64 -lpthread -lfastcommon -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -o fdfs_appender_test fdfs_appender_test.c ../common/fdfs_global.o ../common/fdfs_http_shared.o ../common/mime_file_parser.o ../tracker/tracker_proto.o ../tracker/fdfs_shared_func.o ../storage/trunk_mgr/trunk_shared.o tracker_client.o client_func.o client_global.o storage_client.o -L/usr/lib64 -lpthread -lfastcommon -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -o fdfs_appender_test1 fdfs_appender_test1.c ../common/fdfs_global.o ../common/fdfs_http_shared.o ../common/mime_file_parser.o ../tracker/tracker_proto.o ../tracker/fdfs_shared_func.o ../storage/trunk_mgr/trunk_shared.o tracker_client.o client_func.o client_global.o storage_client.o -L/usr/lib64 -lpthread -lfastcommon -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -o fdfs_append_file fdfs_append_file.c ../common/fdfs_global.o ../common/fdfs_http_shared.o ../common/mime_file_parser.o ../tracker/tracker_proto.o ../tracker/fdfs_shared_func.o ../storage/trunk_mgr/trunk_shared.o tracker_client.o client_func.o client_global.o storage_client.o -L/usr/lib64 -lpthread -lfastcommon -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -o fdfs_upload_appender fdfs_upload_appender.c ../common/fdfs_global.o ../common/fdfs_http_shared.o ../common/mime_file_parser.o ../tracker/tracker_proto.o ../tracker/fdfs_shared_func.o ../storage/trunk_mgr/trunk_shared.o tracker_client.o client_func.o client_global.o storage_client.o -L/usr/lib64 -lpthread -lfastcommon -I../common -I../tracker -I/usr/include/fastcommon ar cru libfdfsclient.a ../common/fdfs_global.o ../common/fdfs_http_shared.o ../common/mime_file_parser.o ../tracker/tracker_proto.o ../tracker/fdfs_shared_func.o ../storage/trunk_mgr/trunk_shared.o tracker_client.o client_func.o client_global.o storage_client.o cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -o libfdfsclient.so -shared ../common/fdfs_global.lo ../common/fdfs_http_shared.lo ../common/mime_file_parser.lo ../tracker/tracker_proto.lo ../tracker/fdfs_shared_func.lo ../storage/trunk_mgr/trunk_shared.lo tracker_client.lo client_func.lo client_global.lo storage_client.lo -L/usr/lib64 -lpthread -lfastcommon [root@node101 fastdfs-5.11]#
[root@node101 fastdfs-5.11]# ./make.sh install mkdir -p /usr/bin mkdir -p /etc/fdfs cp -f fdfs_trackerd /usr/bin if [ ! -f /etc/fdfs/tracker.conf.sample ]; then cp -f ../conf/tracker.conf /etc/fdfs/tracker.conf.sample; fi if [ ! -f /etc/fdfs/storage_ids.conf.sample ]; then cp -f ../conf/storage_ids.conf /etc/fdfs/storage_ids.conf.sample; fi mkdir -p /usr/bin mkdir -p /etc/fdfs cp -f fdfs_storaged /usr/bin if [ ! -f /etc/fdfs/storage.conf.sample ]; then cp -f ../conf/storage.conf /etc/fdfs/storage.conf.sample; fi mkdir -p /usr/bin mkdir -p /etc/fdfs mkdir -p /usr/lib64 mkdir -p /usr/lib cp -f 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 /usr/bin if [ 0 -eq 1 ]; then cp -f libfdfsclient.a /usr/lib64; cp -f libfdfsclient.a /usr/lib/;fi if [ 1 -eq 1 ]; then cp -f libfdfsclient.so /usr/lib64; cp -f libfdfsclient.so /usr/lib/;fi mkdir -p /usr/include/fastdfs cp -f ../common/fdfs_define.h ../common/fdfs_global.h ../common/mime_file_parser.h ../common/fdfs_http_shared.h ../tracker/tracker_types.h ../tracker/tracker_proto.h ../tracker/fdfs_shared_func.h ../storage/trunk_mgr/trunk_shared.h tracker_client.h storage_client.h storage_client1.h client_func.h client_global.h fdfs_client.h /usr/include/fastdfs if [ ! -f /etc/fdfs/client.conf.sample ]; then cp -f ../conf/client.conf /etc/fdfs/client.conf.sample; fi [root@node101 fastdfs-5.11]#
[root@node102 ~]# wget https://github.com/happyfish100/fastdfs/archive/V5.11.tar.gz --2019-02-19 17:55:14-- https://github.com/happyfish100/fastdfs/archive/V5.11.tar.gz Resolving github.com (github.com)... 13.250.177.223, 52.74.223.119, 13.229.188.59 Connecting to github.com (github.com)|13.250.177.223|:443... connected. HTTP request sent, awaiting response... 302 Found Location: https://codeload.github.com/happyfish100/fastdfs/tar.gz/V5.11 [following] --2019-02-19 17:55:15-- https://codeload.github.com/happyfish100/fastdfs/tar.gz/V5.11 Resolving codeload.github.com (codeload.github.com)... 13.250.162.133, 54.251.140.56, 13.229.189.0 Connecting to codeload.github.com (codeload.github.com)|13.250.162.133|:443... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [application/x-gzip] Saving to: ‘V5.11.tar.gz’ [ <=> ] 336,939 294KB/s in 1.1s 2019-02-19 17:55:19 (294 KB/s) - ‘V5.11.tar.gz’ saved [336939] [root@node102 ~]#
[root@node102 ~]# tar -zxf V5.11.tar.gz -C /yinzhengjie/softwares/ [root@node102 ~]# [root@node102 ~]# cd /yinzhengjie/softwares/fastdfs-5.11/ [root@node102 fastdfs-5.11]# [root@node102 fastdfs-5.11]# ./make.sh cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o ../common/fdfs_global.o ../common/fdfs_global.c -I../common -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o tracker_proto.o tracker_proto.c -I../common -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o tracker_mem.o tracker_mem.c -I../common -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o tracker_service.o tracker_service.c -I../common -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o tracker_status.o tracker_status.c -I../common -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o tracker_global.o tracker_global.c -I../common -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o tracker_func.o tracker_func.c -I../common -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o fdfs_shared_func.o fdfs_shared_func.c -I../common -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o tracker_nio.o tracker_nio.c -I../common -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o tracker_relationship.o tracker_relationship.c -I../common -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o tracker_dump.o tracker_dump.c -I../common -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -o fdfs_trackerd fdfs_trackerd.c ../common/fdfs_global.o tracker_proto.o tracker_mem.o tracker_service.o tracker_status.o tracker_global.o tracker_func.o fdfs_shared_func.o tracker_nio.o tracker_relationship.o tracker_dump.o -L/usr/lib64 -lpthread -lfastcommon -I../common -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o tracker_client_thread.o tracker_client_thread.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o storage_global.o storage_global.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o storage_func.o storage_func.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o storage_service.o storage_service.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o storage_sync.o storage_sync.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o storage_nio.o storage_nio.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o storage_dio.o storage_dio.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o storage_ip_changed_dealer.o storage_ip_changed_dealer.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o storage_param_getter.o storage_param_getter.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o storage_disk_recovery.o storage_disk_recovery.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o trunk_mgr/trunk_mem.o trunk_mgr/trunk_mem.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o trunk_mgr/trunk_shared.o trunk_mgr/trunk_shared.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o trunk_mgr/trunk_sync.o trunk_mgr/trunk_sync.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o trunk_mgr/trunk_client.o trunk_mgr/trunk_client.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o trunk_mgr/trunk_free_block_checker.o trunk_mgr/trunk_free_block_checker.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o ../client/client_global.o ../client/client_global.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o ../client/tracker_client.o ../client/tracker_client.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o ../client/storage_client.o ../client/storage_client.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o ../client/client_func.o ../client/client_func.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o fdht_client/fdht_proto.o fdht_client/fdht_proto.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o fdht_client/fdht_client.o fdht_client/fdht_client.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o fdht_client/fdht_func.o fdht_client/fdht_func.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o fdht_client/fdht_global.o fdht_client/fdht_global.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o storage_dump.o storage_dump.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -o fdfs_storaged fdfs_storaged.c ../common/fdfs_global.o ../tracker/fdfs_shared_func.o ../tracker/tracker_proto.o tracker_client_thread.o storage_global.o storage_func.o storage_service.o storage_sync.o storage_nio.o storage_dio.o storage_ip_changed_dealer.o storage_param_getter.o storage_disk_recovery.o trunk_mgr/trunk_mem.o trunk_mgr/trunk_shared.o trunk_mgr/trunk_sync.o trunk_mgr/trunk_client.o trunk_mgr/trunk_free_block_checker.o ../client/client_global.o ../client/tracker_client.o ../client/storage_client.o ../client/client_func.o fdht_client/fdht_proto.o fdht_client/fdht_client.o fdht_client/fdht_func.o fdht_client/fdht_global.o storage_dump.o -L/usr/lib64 -lpthread -lfastcommon -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o ../common/fdfs_http_shared.o ../common/fdfs_http_shared.c -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -o ../common/mime_file_parser.o ../common/mime_file_parser.c -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -fPIC -o ../common/fdfs_global.lo ../common/fdfs_global.c -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -fPIC -o ../common/fdfs_http_shared.lo ../common/fdfs_http_shared.c -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -fPIC -o ../common/mime_file_parser.lo ../common/mime_file_parser.c -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -fPIC -o ../tracker/tracker_proto.lo ../tracker/tracker_proto.c -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -fPIC -o ../tracker/fdfs_shared_func.lo ../tracker/fdfs_shared_func.c -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -fPIC -o ../storage/trunk_mgr/trunk_shared.lo ../storage/trunk_mgr/trunk_shared.c -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -fPIC -o tracker_client.lo tracker_client.c -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -fPIC -o client_func.lo client_func.c -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -fPIC -o client_global.lo client_global.c -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -c -fPIC -o storage_client.lo storage_client.c -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -o fdfs_monitor fdfs_monitor.c ../common/fdfs_global.o ../common/fdfs_http_shared.o ../common/mime_file_parser.o ../tracker/tracker_proto.o ../tracker/fdfs_shared_func.o ../storage/trunk_mgr/trunk_shared.o tracker_client.o client_func.o client_global.o storage_client.o -L/usr/lib64 -lpthread -lfastcommon -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -o fdfs_test fdfs_test.c ../common/fdfs_global.o ../common/fdfs_http_shared.o ../common/mime_file_parser.o ../tracker/tracker_proto.o ../tracker/fdfs_shared_func.o ../storage/trunk_mgr/trunk_shared.o tracker_client.o client_func.o client_global.o storage_client.o -L/usr/lib64 -lpthread -lfastcommon -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -o fdfs_test1 fdfs_test1.c ../common/fdfs_global.o ../common/fdfs_http_shared.o ../common/mime_file_parser.o ../tracker/tracker_proto.o ../tracker/fdfs_shared_func.o ../storage/trunk_mgr/trunk_shared.o tracker_client.o client_func.o client_global.o storage_client.o -L/usr/lib64 -lpthread -lfastcommon -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -o fdfs_crc32 fdfs_crc32.c ../common/fdfs_global.o ../common/fdfs_http_shared.o ../common/mime_file_parser.o ../tracker/tracker_proto.o ../tracker/fdfs_shared_func.o ../storage/trunk_mgr/trunk_shared.o tracker_client.o client_func.o client_global.o storage_client.o -L/usr/lib64 -lpthread -lfastcommon -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -o fdfs_upload_file fdfs_upload_file.c ../common/fdfs_global.o ../common/fdfs_http_shared.o ../common/mime_file_parser.o ../tracker/tracker_proto.o ../tracker/fdfs_shared_func.o ../storage/trunk_mgr/trunk_shared.o tracker_client.o client_func.o client_global.o storage_client.o -L/usr/lib64 -lpthread -lfastcommon -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -o fdfs_download_file fdfs_download_file.c ../common/fdfs_global.o ../common/fdfs_http_shared.o ../common/mime_file_parser.o ../tracker/tracker_proto.o ../tracker/fdfs_shared_func.o ../storage/trunk_mgr/trunk_shared.o tracker_client.o client_func.o client_global.o storage_client.o -L/usr/lib64 -lpthread -lfastcommon -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -o fdfs_delete_file fdfs_delete_file.c ../common/fdfs_global.o ../common/fdfs_http_shared.o ../common/mime_file_parser.o ../tracker/tracker_proto.o ../tracker/fdfs_shared_func.o ../storage/trunk_mgr/trunk_shared.o tracker_client.o client_func.o client_global.o storage_client.o -L/usr/lib64 -lpthread -lfastcommon -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -o fdfs_file_info fdfs_file_info.c ../common/fdfs_global.o ../common/fdfs_http_shared.o ../common/mime_file_parser.o ../tracker/tracker_proto.o ../tracker/fdfs_shared_func.o ../storage/trunk_mgr/trunk_shared.o tracker_client.o client_func.o client_global.o storage_client.o -L/usr/lib64 -lpthread -lfastcommon -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -o fdfs_appender_test fdfs_appender_test.c ../common/fdfs_global.o ../common/fdfs_http_shared.o ../common/mime_file_parser.o ../tracker/tracker_proto.o ../tracker/fdfs_shared_func.o ../storage/trunk_mgr/trunk_shared.o tracker_client.o client_func.o client_global.o storage_client.o -L/usr/lib64 -lpthread -lfastcommon -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -o fdfs_appender_test1 fdfs_appender_test1.c ../common/fdfs_global.o ../common/fdfs_http_shared.o ../common/mime_file_parser.o ../tracker/tracker_proto.o ../tracker/fdfs_shared_func.o ../storage/trunk_mgr/trunk_shared.o tracker_client.o client_func.o client_global.o storage_client.o -L/usr/lib64 -lpthread -lfastcommon -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -o fdfs_append_file fdfs_append_file.c ../common/fdfs_global.o ../common/fdfs_http_shared.o ../common/mime_file_parser.o ../tracker/tracker_proto.o ../tracker/fdfs_shared_func.o ../storage/trunk_mgr/trunk_shared.o tracker_client.o client_func.o client_global.o storage_client.o -L/usr/lib64 -lpthread -lfastcommon -I../common -I../tracker -I/usr/include/fastcommon cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -o fdfs_upload_appender fdfs_upload_appender.c ../common/fdfs_global.o ../common/fdfs_http_shared.o ../common/mime_file_parser.o ../tracker/tracker_proto.o ../tracker/fdfs_shared_func.o ../storage/trunk_mgr/trunk_shared.o tracker_client.o client_func.o client_global.o storage_client.o -L/usr/lib64 -lpthread -lfastcommon -I../common -I../tracker -I/usr/include/fastcommon ar cru libfdfsclient.a ../common/fdfs_global.o ../common/fdfs_http_shared.o ../common/mime_file_parser.o ../tracker/tracker_proto.o ../tracker/fdfs_shared_func.o ../storage/trunk_mgr/trunk_shared.o tracker_client.o client_func.o client_global.o storage_client.o cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O -DDEBUG_FLAG -o libfdfsclient.so -shared ../common/fdfs_global.lo ../common/fdfs_http_shared.lo ../common/mime_file_parser.lo ../tracker/tracker_proto.lo ../tracker/fdfs_shared_func.lo ../storage/trunk_mgr/trunk_shared.lo tracker_client.lo client_func.lo client_global.lo storage_client.lo -L/usr/lib64 -lpthread -lfastcommon [root@node102 fastdfs-5.11]#
[root@node102 fastdfs-5.11]# ./make.sh install mkdir -p /usr/bin mkdir -p /etc/fdfs cp -f fdfs_trackerd /usr/bin if [ ! -f /etc/fdfs/tracker.conf.sample ]; then cp -f ../conf/tracker.conf /etc/fdfs/tracker.conf.sample; fi if [ ! -f /etc/fdfs/storage_ids.conf.sample ]; then cp -f ../conf/storage_ids.conf /etc/fdfs/storage_ids.conf.sample; fi mkdir -p /usr/bin mkdir -p /etc/fdfs cp -f fdfs_storaged /usr/bin if [ ! -f /etc/fdfs/storage.conf.sample ]; then cp -f ../conf/storage.conf /etc/fdfs/storage.conf.sample; fi mkdir -p /usr/bin mkdir -p /etc/fdfs mkdir -p /usr/lib64 mkdir -p /usr/lib cp -f 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 /usr/bin if [ 0 -eq 1 ]; then cp -f libfdfsclient.a /usr/lib64; cp -f libfdfsclient.a /usr/lib/;fi if [ 1 -eq 1 ]; then cp -f libfdfsclient.so /usr/lib64; cp -f libfdfsclient.so /usr/lib/;fi mkdir -p /usr/include/fastdfs cp -f ../common/fdfs_define.h ../common/fdfs_global.h ../common/mime_file_parser.h ../common/fdfs_http_shared.h ../tracker/tracker_types.h ../tracker/tracker_proto.h ../tracker/fdfs_shared_func.h ../storage/trunk_mgr/trunk_shared.h tracker_client.h storage_client.h storage_client1.h client_func.h client_global.h fdfs_client.h /usr/include/fastdfs if [ ! -f /etc/fdfs/client.conf.sample ]; then cp -f ../conf/client.conf /etc/fdfs/client.conf.sample; fi [root@node102 fastdfs-5.11]#
4>.FastDFS的文件存放说明
[root@node101 ~]# ll /etc/fdfs/ #配置文件存放路径 total 24 -rw-r--r-- 1 root root 1461 Feb 19 17:58 client.conf.sample -rw-r--r-- 1 root root 7927 Feb 19 17:58 storage.conf.sample -rw-r--r-- 1 root root 105 Feb 19 17:58 storage_ids.conf.sample -rw-r--r-- 1 root root 7389 Feb 19 17:58 tracker.conf.sample [root@node101 ~]# [root@node101 ~]# [root@node101 ~]# ll /etc/init.d/fdfs_* #脚本存放路径 -rwxr-xr-x 1 root root 961 Feb 19 17:58 /etc/init.d/fdfs_storaged #用于存储的脚本 -rwxr-xr-x 1 root root 963 Feb 19 17:58 /etc/init.d/fdfs_trackerd #用于追踪的脚本 [root@node101 ~]# [root@node101 ~]#
5>.创建存储数据的路径
[root@node101 ~]# mkdir -p /home/yinzhengjie/ .bash_logout .bash_profile .bashrc Desktop/ glusterfs/ [root@node101 ~]# mkdir -p /home/yinzhengjie/fastdfs/data/fdfs_tracker [root@node101 ~]# [root@node101 ~]# mkdir -p /home/yinzhengjie/fastdfs/data/fdfs_storage [root@node101 ~]# [root@node101 ~]# ssh node102.yinzhengjie.org.cn Last login: Tue Feb 19 12:50:49 2019 from node101.yinzhengjie.org.cn [root@node102 ~]# [root@node102 ~]# mkdir -p /home/yinzhengjie/fastdfs/data/fdfs_tracker [root@node102 ~]# [root@node102 ~]# mkdir -p /home/yinzhengjie/fastdfs/data/fdfs_storage [root@node102 ~]# [root@node102 ~]# exit logout Connection to node102.yinzhengjie.org.cn closed. [root@node101 ~]#
6>.修改配置文件(我这里的做法是在node101.yinzhengjie.org.cn上配置好后,将该配置文件拷贝到node102.yinzhengjie.org.cn节点上去!)
[root@node101 ~]# cd /etc/fdfs/ [root@node101 fdfs]# [root@node101 fdfs]# ll total 24 -rw-r--r-- 1 root root 1461 Feb 19 17:58 client.conf.sample -rw-r--r-- 1 root root 7927 Feb 19 17:58 storage.conf.sample -rw-r--r-- 1 root root 105 Feb 19 17:58 storage_ids.conf.sample -rw-r--r-- 1 root root 7389 Feb 19 17:58 tracker.conf.sample [root@node101 fdfs]# [root@node101 fdfs]# cp storage.conf.sample storage.conf [root@node101 fdfs]# [root@node101 fdfs]# cp tracker.conf.sample tracker.conf [root@node101 fdfs]#
[root@node101 ~]# grep base_path /etc/fdfs/tracker.conf base_path=/home/yuqing/fastdfs [root@node101 ~]# [root@node101 ~]# [root@node101 ~]# sed -i s'#base_path=/home/yuqing/fastdfs#base_path=/home/yinzhengjie/fastdfs/data/fdfs_tracker#' /etc/fdfs/tracker.conf [root@node101 ~]# [root@node101 ~]# grep base_path /etc/fdfs/tracker.conf base_path=/home/yinzhengjie/fastdfs/data/fdfs_tracker [root@node101 ~]# [root@node101 ~]#
[root@node101 ~]# grep base_path /etc/fdfs/storage.conf | grep -v ^# base_path=/home/yuqing/fastdfs [root@node101 ~]# [root@node101 ~]# [root@node101 ~]# sed -i s'#base_path=/home/yuqing/fastdfs#base_path=/home/yinzhengjie/fastdfs/data/fdfs_storage#' /etc/fdfs/storage.conf [root@node101 ~]# [root@node101 ~]# grep base_path /etc/fdfs/storage.conf | grep -v ^# base_path=/home/yinzhengjie/fastdfs/data/fdfs_storage [root@node101 ~]# [root@node101 ~]#
[root@node101 ~]# grep store_path0 /etc/fdfs/storage.conf | grep -v ^# store_path0=/home/yuqing/fastdfs [root@node101 ~]# [root@node101 ~]# [root@node101 ~]# sed -i s'#store_path0=/home/yuqing/fastdfs#store_path0=/home/yinzhengjie/fastdfs/data/fdfs_storage/store#' /etc/fdfs/storage.conf [root@node101 ~]# [root@node101 ~]# grep store_path0 /etc/fdfs/storage.conf | grep -v ^# store_path0=/home/yinzhengjie/fastdfs/data/fdfs_storage/store [root@node101 ~]# [root@node101 ~]#
[root@node101 ~]# grep tracker_server /etc/fdfs/storage.conf | grep -v ^# tracker_server=192.168.209.121:22122 [root@node101 ~]# [root@node101 ~]# [root@node101 ~]# sed -i s'#tracker_server=192.168.209.121:22122#tracker_server=node101.yinzhengjie.org.cn:22122\ntracker_server=node102.yinzhengjie.org.cn:22122\n#' /etc/fdfs/storage.conf [root@node101 ~]# [root@node101 ~]# grep tracker_server /etc/fdfs/storage.conf | grep -v ^# tracker_server=node101.yinzhengjie.org.cn:22122 tracker_server=node102.yinzhengjie.org.cn:22122 [root@node101 ~]# [root@node101 ~]#
[root@node101 ~]# scp /etc/fdfs/tracker.conf /etc/fdfs/storage.conf node102.yinzhengjie.org.cn:/etc/fdfs/ #将node101.yinzhengjie.org.cn的配置同步到node102.yinzhengjie.org.cn上去! tracker.conf 100% 7412 8.9MB/s 00:00 storage.conf 100% 8039 13.1MB/s 00:00 [root@node101 ~]# [root@node101 ~]# ssh node102.yinzhengjie.org.cn Last login: Tue Feb 19 18:46:47 2019 from node101.yinzhengjie.org.cn [root@node102 ~]# [root@node102 ~]# [root@node102 ~]# cat /etc/redhat-release CentOS Linux release 7.6.1810 (Core) [root@node102 ~]# [root@node102 ~]# hostname node102.yinzhengjie.org.cn [root@node102 ~]# [root@node102 ~]# [root@node102 ~]# grep base_path /etc/fdfs/tracker.conf base_path=/home/yinzhengjie/fastdfs/data/fdfs_tracker [root@node102 ~]# [root@node102 ~]# grep base_path /etc/fdfs/storage.conf | grep -v ^# base_path=/home/yinzhengjie/fastdfs/data/fdfs_storage [root@node102 ~]# [root@node102 ~]# grep store_path0 /etc/fdfs/storage.conf | grep -v ^# store_path0=/home/yinzhengjie/fastdfs/data/fdfs_storage/store [root@node102 ~]# [root@node102 ~]# grep tracker_server /etc/fdfs/storage.conf | grep -v ^# tracker_server=node101.yinzhengjie.org.cn:22122 tracker_server=node102.yinzhengjie.org.cn:22122 [root@node102 ~]#
[root@node102 ~]# diff /etc/fdfs/storage.conf /etc/fdfs/storage.conf.sample 41c41 < base_path=/home/yinzhengjie/fastdfs/data/fdfs_storage --- > base_path=/home/yuqing/fastdfs 109c109 < store_path0=/home/yinzhengjie/fastdfs/data/fdfs_storage/store --- > store_path0=/home/yuqing/fastdfs 118,120c118 < tracker_server=node101.yinzhengjie.org.cn:22122 < tracker_server=node102.yinzhengjie.org.cn:22122 < --- > tracker_server=192.168.209.121:22122 [root@node102 ~]#
[root@node102 ~]# diff /etc/fdfs/tracker.conf /etc/fdfs/tracker.conf.sample 22c22 < base_path=/home/yinzhengjie/fastdfs/data/fdfs_tracker --- > base_path=/home/yuqing/fastdfs [root@node102 ~]# [root@node102 ~]#
7>.在各个节点上启动FastDFS服务
[root@node102 ~]# yum -y install net-tools Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.aliyun.com * extras: mirrors.aliyun.com * updates: mirrors.huaweicloud.com Resolving Dependencies --> Running transaction check ---> Package net-tools.x86_64 0:2.0-0.24.20131004git.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved =================================================================================================================================================================================================================== Package Arch Version Repository Size =================================================================================================================================================================================================================== Installing: net-tools x86_64 2.0-0.24.20131004git.el7 base 306 k Transaction Summary =================================================================================================================================================================================================================== Install 1 Package Total download size: 306 k Installed size: 918 k Downloading packages: net-tools-2.0-0.24.20131004git.el7.x86_64.rpm | 306 kB 00:00:00 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : net-tools-2.0-0.24.20131004git.el7.x86_64 1/1 Verifying : net-tools-2.0-0.24.20131004git.el7.x86_64 1/1 Installed: net-tools.x86_64 0:2.0-0.24.20131004git.el7 Complete! [root@node102 ~]#
[root@node101 ~]# /etc/init.d/fdfs_trackerd start Reloading systemd: [ OK ] Starting fdfs_trackerd (via systemctl): [ OK ] [root@node101 ~]# [root@node101 ~]# mkdir -pv /home/yinzhengjie/fastdfs/data/fdfs_storage/store/data #这个目录需要我们手动创建一下,否则启动时日志会报错! mkdir: created directory ‘/home/yinzhengjie/fastdfs/data/fdfs_storage/store’ mkdir: created directory ‘/home/yinzhengjie/fastdfs/data/fdfs_storage/store/data’ [root@node101 ~]# [root@node101 ~]# /etc/init.d/fdfs_storaged start Starting fdfs_storaged (via systemctl): [ OK ] [root@node101 ~]# [root@node101 ~]# [root@node101 ~]# netstat -untalp | grep fdfs tcp 0 0 0.0.0.0:22122 0.0.0.0:* LISTEN 11694/fdfs_trackerd tcp 0 0 0.0.0.0:23000 0.0.0.0:* LISTEN 12189/fdfs_storaged tcp 0 0 172.30.1.101:49142 172.30.1.102:22122 ESTABLISHED 11694/fdfs_trackerd tcp 0 0 172.30.1.101:51268 172.30.1.102:23000 ESTABLISHED 12189/fdfs_storaged tcp 0 0 172.30.1.101:54588 172.30.1.101:22122 ESTABLISHED 12189/fdfs_storaged tcp 0 0 172.30.1.101:23000 172.30.1.102:37686 ESTABLISHED 12189/fdfs_storaged tcp 0 0 172.30.1.101:22122 172.30.1.102:59616 ESTABLISHED 11694/fdfs_trackerd tcp 0 0 172.30.1.101:22122 172.30.1.101:54588 ESTABLISHED 11694/fdfs_trackerd tcp 0 0 172.30.1.101:49102 172.30.1.102:22122 ESTABLISHED 12189/fdfs_storaged [root@node101 ~]# [root@node101 ~]# [root@node101 ~]# netstat -untalp | grep 23000 tcp 0 0 0.0.0.0:23000 0.0.0.0:* LISTEN 12189/fdfs_storaged tcp 0 0 172.30.1.101:51268 172.30.1.102:23000 ESTABLISHED 12189/fdfs_storaged tcp 0 0 172.30.1.101:23000 172.30.1.102:37686 ESTABLISHED 12189/fdfs_storaged [root@node101 ~]# [root@node101 ~]# netstat -untalp | grep 22122 tcp 0 0 0.0.0.0:22122 0.0.0.0:* LISTEN 11694/fdfs_trackerd tcp 0 0 172.30.1.101:49142 172.30.1.102:22122 ESTABLISHED 11694/fdfs_trackerd tcp 0 0 172.30.1.101:54588 172.30.1.101:22122 ESTABLISHED 12189/fdfs_storaged tcp 0 0 172.30.1.101:22122 172.30.1.102:59616 ESTABLISHED 11694/fdfs_trackerd tcp 0 0 172.30.1.101:22122 172.30.1.101:54588 ESTABLISHED 11694/fdfs_trackerd tcp 0 0 172.30.1.101:49102 172.30.1.102:22122 ESTABLISHED 12189/fdfs_storaged [root@node101 ~]# [root@node101 ~]#
[root@node102 ~]# /etc/init.d/fdfs_trackerd start
Reloading systemd: [ OK ]
Starting fdfs_trackerd (via systemctl): [ OK ]
[root@node102 ~]#
[root@node102 ~]# mkdir -pv /home/yinzhengjie/fastdfs/data/fdfs_storage/store/data mkdir: created directory ‘/home/yinzhengjie/fastdfs/data/fdfs_storage/store’ mkdir: created directory ‘/home/yinzhengjie/fastdfs/data/fdfs_storage/store/data’ [root@node102 ~]# [root@node102 ~]# /etc/init.d/fdfs_storaged start Starting fdfs_storaged (via systemctl): [ OK ] [root@node102 ~]#
[root@node101 ~]# tail -1000f /home/yinzhengjie/fastdfs/data/fdfs_tracker/logs/trackerd.log [2019-02-19 19:30:33] INFO - FastDFS v5.11, base_path=/home/yinzhengjie/fastdfs/data/fdfs_tracker, run_by_group=, run_by_user=, connect_timeout=30s, network_timeout=60s, port=22122, bind_addr=, max_connections=256, accept_threads=1, work_threads=4, min_buff_size=8192, max_buff_size=131072, store_lookup=2, store_group=, store_server=0, store_path=0, reserved_storage_space=10.00%, 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, trunk_create_file_advance=0, trunk_create_file_time_base=02:00, trunk_create_file_interval=86400, trunk_create_file_space_threshold=20 GB, trunk_init_check_occupying=0, trunk_init_reload_from_binlog=0, trunk_compress_binlog_min_interval=0, use_storage_id=0, id_type_in_filename=ip, storage_id_count=0, rotate_error_log=0, error_log_rotate_time=00:00, rotate_error_log_size=0, log_file_keep_days=0, store_slave_file_use_link=0, use_connection_pool=0, g_connection_pool_max_idle_time=3600s [2019-02-19 19:43:24] ERROR - file: tracker_service.c, line: 597, client ip: 172.30.1.101, invalid group_name: group1 [2019-02-19 19:43:24] ERROR - file: tracker_service.c, line: 893, client ip: 172.30.1.102, leader 172.30.1.102:22122 not exist [2019-02-19 19:43:25] INFO - file: tracker_mem.c, line: 4217, sys files loaded from tracker server 172.30.1.102:22122 [2019-02-19 19:43:26] INFO - file: tracker_relationship.c, line: 389, selecting leader... [2019-02-19 19:43:31] INFO - file: tracker_relationship.c, line: 389, selecting leader... [2019-02-19 19:43:32] INFO - file: tracker_relationship.c, line: 389, selecting leader... [2019-02-19 19:43:33] INFO - file: tracker_relationship.c, line: 389, selecting leader... [2019-02-19 19:43:34] INFO - file: tracker_service.c, line: 979, the tracker leader is 172.30.1.102:22122 [2019-02-19 19:50:50] ERROR - file: tracker_service.c, line: 611, client ip: 172.30.1.102, group_name: group1, storage server: 172.30.1.102 not exist [2019-02-19 19:50:53] WARNING - file: tracker_mem.c, line: 4754, storage server: 172.30.1.102:23000, dest status: 2, my status: 1, should change my status! [2019-02-19 19:50:53] WARNING - file: tracker_mem.c, line: 4754, storage server: 172.30.1.102:23000, dest status: 5, my status: 2, should change my status!
[root@node102 ~]# tail -1000f /home/yinzhengjie/fastdfs/data/fdfs_storage/logs/storaged.log [2019-02-19 19:50:48] INFO - FastDFS v5.11, base_path=/home/yinzhengjie/fastdfs/data/fdfs_storage, 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, accept_threads=1, 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=2, 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, file_signature_method=hash, FDHT group count=0, FDHT server count=0, FDHT key_namespace=, FDHT keep_alive=0, HTTP server port=8888, domain name=, use_access_log=0, rotate_access_log=0, access_log_rotate_time=00:00, rotate_error_log=0, error_log_rotate_time=00:00, rotate_access_log_size=0, rotate_error_log_size=0, log_file_keep_days=0, file_sync_skip_invalid_record=0, use_connection_pool=0, g_connection_pool_max_idle_time=3600s data path: /home/yinzhengjie/fastdfs/data/fdfs_storage/store/data, mkdir sub dir... mkdir data path: 00 ... mkdir data path: 01 ... mkdir data path: 02 ... mkdir data path: 03 ... mkdir data path: 04 ... mkdir data path: 05 ... mkdir data path: 06 ... mkdir data path: 07 ... mkdir data path: 08 ... mkdir data path: 09 ... mkdir data path: 0A ... mkdir data path: 0B ... mkdir data path: 0C ... mkdir data path: 0D ... mkdir data path: 0E ... mkdir data path: 0F ... mkdir data path: 10 ... mkdir data path: 11 ... mkdir data path: 12 ... mkdir data path: 13 ... mkdir data path: 14 ... mkdir data path: 15 ... mkdir data path: 16 ... mkdir data path: 17 ... mkdir data path: 18 ... mkdir data path: 19 ... mkdir data path: 1A ... mkdir data path: 1B ... mkdir data path: 1C ... mkdir data path: 1D ... mkdir data path: 1E ... mkdir data path: 1F ... mkdir data path: 20 ... mkdir data path: 21 ... mkdir data path: 22 ... mkdir data path: 23 ... mkdir data path: 24 ... mkdir data path: 25 ... mkdir data path: 26 ... mkdir data path: 27 ... mkdir data path: 28 ... mkdir data path: 29 ... mkdir data path: 2A ... mkdir data path: 2B ... mkdir data path: 2C ... mkdir data path: 2D ... mkdir data path: 2E ... mkdir data path: 2F ... mkdir data path: 30 ... mkdir data path: 31 ... mkdir data path: 32 ... mkdir data path: 33 ... mkdir data path: 34 ... mkdir data path: 35 ... mkdir data path: 36 ... mkdir data path: 37 ... mkdir data path: 38 ... mkdir data path: 39 ... mkdir data path: 3A ... mkdir data path: 3B ... mkdir data path: 3C ... mkdir data path: 3D ... mkdir data path: 3E ... mkdir data path: 3F ... mkdir data path: 40 ... mkdir data path: 41 ... mkdir data path: 42 ... mkdir data path: 43 ... mkdir data path: 44 ... mkdir data path: 45 ... mkdir data path: 46 ... mkdir data path: 47 ... mkdir data path: 48 ... mkdir data path: 49 ... mkdir data path: 4A ... mkdir data path: 4B ... mkdir data path: 4C ... mkdir data path: 4D ... mkdir data path: 4E ... mkdir data path: 4F ... mkdir data path: 50 ... mkdir data path: 51 ... mkdir data path: 52 ... mkdir data path: 53 ... mkdir data path: 54 ... mkdir data path: 55 ... mkdir data path: 56 ... mkdir data path: 57 ... mkdir data path: 58 ... mkdir data path: 59 ... mkdir data path: 5A ... mkdir data path: 5B ... mkdir data path: 5C ... mkdir data path: 5D ... mkdir data path: 5E ... mkdir data path: 5F ... mkdir data path: 60 ... mkdir data path: 61 ... mkdir data path: 62 ... mkdir data path: 63 ... mkdir data path: 64 ... mkdir data path: 65 ... mkdir data path: 66 ... mkdir data path: 67 ... mkdir data path: 68 ... mkdir data path: 69 ... mkdir data path: 6A ... mkdir data path: 6B ... mkdir data path: 6C ... mkdir data path: 6D ... mkdir data path: 6E ... mkdir data path: 6F ... mkdir data path: 70 ... mkdir data path: 71 ... mkdir data path: 72 ... mkdir data path: 73 ... mkdir data path: 74 ... mkdir data path: 75 ... mkdir data path: 76 ... mkdir data path: 77 ... mkdir data path: 78 ... mkdir data path: 79 ... mkdir data path: 7A ... mkdir data path: 7B ... mkdir data path: 7C ... mkdir data path: 7D ... mkdir data path: 7E ... mkdir data path: 7F ... mkdir data path: 80 ... mkdir data path: 81 ... mkdir data path: 82 ... mkdir data path: 83 ... mkdir data path: 84 ... mkdir data path: 85 ... mkdir data path: 86 ... mkdir data path: 87 ... mkdir data path: 88 ... mkdir data path: 89 ... mkdir data path: 8A ... mkdir data path: 8B ... mkdir data path: 8C ... mkdir data path: 8D ... mkdir data path: 8E ... mkdir data path: 8F ... mkdir data path: 90 ... mkdir data path: 91 ... mkdir data path: 92 ... mkdir data path: 93 ... mkdir data path: 94 ... mkdir data path: 95 ... mkdir data path: 96 ... mkdir data path: 97 ... mkdir data path: 98 ... mkdir data path: 99 ... mkdir data path: 9A ... mkdir data path: 9B ... mkdir data path: 9C ... mkdir data path: 9D ... mkdir data path: 9E ... mkdir data path: 9F ... mkdir data path: A0 ... mkdir data path: A1 ... mkdir data path: A2 ... mkdir data path: A3 ... mkdir data path: A4 ... mkdir data path: A5 ... mkdir data path: A6 ... mkdir data path: A7 ... mkdir data path: A8 ... mkdir data path: A9 ... mkdir data path: AA ... mkdir data path: AB ... mkdir data path: AC ... mkdir data path: AD ... mkdir data path: AE ... mkdir data path: AF ... mkdir data path: B0 ... mkdir data path: B1 ... mkdir data path: B2 ... mkdir data path: B3 ... mkdir data path: B4 ... mkdir data path: B5 ... mkdir data path: B6 ... mkdir data path: B7 ... mkdir data path: B8 ... mkdir data path: B9 ... mkdir data path: BA ... mkdir data path: BB ... mkdir data path: BC ... mkdir data path: BD ... mkdir data path: BE ... mkdir data path: BF ... mkdir data path: C0 ... mkdir data path: C1 ... mkdir data path: C2 ... mkdir data path: C3 ... mkdir data path: C4 ... mkdir data path: C5 ... mkdir data path: C6 ... mkdir data path: C7 ... mkdir data path: C8 ... mkdir data path: C9 ... mkdir data path: CA ... mkdir data path: CB ... mkdir data path: CC ... mkdir data path: CD ... mkdir data path: CE ... mkdir data path: CF ... mkdir data path: D0 ... mkdir data path: D1 ... mkdir data path: D2 ... mkdir data path: D3 ... mkdir data path: D4 ... mkdir data path: D5 ... mkdir data path: D6 ... mkdir data path: D7 ... mkdir data path: D8 ... mkdir data path: D9 ... mkdir data path: DA ... mkdir data path: DB ... mkdir data path: DC ... mkdir data path: DD ... mkdir data path: DE ... mkdir data path: DF ... mkdir data path: E0 ... mkdir data path: E1 ... mkdir data path: E2 ... mkdir data path: E3 ... mkdir data path: E4 ... mkdir data path: E5 ... mkdir data path: E6 ... mkdir data path: E7 ... mkdir data path: E8 ... mkdir data path: E9 ... mkdir data path: EA ... mkdir data path: EB ... mkdir data path: EC ... mkdir data path: ED ... mkdir data path: EE ... mkdir data path: EF ... mkdir data path: F0 ... mkdir data path: F1 ... mkdir data path: F2 ... mkdir data path: F3 ... mkdir data path: F4 ... mkdir data path: F5 ... mkdir data path: F6 ... mkdir data path: F7 ... mkdir data path: F8 ... mkdir data path: F9 ... mkdir data path: FA ... mkdir data path: FB ... mkdir data path: FC ... mkdir data path: FD ... mkdir data path: FE ... mkdir data path: FF ... data path: /home/yinzhengjie/fastdfs/data/fdfs_storage/store/data, mkdir sub dir done. [2019-02-19 19:50:51] INFO - file: storage_param_getter.c, line: 191, use_storage_id=0, id_type_in_filename=ip, storage_ip_changed_auto_adjust=1, store_path=0, reserved_storage_space=10.00%, use_trunk_file=0, slot_min_size=256, slot_max_size=16 MB, trunk_file_size=64 MB, trunk_create_file_advance=0, trunk_create_file_time_base=02:00, trunk_create_file_interval=86400, trunk_create_file_space_threshold=20 GB, trunk_init_check_occupying=0, trunk_init_reload_from_binlog=0, trunk_compress_binlog_min_interval=0, store_slave_file_use_link=0 [2019-02-19 19:50:51] INFO - file: storage_func.c, line: 257, tracker_client_ip: 172.30.1.102, my_server_id_str: 172.30.1.102, g_server_id_in_filename: 1711349420 [2019-02-19 19:50:51] ERROR - file: tracker_proto.c, line: 48, server: 172.30.1.101:22122, response status 2 != 0 [2019-02-19 19:50:51] ERROR - file: tracker_client_thread.c, line: 2377, fdfs_recv_response fail, result: 2 [2019-02-19 19:50:51] ERROR - file: tracker_proto.c, line: 48, server: 172.30.1.102:22122, response status 2 != 0 [2019-02-19 19:50:51] ERROR - file: tracker_client_thread.c, line: 2377, fdfs_recv_response fail, result: 2 [2019-02-19 19:50:51] INFO - file: tracker_client_thread.c, line: 310, successfully connect to tracker server 172.30.1.102:22122, as a tracker client, my ip is 172.30.1.102 [2019-02-19 19:50:51] INFO - file: tracker_client_thread.c, line: 1947, tracker server: #0. 172.30.1.101:22122, my_report_status: -1 [2019-02-19 19:50:51] INFO - file: tracker_client_thread.c, line: 1263, tracker server 172.30.1.102:22122, set tracker leader: 172.30.1.102:22122 [2019-02-19 19:50:51] INFO - file: storage_sync.c, line: 2732, successfully connect to storage server 172.30.1.101:23000 [2019-02-19 19:50:52] INFO - file: tracker_client_thread.c, line: 310, successfully connect to tracker server 172.30.1.101:22122, as a tracker client, my ip is 172.30.1.102
四.FastDFS的基本使用
1>.配置FastDFS的client的配置文件
[root@node101 ~]# cp /etc/fdfs/client.conf.sample /etc/fdfs/client.conf [root@node101 ~]# [root@node101 ~]# grep base_path /etc/fdfs/client.conf base_path=/home/yuqing/fastdfs [root@node101 ~]# [root@node101 ~]# sed -i s'#base_path=/home/yuqing/fastdfs#base_path=/var/log/fastdfs_client#' /etc/fdfs/client.conf #配置日志的存放路径 [root@node101 ~]# [root@node101 ~]# grep base_path /etc/fdfs/client.conf base_path=/var/log/fastdfs_client [root@node101 ~]# [root@node101 ~]# grep tracker_server= /etc/fdfs/client.conf | grep -v ^# tracker_server=192.168.0.197:22122 [root@node101 ~]# [root@node101 ~]# [root@node101 ~]# sed -i s'#tracker_server=192.168.0.197:22122#tracker_server=node101.yinzhengjie.org.cn:22122\ntracker_server=node102.yinzhengjie.org.cn:22122#' /etc/fdfs/client.conf #配置Tracker地址 [root@node101 ~]# [root@node101 ~]# grep tracker_server= /etc/fdfs/client.conf | grep -v ^# tracker_server=node101.yinzhengjie.org.cn:22122 tracker_server=node102.yinzhengjie.org.cn:22122 [root@node101 ~]# [root@node101 ~]# mkdir /var/log/fastdfs_client #这一步骤必须做,如果该目录不存在的话,我们在下一步测试上传文件时会报错! [root@node101 ~]#
2>.上传文件到FastDFS
[root@node101 ~]# fdfs_upload_file /etc/fdfs/client.conf /etc/passwd group1/M00/00/00/rB4BZVxr8omAKBoWAAAEXu7xndU2260655 #注意,这里返回的值就是fastDFS存储路径 [root@node101 ~]# [root@node101 ~]#
3>.下载文件到本地
[root@node101 ~]# fdfs_download_file /etc/fdfs/client.conf group1/M00/00/00/rB4BZVxr8omAKBoWAAAEXu7xndU2260655 [root@node101 ~]# [root@node101 ~]# md5sum rB4BZVxr8omAKBoWAAAEXu7xndU2260655 b8e310865d07d9d3a9eac16f6c5547ee rB4BZVxr8omAKBoWAAAEXu7xndU2260655 [root@node101 ~]# [root@node101 ~]# md5sum /etc/passwd #我们会发现文件的内容并没有被修改! b8e310865d07d9d3a9eac16f6c5547ee /etc/passwd [root@node101 ~]#
[root@node101 ~]# ls /home/yinzhengjie/fastdfs/data/fdfs_storage/store/data/00/00/rB4BZVxr8omAKBoWAAAEXu7xndU2260655 /home/yinzhengjie/fastdfs/data/fdfs_storage/store/data/00/00/rB4BZVxr8omAKBoWAAAEXu7xndU2260655 [root@node101 ~]# [root@node101 ~]# md5sum /home/yinzhengjie/fastdfs/data/fdfs_storage/store/data/00/00/rB4BZVxr8omAKBoWAAAEXu7xndU2260655 b8e310865d07d9d3a9eac16f6c5547ee /home/yinzhengjie/fastdfs/data/fdfs_storage/store/data/00/00/rB4BZVxr8omAKBoWAAAEXu7xndU2260655 [root@node101 ~]# [root@node101 ~]# md5sum /etc/passwd b8e310865d07d9d3a9eac16f6c5547ee /etc/passwd [root@node101 ~]# [root@node101 ~]# cat /home/yinzhengjie/fastdfs/data/fdfs_storage/store/data/00/00/rB4BZVxr8omAKBoWAAAEXu7xndU2260655 root:x:0:0:root:/root:/bin/bash bin:x:1:1:bin:/bin:/sbin/nologin daemon:x:2:2:daemon:/sbin:/sbin/nologin adm:x:3:4:adm:/var/adm:/sbin/nologin lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin sync:x:5:0:sync:/sbin:/bin/sync shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown halt:x:7:0:halt:/sbin:/sbin/halt mail:x:8:12:mail:/var/spool/mail:/sbin/nologin operator:x:11:0:operator:/root:/sbin/nologin games:x:12:100:games:/usr/games:/sbin/nologin ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin nobody:x:99:99:Nobody:/:/sbin/nologin systemd-network:x:192:192:systemd Network Management:/:/sbin/nologin dbus:x:81:81:System message bus:/:/sbin/nologin polkitd:x:999:998:User for polkitd:/:/sbin/nologin sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin postfix:x:89:89::/var/spool/postfix:/sbin/nologin chrony:x:998:996::/var/lib/chrony:/sbin/nologin yinzhengjie:x:1000:1000:Jason Yin:/home/yinzhengjie:/bin/bash ntp:x:38:38::/etc/ntp:/sbin/nologin mysql:x:27:27:MySQL Server:/var/lib/mysql:/bin/false gluster:x:997:994:GlusterFS daemons:/run/gluster:/sbin/nologin rpc:x:32:32:Rpcbind Daemon:/var/lib/rpcbind:/sbin/nologin [root@node101 ~]#
4>.查询文件信息
[root@node101 ~]# fdfs_file_info /etc/fdfs/client.conf group1/M00/00/00/rB4BZVxr8omAKBoWAAAEXu7xndU2260655 source storage id: 0 source ip address: 172.30.1.101 file create timestamp: 2019-02-19 20:11:53 file size: 1118 file crc32: 4008811989 (0xEEF19DD5) [root@node101 ~]#
5>.给某个文件追加内容
[root@node101 ~]# [root@node101 ~]# echo "尹正杰到此一游!" > 1.txt [root@node101 ~]# [root@node101 ~]# echo "Jason Yin" > 2.txt [root@node101 ~]# [root@node101 ~]# cat 1.txt 尹正杰到此一游! [root@node101 ~]# [root@node101 ~]# cat 2.txt Jason Yin [root@node101 ~]# [root@node101 ~]# fdfs_upload_appender /etc/fdfs/client.conf 1.txt group1/M00/00/00/rB4BZVxr9pOEPLVbAAAAAEM-3fw595.txt [root@node101 ~]# [root@node101 ~]# fdfs_append_file /etc/fdfs/client.conf group1/M00/00/00/rB4BZVxr9pOEPLVbAAAAAEM-3fw595.txt 2.txt #我们这里吧2.txt的内容追加到了1.txt中! [root@node101 ~]# [root@node101 ~]# fdfs_download_file /etc/fdfs/client.conf group1/M00/00/00/rB4BZVxr9pOEPLVbAAAAAEM-3fw595.txt [root@node101 ~]# [root@node101 ~]# cat rB4BZVxr9pOEPLVbAAAAAEM-3fw595.txt 尹正杰到此一游! Jason Yin [root@node101 ~]#
6>.删除文件
[root@node101 ~]# [root@node101 ~]# fdfs_file_info /etc/fdfs/client.conf group1/M00/00/00/rB4BZVxr9pOEPLVbAAAAAEM-3fw595.txt #我们已经确认该文件已经存在,使用下面的命令删除该文件后就无法查看到该文件的信息啦! source storage id: 0 source ip address: 172.30.1.101 file create timestamp: 2019-02-19 20:30:13 file size: 35 file crc32: 1128193532 (0x433EDDFC) [root@node101 ~]# [root@node101 ~]# [root@node101 ~]# fdfs_delete_file /etc/fdfs/client.conf group1/M00/00/00/rB4BZVxr9pOEPLVbAAAAAEM-3fw595.txt #删除FastDFS中已经存在的文件 [root@node101 ~]# [root@node101 ~]# [root@node101 ~]# fdfs_file_info /etc/fdfs/client.conf group1/M00/00/00/rB4BZVxr9pOEPLVbAAAAAEM-3fw595.txt [2019-02-19 20:34:42] ERROR - file: tracker_proto.c, line: 48, server: 172.30.1.101:23000, response status 2 != 0 [2019-02-19 20:34:42] ERROR - file: ../client/storage_client.c, line: 372, fdfs_recv_response fail, result: 2 query file info fail, error no: 2, error info: No such file or directory [root@node101 ~]# [root@node101 ~]#
7>.监控FastDFS集群信息
[root@node101 ~]# fdfs_monitor /etc/fdfs/client.conf [2019-02-19 20:35:52] DEBUG - base_path=/var/log/fastdfs_client, connect_timeout=30, network_timeout=60, tracker_server_count=2, anti_steal_token=0, anti_steal_secret_key length=0, use_connection_pool=0, g_connection_pool_max_idle_time=3600s, use_storage_id=0, storage server id count: 0 server_count=2, server_index=1 tracker server is 172.30.1.102:22122 group count: 1 Group 1: group name = group1 disk total space = 11502 MB disk free space = 10597 MB trunk free space = 0 MB storage server count = 2 active server count = 2 storage server port = 23000 storage HTTP port = 8888 store path count = 1 subdir count per path = 256 current write server index = 0 current trunk file id = 0 Storage 1: id = 172.30.1.101 ip_addr = 172.30.1.101 (node101.yinzhengjie.org.cn) ACTIVE http domain = version = 5.11 join time = 2019-02-19 19:30:39 up time = 2019-02-19 19:43:21 total storage = 11502 MB free storage = 10597 MB upload priority = 10 store_path_count = 1 subdir_count_per_path = 256 storage_port = 23000 storage_http_port = 8888 current_write_path = 0 source storage id = if_trunk_server = 0 connection.alloc_count = 256 connection.current_count = 1 connection.max_count = 2 total_upload_count = 3 success_upload_count = 3 total_append_count = 1 success_append_count = 1 total_modify_count = 0 success_modify_count = 0 total_truncate_count = 0 success_truncate_count = 0 total_set_meta_count = 0 success_set_meta_count = 0 total_delete_count = 1 success_delete_count = 1 total_download_count = 2 success_download_count = 2 total_get_meta_count = 0 success_get_meta_count = 0 total_create_link_count = 0 success_create_link_count = 0 total_delete_link_count = 0 success_delete_link_count = 0 total_upload_bytes = 1153 success_upload_bytes = 1153 total_append_bytes = 10 success_append_bytes = 10 total_modify_bytes = 0 success_modify_bytes = 0 stotal_download_bytes = 1153 success_download_bytes = 1153 total_sync_in_bytes = 35 success_sync_in_bytes = 35 total_sync_out_bytes = 0 success_sync_out_bytes = 0 total_file_open_count = 8 success_file_open_count = 8 total_file_read_count = 2 success_file_read_count = 2 total_file_write_count = 6 success_file_write_count = 6 last_heart_beat_time = 2019-02-19 20:35:27 last_source_update = 2019-02-19 20:34:38 last_sync_update = 2019-02-19 20:27:10 last_synced_timestamp = 2019-02-19 20:27:01 (0s delay) Storage 2: id = 172.30.1.102 ip_addr = 172.30.1.102 (node102.yinzhengjie.org.cn) ACTIVE http domain = version = 5.11 join time = 2019-02-19 19:30:15 up time = 2019-02-19 19:50:48 total storage = 11502 MB free storage = 10597 MB upload priority = 10 store_path_count = 1 subdir_count_per_path = 256 storage_port = 23000 storage_http_port = 8888 current_write_path = 0 source storage id = 172.30.1.101 if_trunk_server = 0 connection.alloc_count = 256 connection.current_count = 1 connection.max_count = 2 total_upload_count = 2 success_upload_count = 2 total_append_count = 0 success_append_count = 0 total_modify_count = 0 success_modify_count = 0 total_truncate_count = 0 success_truncate_count = 0 total_set_meta_count = 0 success_set_meta_count = 0 total_delete_count = 0 success_delete_count = 0 total_download_count = 1 success_download_count = 1 total_get_meta_count = 0 success_get_meta_count = 0 total_create_link_count = 0 success_create_link_count = 0 total_delete_link_count = 0 success_delete_link_count = 0 total_upload_bytes = 35 success_upload_bytes = 35 total_append_bytes = 0 success_append_bytes = 0 total_modify_bytes = 0 success_modify_bytes = 0 stotal_download_bytes = 10 success_download_bytes = 10 total_sync_in_bytes = 1163 success_sync_in_bytes = 1163 total_sync_out_bytes = 0 success_sync_out_bytes = 0 total_file_open_count = 7 success_file_open_count = 7 total_file_read_count = 1 success_file_read_count = 1 total_file_write_count = 6 success_file_write_count = 6 last_heart_beat_time = 2019-02-19 20:35:30 last_source_update = 2019-02-19 20:27:01 last_sync_update = 2019-02-19 20:34:44 last_synced_timestamp = 2019-02-19 20:34:38 (0s delay) [root@node101 ~]# [root@node101 ~]#