1)FastDFS的简介
FastDFS是一个开源的轻量级分布式文件系统,它对文件进行管理,功能包括:文件存储、文件同步、文件访问(文件上传、文件下载)等,解决了大容量存储和负载均衡的问题。特别适合以文件为载体的在线服务,如相册网站、视频网站等等。
FastDFS为互联网量身定制,充分考虑了冗余备份、负载均衡、线性扩容等机制,并注重高可用、高性能等指标,使用FastDFS很容易搭建一套高性能的文件服务器集群提供文件上传、下载等服务。
2)FastDFS的安装步骤
2.1)安装gcc,gcc-c++,cmake,make,libevent
yum install -y gcc gcc-c++ cmake make libevent
2.2)创建文件夹
mkdir /usr/local/fastdfs
2.3)安装libfastcommon
wget https://codeload.github.com/happyfish100/libfastcommon/zip/refs/heads/master
unzip /tmp/master -d /usr/local/fastdfs
[root@NewBieSlave2 tmp]# cd /usr/local/fastdfs/
[root@NewBieSlave2 fastdfs]# ls
libfastcommon-master
[root@NewBieSlave2 fastdfs]# cd libfastcommon-master/
[root@NewBieSlave2 libfastcommon-master]# ./make.sh
.......
[root@NewBieSlave2 libfastcommon-master]# ./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 locked_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 uniq_skiplist.h fc_list.h locked_list.h json_parser.h buffered_file_writer.h server_id_func.h fc_queue.h fc_memory.h shared_buffer.h thread_pool.h fc_atomic.h /usr/include/fastcommon
[root@NewBieSlave2 libfastcommon-master]#
2.4)创建软连接
ln -s /usr/lib64/libfastcommon.so /usr/local/lib/libfastcommon.so
ln -s /usr/local/lib64/libfdfsclient.so /usr/local/lib/libfdfsclient.so
ls -s /usr/local/lib64/libfdfsclient.so /usr/lib/libfdfsclient.so