1.准备
libevent-1.4.10-stable.tar.gz
FastDFS_v4.06.tar.gz
2.安装过程
1)安装libevent
--上传libevent-1.4.10-stable.tar.gz到/usr/local/src
--解压
#tar zvxf libevent-1.4.10-stable.tar.gz
--建立makefile
#cd libevent-1.4.10-stable
#./configure
checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for gcc... no checking for cc... no checking for cl.exe... no configure: error: no acceptable C compiler found in $PATH See `config.log' for more details.
报错:原因是未安装GCC组件
解决办法:在线安装GCC组件
#yum -y install gcc
安装后重新构建makefile
--编译
#make
--安装
#make install
--安装结果
/usr/local/lib中有大量libevent文件
2)安装FASTDFS
--上传FastDFS_v4.06.tar.gz到/usr/local/src
--解压
#tar zvxf FastDFS_v4.06.tar.gz
--编译
#cd FastDFS
#./make.sh
--安装
#./make.sh install
--安装结果
/usr/local/bin 有fastdfs指令
/etc/fdfs 有fastdfs配置文件
3.配置fastdfs
1)tracker (192.168.117.100)
--创建tracker目录
#mkdir /var/fastdfs/tracker -p
--配置tracker
#vi /etc/fdfs/tracker.conf
base_path=/var/fastdfs/tracker
--将tracker启动指令设置为service
#cp /usr/local/src/FastDFS/init.d/fdfs_trackerd /etc/init.d
--启动tracker
#service fdfs_trackerd start
Starting FastDFS tracker server:
--查看状态
#service fdfs_trackerd status
fdfs_trackerd (pid 9184) is running...
#vi /var/fastdfs/tracker/logs/trackerd.log
[2015-07-05 23:01:23] INFO - FastDFS v4.06, base_path=/var/fastdfs/tracker, run_by_group=, run_by_user=, connect_timeout=30s, network_timeout=60s, port=22122, bind_addr=, max_connections=256, work_threads=4, store_lookup=2, store_group=, store_server=0, store_path=0, reserved_storage_space=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, 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, store_slave_file_use_link=0, use_connection_pool=0, g_connection_pool_max_idle_time=3600s [2015-07-05 23:01:23] INFO - local_host_ip_count: 2, 127.0.0.1 192.168.117.100
#netstat -antulp | grep 22122
tcp 0 0 0.0.0.0:22122 0.0.0.0:* LISTEN 9184/fdfs_trackerd
2)storage-1(192.168.117.100)
--创建storage目录
#mkdir /var/fastdfs/storage -p
--配置storage
#vi /etc/fdfs/storage.conf
base_path=/var/fastdfs/storage store_path0=/var/fastdfs/storage #可以指定多个tracker_server,换行写即可 tracker_server=192.168.117.100:22122
--将storage启动指令设置为service
#cp /usr/local/src/FastDFS/init.d/fdfs_storaged /etc/init.d/
--启动storage
service fdfs_storaged start
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 ... ......
创建了256X256个文件
--查看状态
#service fdfs_storaged status
fdfs_storaged (pid 9276) is running...
#vi /var/fastdfs/storage/logs/storaged.log
[2015-07-05 23:24:31] INFO - FastDFS v4.06, base_path=/var/fastdfs/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, work_threads=4, disk_rw_separated=1, disk_reader_threads=1, disk_writer_threads=1, buff_size=256KB, heart_beat_interval=30s, stat_report_interval=60s, tracker_server_count=1, sync_wait_msec=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, file_sync_skip_invalid_record=0, use_connection_pool=0, g_connection_pool_max_idle_time=3600s [2015-07-05 23:25:02] INFO - file: storage_param_getter.c, line: 187, 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, store_slave_file_use_link=0 [2015-07-05 23:25:02] INFO - file: storage_func.c, line: 174, tracker_client_ip: 192.168.117.100, my_server_id_str: 192.168.117.100, g_server_id_in_filename: 1685432512 [2015-07-05 23:25:02] INFO - local_host_ip_count: 2, 127.0.0.1 192.168.117.100 [2015-07-05 23:25:02] INFO - file: tracker_client_thread.c, line: 308, successfully connect to tracker server 192.168.117.100:22122, as a tracker client, my ip is 192.168.117.100 [2015-07-05 23:25:32] INFO - file: tracker_client_thread.c, line: 1124, tracker server 192.168.117.100:22122, set tracker leader: 192.168.117.100:22122
#netstat -antulp | grep 23000
tcp 0 0 0.0.0.0:23000 0.0.0.0:* LISTEN 9276/fdfs_storaged
3)storage-2(192.168.117.101)
和storage-1构成集群
tracker_server=192.168.117.100:22122
4.使用fdfs_upload_file测试
--配置/etc/fdfs/client.conf
base_path=/var/fastdfs/client tracker_server=192.168.117.100:22122
--上传文件
#fdfs_upload_file /etc/fdfs/client.conf client.conf
group1/M00/00/00/wKh1ZFWZY4SAFME4AAAFuCeYx8I14.conf
--结果
分别在192.168.117.100和192.168.117.101查看上传文件
#cd /var/fastdfs/storage/data/00/00
--查看fastdfs状态
fdfs_monitor /etc/fdfs/client.conf
5.参考资料
http://www.cnblogs.com/kunhu/p/3632225.html
相关推荐
fastdfs 安装及使用,里面包含了fastdfs安装需要的软件,以及java-api工程,和使用实例
fastDFS 安装文件 fastDFS 安装文件fastDFS 安装文件 fastDFS 安装文件fastDFS 安装文件 fastDFS 安装文件
fastdfs安装所有需要的程序,包括fastdfs安装包, niginx fastdfs-nginx-module libfastcommon
FastDFS安装和配置过程
FastDFS安装,包括tracker和storage安装、Nginx安装,还有FastDFS命令方式测试相关的内容
fastdfs_client_v1.24.jar 和libfastcommon-master.zip 和FastDFS_v5.05.tar.gz和fastdfs-nginx-module_v1.16.tar.gz4个文件
FastDFS和Linux下安装使用FastDFS 安装Nginx 分布式文件系统
FastDFS安装步骤(仅供自己使用)
fastdfs基本原理讲解,以及如何在linux下安装测试,对于集群的安装部署不涉及,docker安装不涉及,可参看博客内容
FastDFS安装手册,内附安装包。仅供参考,希望对大家有用。
fastdfs安装资源包。安装详解:http://blog.csdn.net/clevercode/article/details/52244358。
fastdfs 安装配置所需的安装包 FastDFS_v5.02.tar.gz fastdfs-nginx-module_v1.15.tar.gz nginx-1.4.7.tar.gz ngx_cache_purge-2.1.tar.gz pcre-8.34.tar.gz zlib-1.2.8.tar.gz 安装方法:...
Redhat下Fastdfs安装配置及nginx模块安装配置文档.pdf
linux机器上安装fastdfs需要的资源合集。本人安装过程中使用的全部安装包
fastdfs一键安装脚本,可以0配置!!!个人如果需要优化,可以自行修改配置文件
FastDFS是C语言开发的应用。安装必须使用make、cmake和gcc编译器,安装所需要的包,都在里面,自己亲测,问题随时联系
fastdfs的安装手册说明+配置文件+fastdfs安装包+nginx安装包,压缩包内是自己结合网上资料整理的fastdfs的全套配置及说明,已成功安装并运行
Java Centos7上fastdfs安装
fastDFS单机版安装教程+安装使用包,fastDFS单机版安装教程+安装使用包
fastDFS安装手册,拿走不谢。。。。。。。。。。。。。。。。。。。。。。。。。。。。。