导航:首页 > 编程语言 > fastdfsclientphp

fastdfsclientphp

发布时间:2022-06-01 12:20:20

❶ fastDFS求助,2个问题

回复 1# temp_hacker >>请问,如果现在开始使用FastDHT,它会自动去记录以前在FastDFS上存储的文件信息吗?不会的。>>如果不能,有没有办法让FastDHT去记录以前的存储在FastDFS上的文件呢?谢谢!如果你要自定义文件ID,可以使用定制一套client API:my-fastdfs-client。文件ID映射就是保存到FastDHT中的。如果以前已经上传了一些文件,需要你自己做个数据迁移或者重建文件ID映射。

❷ 请教关于FastDFS和FastDHT使用问题

回复1# temp_hacker >>请问,如果现在开始使用FastDHT,它会自动去记录以前在FastDFS上存储的文件信息吗?不会的。>>如果不能,有没有办法让FastDHT去记录以前的存储在FastDFS上的文件呢?谢谢!如果你要自定义文件ID,可以使用定制一套client API:my-fastdfs-client。文件ID映射就是保存到FastDHT中的。如果以前已经上传了一些文件,需要你自己做个数据迁移或者重建文件ID映射。 查看原帖>>

采纳哦

❸ 如何安装FastDFS

Google了一下,流行的开源分布式文件系统有很多,介绍如下:

mogileFS:Key-Value型元文件系统,不支持FUSE,应用程序访问它时需要API,主要用在web领域处理海量小图片,效率相比mooseFS高很多。
fastDFS:国人在mogileFS的基础上进行改进的key-value型文件系统,同样不支持FUSE,提供比mogileFS更好的性能。
mooseFS:支持FUSE,相对比较轻量级,对master服务器有单点依赖,用perl编写,性能相对较差,国内用的人比较多
glusterFS:支持FUSE,比mooseFS庞大
ceph:支持FUSE,客户端已经进入了linux-2.6.34内核,也就是说可以像ext3/rasierFS一样,选择ceph为文件系统。彻底的分布式,没有单点依赖,用C编写,性能较好。基于不成熟的btrfs,其本身也非常不成熟。
lustre:Oracle公司的企业级产品,非常庞大,对内核和ext3深度依赖
NFS:老牌网络文件系统,具体不了解,反正NFS最近几年没发展,肯定不能用。
鉴于fastDFS是国人开发,也有国内的一些大公司在使用,so…

普通的文件架构其实一两年内也是没有问题的,但有句话叫未雨绸缪,于是决定折腾折腾。
源码下载:
寻求帮助:

一、安装libevent
fastDFS需要安装libevent比较新的版本,将本机的比较低的版本卸载了。

rpm -qa libevent
libevent-1.4.13-1.el6.x86_64
rpm -e --nodeps libevent
安装一个最新稳定版

wget
tar zxvf libevent-2.0.18-stable.tar.gz
cd libevent-2.0.18-stable
./configure
make && make install
为libevent创建软链接到/lib库下,64位系统对应/lib64

ln -s /usr/local/lib/libevent* /lib/
ln -s /usr/local/lib/libevent* /lib64/
二、安装FastDFS

wget
tar zxvf FastDFS_v3.06.tar.gz
cd FastDFS
./make.sh
./make.sh install
三、配置FastDFS
环境:
tracker server
192.168.1.5
storage server
192.168.1.51
192.168.1.52

1、配置并启动 tracker server
①配置 tracker.conf

mkdir /data/fastdfs
vim /etc/fdfs/tracker.conf
base_path=/data/fastdfs
②启动 tracker

/usr/local/bin/fdfs_trackerd /etc/fdfs/tracker.conf
③开机启动

vim /etc/rc.local
/usr/local/bin/fdfs_trackerd /etc/fdfs/tracker.conf
2、配置并启动 storage server
①配置 tracker.conf

mkdir /data/fastdfs
mkdir /data/images
vim /etc/fdfs/storage.conf
base_path=/data/fastdfs
store_path0=/data/images
tracker_server=192.168.1.5:22122
②启动 tracker

