一、部署环境:(CentOS 6.9)
二,FastDFS:,开源的轻量级分布式文件系统;
,,,,三个角色:
,,,,跟踪服务器:跟踪服务器,调度,在内存中记录所有存储组和存储服务器的状态信息;跟踪。参看
,,,,存储服务器:存储服务器,文件(数据)和文件属性(元数据),一组服务器;存储。参看
,,,,客户:客户端,业务请求发起方,通过专用接口基于TCP协议与跟踪器以及存储服务器进行交互;客户端。参看
,,,,
,,,,存储:
,,,, group_name/M # #/,,/,,/file_name
,,,, group_name:存储组的组名;上传完成后,需要客户端自行保存;
,,,, M # #:服务器配置的虚拟路径,与磁盘选项store_path #对应的;
,,,,两级以两位16进制数字名字的目录;
,,,,文件名:与原文件名并不相同,由存储服务器根据特定信息生成,文件名包含:源存储服务器的IP地址,文件创建时间戳,文件大小,随机数和文件扩展名等;
三、安装
,,,, 1,安装依赖包libfastcommon
,,,, 2,安装fastDFS
,,,, 3,需要关闭iptables, selinux
,,,,
,,,, # git克隆https://github.com/happyfish200/fastdfs.git
,,,, # git克隆https://github.com/happyfish200/libfastcommon.git
,,,, # git克隆https://github.com/happyfish200/fastdfs-nginx-module.git
,,,,
,,,, mv libfastcommon libfastcommon-1.0.36
,,,,焦油zcf libfastcommon-1.0.36.tar。广州libfastcommon-1.0.36
,,,,,
,,,, mv fastdfs fastdfs-5.0.10
,,,,焦油zcf fastdfs-5.0.10.tar。广州fastdfs-5.0.10
,,,,
,,,, mkdir rpmbuild/{来源、规格}pv
,,, cp/工具/libfastcommon-1.0.36.tar。广州rpmbuild/资源/
,,, cp/工具/fastdfs-5.0.10.tar。广州rpmbuild/资源/
,,,,
,,,, cp/工具/libfastcommon-1.0.36/libfastcommon。规范rpmbuild/规格/
,,,, cp/工具/fastdfs-5.0.10/fastdfs。规范rpmbuild/规格/
,,,,
,,,, yum安装rpm-build
,,,, rpmbuild英航libfastcommon.spec
,,,, rpmbuild英航fastdfs.spec
,,,,
,,,,
,,,,焦油xzf libfastcommon_v1.23.tar。广州
,,,, cd libfastcommon
,,,,。/h
,,,,。/h安装
,,,,
,,,,焦油xzf FastDFS_v5.08.tar。广州
,,,, cd FastDFS
,,,,。/h
,,,,。/h安装
,,,,
,,,,
,,,,
,, # fdfs_upload_file。/客户端。参看/usr/share/backgrounds/centos_2048x1536_logoonly.jpg
,,,, group1/M00/00/00 CgoBalkG2PmAThTWAAD_7aV8rDY985.jpg
,,,,
,,,,
,,,,
,,,,
,,,,
,,,,
,,,,
,,,,
,,,,
,,,,
,,,,
,,,,
,,,,
,,,,
,,,,
,,,, cp/root/soft/fastdfs-nginx-module/src/mod_fastdfs。参看/etc/fdfs/
,,,,
,,, mod_fastdfs。参看重点配置项:
,,,, tracker_server=10.10.1.105:22122
,,,, url_have_group_name=true,* * *开启组名访问
,,,,
,,,, group_count=1
,,,, (group1)
,,,, group_name=group1
,,,, storage_server_port=23000
,,,, store_path_count=1
,,,, store_path0=/home/fastdfs
,,,,
,,,,
,,,,
,,,,
,,,,
,,,,
,,,,
,,,,
,,,, https://cache.yisu.com/upload/information/20200309/32/49826.jpg
,,,,