FastDFS安装与使用
来源:互联网 发布:淘宝网妈妈装棉袄 编辑:程序博客网 时间:2024/06/09 13:55
安装注意要修改:/etc/fdfs/client.conf
vim /etc/fdfs/client.conf
base_path=/home/yuqing/fastdfs 修改为: base_path=/home/fastdfs
tracker_server=192.168.209.121:22122 修改为: tracker_server=10.201.20.237:22122
##include http.conf 修改为: #include http.conf
启动tracker服务:
/usr/local/bin/fdfs_trackerd /etc/fdfs/tracker.conf
启动storager服务:
/usr/local/bin/fdfs_storaged /etc/fdfs/storage.conf
监控:
/usr/local/bin/fdfs_monitor /etc/fdfs/storage.conf
测试上传文件
用法:Usage: fdfs_test <config_file> upload <local_filename> [FILE | BUFF | CALLBACK]
测试:
cd /home/www/
fdfs_test /etc/fdfs/client.conf upload FlexPaper.zip
FastDFS调用
<?php$tracker = fastdfs_tracker_get_connection();if(!fastdfs_active_test($tracker)){ error_log("errno: " . fastdfs_get_last_error_no() . ", error info: " . fastdfs_get_last_error_info()); exit(1);}$storage = fastdfs_tracker_query_storage_store();if(!$storage){ error_log("errno: " . fastdfs_get_last_error_no() . ", error info: " . fastdfs_get_last_error_info()); exit(1);}$original_file1 = "/data/tools/85542.jpg";$original_uploaded_info = fastdfs_storage_upload_by_filename($original_file1, null, array(), null, $tracker, $storage);print_r($original_uploaded_info);?>
返回:_Array=Array ( [group_name] => group2 [filename] => M00/00/00/ooYBAFIDdB6AZ18OAAAGJ5FjmEQ900.gif )
访问图片:http://192.168.0.115/group2/M00/00/00/ooYBAFIDdqiAbnVsAAF6R1oxgmg368.jpg
使用过程中遇到的问题:
errno: 32, error info: Broken pipe
errno: 107, error info: Transport endpoint is not connected
崩溃,php扩展这边有很多问题
happy_fish100版主请进
==============================
关于使用FastDFS做图片及其缩略图存储的一点疑惑
FastDFS 安装及使用
fastDS在sourceforge源码地址
CentOS fastDFS结合nginx的配置以及php端的调用方法
- FastDFS安装与使用
- FastDFS安装与使用
- FastDFS分布式存储安装与使用
- FastDFS安装与使用(单节点)
- fastDfs文件服务器安装配置与使用
- FastDFS的安装,配置与使用(java)
- CentOS上FastDFS安装配置与使用
- FastDFS安装与配置
- FastDFS安装与部署
- FASTDFS安装与配置
- fastdfs安装与配置
- FastDFS安装与配置
- FastDFS 安装及使用
- FastDFS 安装及使用
- FastDFS安装/使用(一)
- fastDFS安装和使用
- FastDFS 安装及使用
- FastDFS之——FastDFS 分布式文件系统的安装与使用(单节点)
- Hdu_1850 Nim博弈_求初始时有多少种走法取胜
- 记C的一个小问题
- maven多模块工程的优化原则
- HTTP/HTTPS, without index.php, using htaccess, plus XHR
- C基础:数组-打印随机数
- FastDFS安装与使用
- char s[]和char *s
- wince驱动分类
- C++ STL 的用法
- C基础:数组打印直方图
- [OpenCV] Camshiftdemo 目标跟踪
- 吐槽公司那些事
- Apache主机rewrite地址重写相关的参数
- wince驱动程序流程