/usr/local/bin/fdfs_storage /etc/fdfs/storage.conf
③开机启动

vim /etc/rc.local
/usr/local/bin/fdfs_storage /etc/fdfs/storage.conf
3、为storage节点安装fastdfs-nginx-mole模块
①安装模块
安装Nginx详见:
需重新编译Nginx

wget
tar zxvf fastdfs-nginx-mole_v1.10.tar.gz
wget
tar zxvf nginx-1.2.0.tar.gz
cd nginx-1.2.0
./configure --prefix=/usr/local/nginx --add-mole=../fastdfs-nginx-mole/src
make && make install
cd ..
②配置
编辑nginx.conf

vim /usr/local/nginx/conf/nginx.conf
server {
listen 80;
server_name localhost;

location /M00 {
alias /data/images/data;
ngx_fastdfs_mole;
}
......
}
给 storage 的存储目录做一个软连接

ln -s /data/images/data/ /data/images/data/M00
拷贝mod_fastdfs.conf 到 /etc/fdfs/

cp fastdfs-nginx-mole/src/mod_fastdfs.conf /etc/fdfs/
vim /etc/fdfs/mod_fastdfs.conf
base_path=/data/fastdfs
tracker_server=192.168.1.5:22122
store_path0=/data/images
启动nginx

/usr/local/nginx/sbin/nginx
四、使用FastDFS
1、上传文件
FastDFS安装包中,自带了客户端程序,通过程序可以进行文件上传。在使用这个客户端程序之前,首先需要配置client.conf,然后再进行文件上传及下载。
在tracker上修改客户端配置文件client.conf

vim /etc/fdfs/client.conf
base_path=/data/fastdfs
tracker_server=192.168.1.5:22122
vim a.html
This Is FastDFS Test.
上传文件

/usr/local/bin/fdfs_test /etc/fdfs/client.conf upload a.html
This is FastDFS client test program v3.06

Copyright (C) 2008, Happy Fish / YuQing

FastDFS may be copied only under the terms of the GNU General
Public License V3, which may be found in the FastDFS source kit.
Please visit the FastDFS Home Page /
for more detail.

[2012-04-29 12:42:53] INFO - base_path=/data/tracker, connect_timeout=30, network_timeout=60, tracker_server_count=1, anti_steal_token=0, anti_steal_secret_key length=0

tracker_query_storage_store_list_without_group:
server 1. group_name=group1, ip_addr=192.168.1.51, port=23000
server 2. group_name=group1, ip_addr=192.168.1.52, port=23000

group_name=group1, ip_addr=192.168.1.51, port=23000
storage_upload_by_filename
group_name=group1, remote_filename=M00/00/00/wKgBM0-cxs32qFyYAAAADigvbpc90.html
source ip address: 192.168.1.51
file timestamp=2012-04-29 12:42:53
file size=14
file crc32=674197143
file url:
storage_upload_slave_by_filename
group_name=group1, remote_filename=M00/00/00/wKgBM0-cxs32qFyYAAAADigvbpc90_big.html
source ip address: 192.168.1.51
file timestamp=2012-04-29 12:42:53
file size=14
file crc32=674197143
file url:
上传成功
试试用

访问看看吧。

看了几天了,还是有些地方不是很明白,暂时搁置,不能再浪费时间了。

❹ fastdfs在php下跑的问题

你把test.php改成<?php phpinfo();?>
然后打开,注意看下调用的 php.ini 路径

然后 执行php --info | grep php.ini 看下php.ini调用的是哪个目录?

如果phpinfo() 的php.ini 路径和 php --info里的路径不一样。修改一下
如果是php-fpm 处理php的,在启动php-fpm 的时候加上 -c 参数指定php.ini
如果是用spawn-fcgi 处理php的,启动 spawn-fcgi 加上参数 -f "php-cgi -c php.ini路径"
例如 spawn-fcgi -a 127.0.0.1 -p 10100 -C 40 -u www -g www -f "php-cgi -c /etc/php.ini"

❺ 如何用传统方式使用fastDFSClient

1. 需要使用的client类在com.github.tobato.fastdfs.service包下,而service包依赖于一些 com.github.tobato.fastdfs.domain 包下的类。
如 FastFileStorageClient、AppendFileStorageClient、GenerateStorageClient等
2. 使用代码实例

import com.github.tobato.fastdfs.domain.StorePath;
import com.github.tobato.fastdfs.service.FastFileStorageClient;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.io.File;
import java.io.FileInputStream;

@ContextConfiguration(locations = { "classpath:applicationContext.xml" })
@RunWith(SpringJUnit4ClassRunner.class)
public class FastDFSDemo extends {

@Test
public void uploadFile() throws Exception{
File file = new File("/home/hui/code/fastdfsdemo/src/test/resources/images/54af9bcdN78b67b5a.jpg");
StorePath storePath = fastFileStorageClient.uploadFile(null, new FileInputStream(file), file.length(), "jpg");
}

@Autowired
FastFileStorageClient fastFileStorageClient;

❻ FastDFS 4.05版 是不是没有了http服务

INCLUDES = -I/opt/server/php/include/php -I/opt/server/php/include/php/main -I/opt/server/php/include/php/TSRM -I/opt/server/php/include/php/Zend -I/opt/server/php/include/php/ext -I/opt/server/php/include/php/ext/date/lib -I//opt/server/fastdfs/include/fastcommon/ -I/opt/server/fastdfs/include/fastdfsvim Makefile修改了路径但是还是出现了/usr/bin/ld: cannot find -lfdfsclientcollect2: ld returned 1 exit statusmake: *** [fastdfs_client.la] Error 1

❼ nginx,fastDFS,fastDHT相关配置问题

你把test.php改成<?php phpinfo();?>
然后打开,注意看下调用的 php.ini 路径

然后 执行php --info | grep php.ini 看下php.ini调用的是哪个目录?

如果phpinfo() 的php.ini 路径和 php --info里的路径不一样。修改一下
如果是php-fpm 处理php的,在启动php-fpm 的时候加上 -c 参数指定php.ini
如果是用spawn-fcgi 处理php的,启动 spawn-fcgi 加上参数 -f "php-cgi -c php.ini路径"
例如 spawn-fcgi -a 127.0.0.1 -p 10100 -C 40 -u www -g www -f "php-cgi -c /etc/php.ini"

❽ 只想在Debina上安装phpclient,怎么安装呢

回复1#
yibin001
需要fastdfs
client
library啊!你把整个FastDFS目录拉下来,先./make.sh,然后在client目录执行安装命令,最后编译和安装php_client目录即可。
查看原帖>>
希望采纳

❾ fastdfs的client有什么作用

FastDFS是一个开源的轻量级分布式文件系统,它对文件进行管理

❿ fastdfs能在本地远程连接到服务器吗

本地开一个tracker,服务器上开一个storage,监听本地的tracker,上传数据的时候调用本地的tracker,tracker就会去把任务分配给服务器上的client,通过client把文件传送到storage里。简单的远程传送就是这个模式啦~

阅读全文

与fastdfsclientphp相关的资料

热点内容
我的世界本地服务器默认地址 浏览:131
我的世设置命令方块会闪退 浏览:968
加密媒体怎么输密码 浏览:161
方舟如何删除服务器数据 浏览:600
用阅读app怎么看18 浏览:689
gn文件编译 浏览:783
酷闪加密系统 浏览:820
区块链数据加密 浏览:389
3d命令集 浏览:289
单片机的智能产品工厂里有 浏览:300
事业单位程序员有必要去吗 浏览:583
人工智能训练小鸟python 浏览:132
怎样把两个pdf合并成一个 浏览:681
什么app带仿制图章 浏览:420
单片机CJNE什么意思 浏览:569
廊坊服务器是什么 浏览:763
客户解压要打欠条还是收据 浏览:774
通过app组件启动有什么坏处 浏览:777
不属于国产密码算法 浏览:863
单片机LED显示字库 浏览:355