fastdfs5.0.4安卓4.0.4平板刷机包是否能使用

当前访客身份:游客 [
当你的才华还撑不起你的野心时,那你就应该静下心来学习。当你的经济还撑不起你的梦想时,那你就应该踏实的去工作!
:请问这个在android平台如何用?知道吗
:Flash上传组件 SWFUpload?
:引用来自“买红薯”的评论 竟然没有webuploader...
:竟然没有webuploader
今日访问:38
昨日访问:51
本周访问:89
本月访问:849
所有访问:2850
fastdfs-client-java操作fastdfs5.0.4
发表于3个月前( 18:54)&&
阅读(594)&|&评论()
0人收藏此文章,
fastdfs-client-java fastdfs5.0.4上传、下载、删除
一、在&下载客户端,解压后并执行ant命令,在E:\tools\libs\fastdfs\fastdfs-client-java-master\src\build下会生成fastdfs_client.jar如图示
二、mvn安装fastdfs_client.jar,在cmd中执行命令
mvn install:install-file -DgroupId=org.csource -DartifactId=fastdfs-client-java -Dversion=5.0.4 -Dpackaging=jar -Dfile=D:\fastdfs_client.jar&
三、在eclipse中新建maven项目fastdfs-demo,在pom.xml中加入依赖如下
&project&xmlns="http://maven.apache.org/POM/4.0.0"&xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
&&xsi:schemaLocation="http://maven.apache.org/POM/4.0.0&http://maven.apache.org/xsd/maven-4.0.0.xsd"&
&&&modelVersion&4.0.0&/modelVersion&
&&&groupId&com.leech&/groupId&
&&&artifactId&fastdfs-demo&/artifactId&
&&&version&0.0.1-SNAPSHOT&/version&
&&&packaging&jar&/packaging&
&&&name&fastdfs-demo&/name&
&&&url&http://maven.apache.org&/url&
&&&properties&
&&&&&project.build.sourceEncoding&UTF-8&/project.build.sourceEncoding&
&&&/properties&
&&&dependencies&
&&&&&dependency&
&&&&&&&groupId&junit&/groupId&
&&&&&&&artifactId&junit&/artifactId&
&&&&&&&version&4.11&/version&
&&&&&&&scope&test&/scope&
&&&&&/dependency&
&&&&&dependency&
&&&&&&&groupId&org.csource&/groupId&
&&&&&&&artifactId&fastdfs-client-java&/artifactId&
&&&&&&&version&5.0.4&/version&
&&&&&/dependency&
&&&&&dependency&
&groupId&commons-io&/groupId&
&artifactId&commons-io&/artifactId&
&version&2.4&/version&
&/dependency&
&&&/dependencies&
&/project&
在src/main/resources中新建fdfs_client.conf文件,内容如下
connect_timeout = 2
network_timeout = 30
charset = UTF-8
http.tracker_http_port = 80
http.anti_steal_token = no
http.secret_key = FastDFS
tracker_server = 192.168.17.112:22122
#tracker_server = 192.168.0.119:22122
在src/main/java中创建TestFastDfs.java如下
package&com.leech.fastdfs.
import&java.io.FileNotFoundE
import&java.io.FileOutputS
import&java.io.IOE
import&java.util.UUID;
import&mons.io.IOU
import&mon.MyE
import&mon.NameValueP
import&org.csource.fastdfs.ClientG
import&org.csource.fastdfs.FileI
import&org.csource.fastdfs.StorageC
import&org.csource.fastdfs.StorageS
import&org.csource.fastdfs.TrackerC
import&org.csource.fastdfs.TrackerS
import&org.junit.A
import&org.junit.B
import&org.junit.T
public&class&TestFastDfs&{
public&String&conf_filename&=&"D:\\stsworkspace\\fastdfs-demo\\src\\main\\resources\\fdfs_client.conf";&
&&&&//public&String&local_filename&=&"D:\\stsworkspace\\fastdfs-demo\\src\\main\\resources\\fdfs_client.conf";
public&String&local_filename&=&"D:\\stsworkspace\\fastdfs-demo\\src\\main\\resources\\sprites.png";
public&void&setUp()&throws&Exception&{
public&void&tearDown()&throws&Exception&{
public&void&testUpload()&{
&&&&&&&&try&{&
&&&&&&&&&&&&ClientGlobal.init(conf_filename);
&&&&&&&&&&&&TrackerClient&tracker&=&new&TrackerClient();&
&&&&&&&&&&&&TrackerServer&trackerServer&=&tracker.getConnection();&
&&&&&&&&&&&&StorageServer&storageServer&=&
&&&&&&&&&&&&StorageClient&storageClient&=&new&StorageClient(trackerServer,&storageServer);&
//&&&&&&&&&&NameValuePair&nvp&=&new&NameValuePair("age",&"18");&
&&&&&&&&&&&&NameValuePair&nvp&[]&=&new&NameValuePair[]{&
&&&&&&&&&&&&&&&&&&&&new&NameValuePair("age",&"18"),&
&&&&&&&&&&&&&&&&&&&&new&NameValuePair("sex",&"male")&
&&&&&&&&&&&&};&
&&&&&&&&&&&&String&fileIds[]&=&storageClient.upload_file(local_filename,&"png",&nvp);
&&&&&&&&&&&&
&&&&&&&&&&&&System.out.println(fileIds.length);&
&&&&&&&&&&&&System.out.println("组名:"&+&fileIds[0]);&
&&&&&&&&&&&&System.out.println("路径:&"&+&fileIds[1]);
&&&&&&&&}&catch&(FileNotFoundException&e)&{&
&&&&&&&&&&&&e.printStackTrace();&
&&&&&&&&}&catch&(IOException&e)&{&
&&&&&&&&&&&&e.printStackTrace();&
&&&&&&&&}&catch&(MyException&e)&{&
&&&&&&&&&&&&e.printStackTrace();&
&&&&&&&&}&
&&&&public&void&testDownload()&{
&&&&&&&&try&{
&&&&&&&&&&&&ClientGlobal.init(conf_filename);
&&&&&&&&&&&&TrackerClient&tracker&=&new&TrackerClient();&
&&&&&&&&&&&&TrackerServer&trackerServer&=&tracker.getConnection();&
&&&&&&&&&&&&StorageServer&storageServer&=&
&&&&&&&&&&&&StorageClient&storageClient&=&new&StorageClient(trackerServer,&storageServer);&
&&&&&&&&&&&&byte[]&b&=&storageClient.download_file("group1",&"M00/00/00/wKgRcFV_08OAK_KCAAAA5fm_sy874.conf");&
&&&&&&&&&&&&System.out.println(b);&
&&&&&&&&&&&&IOUtils.write(b,&new&FileOutputStream("D:/"+UUID.randomUUID().toString()+".conf"));
&&&&&&&&}&catch&(Exception&e)&{&
&&&&&&&&&&&&e.printStackTrace();&
&&&&&&&&}&
&&&&@Test&
&&&&public&void&testGetFileInfo(){&
&&&&&&&&try&{&
&&&&&&&&&&&&ClientGlobal.init(conf_filename);
&&&&&&&&&&&&TrackerClient&tracker&=&new&TrackerClient();&
&&&&&&&&&&&&TrackerServer&trackerServer&=&tracker.getConnection();&
&&&&&&&&&&&&StorageServer&storageServer&=&
&&&&&&&&&&&&StorageClient&storageClient&=&new&StorageClient(trackerServer,&storageServer);&
&&&&&&&&&&&&FileInfo&fi&=&storageClient.get_file_info("group1",&"M00/00/00/wKgRcFV_08OAK_KCAAAA5fm_sy874.conf");&
&&&&&&&&&&&&System.out.println(fi.getSourceIpAddr());&
&&&&&&&&&&&&System.out.println(fi.getFileSize());&
&&&&&&&&&&&&System.out.println(fi.getCreateTimestamp());&
&&&&&&&&&&&&System.out.println(fi.getCrc32());&
&&&&&&&&}&catch&(Exception&e)&{&
&&&&&&&&&&&&e.printStackTrace();&
&&&&&&&&}&
&&&&@Test&
&&&&public&void&testGetFileMate(){&
&&&&&&&&try&{&
&&&&&&&&&&&&ClientGlobal.init(conf_filename);
&&&&&&&&&&&&TrackerClient&tracker&=&new&TrackerClient();&
&&&&&&&&&&&&TrackerServer&trackerServer&=&tracker.getConnection();&
&&&&&&&&&&&&StorageServer&storageServer&=&
&&&&&&&&&&&&StorageClient&storageClient&=&new&StorageClient(trackerServer,&
&&&&&&&&&&&&&&&&&&&&storageServer);&
&&&&&&&&&&&&NameValuePair&nvps&[]&=&storageClient.get_metadata("group1",&"M00/00/00/wKgRcFV_08OAK_KCAAAA5fm_sy874.conf");&
&&&&&&&&&&&&for(NameValuePair&nvp&:&nvps){&
&&&&&&&&&&&&&&&&System.out.println(nvp.getName()&+&":"&+&nvp.getValue());&
&&&&&&&&&&&&}&
&&&&&&&&}&catch&(Exception&e)&{&
&&&&&&&&&&&&e.printStackTrace();&
&&&&&&&&}&
&&&&@Test&
&&&&public&void&testDelete(){&
&&&&&&&&try&{&
&&&&&&&&&&&&ClientGlobal.init(conf_filename);
&&&&&&&&&&&&TrackerClient&tracker&=&new&TrackerClient();&
&&&&&&&&&&&&TrackerServer&trackerServer&=&tracker.getConnection();&
&&&&&&&&&&&&StorageServer&storageServer&=&
&&&&&&&&&&&&StorageClient&storageClient&=&new&StorageClient(trackerServer,&
&&&&&&&&&&&&&&&&&&&&storageServer);&
&&&&&&&&&&&&int&i&=&storageClient.delete_file("group1",&"M00/00/00/wKgRcFV_08OAK_KCAAAA5fm_sy874.conf");&
&&&&&&&&&&&&System.out.println(&i==0&?&"删除成功"&:&"删除失败:"+i);&
&&&&&&&&}&catch&(Exception&e)&{&
&&&&&&&&&&&&e.printStackTrace();&
&&&&&&&&}&
执行testUpload方法如下
在浏览器输入&如下
更多开发者职位上
1)">1)">1" ng-class="{current:{{currentPage==page}}}" ng-repeat="page in pages"><li class='page' ng-if="(endIndex<li class='page next' ng-if="(currentPage
相关文章阅读FastDFS download | SourceForge.net
Description
FastDFS is an open source high performance DFS ( distributed file system ). It&#39;s major functions include: file storing, file syncing and file accessing, and design for high capacity and load balancing.
Categories
high performancehigh capacityload balancesimple
KEEP ME UPDATED
By clicking on "Follow" below, you are agreeing to the
Invalid email address. Please try again.
Sent to None.
You seem to have CSS turned off. Please don't fill out this field.
You seem to have CSS turned off. Please don't fill out this field.
User Ratings
&#9733;&#9733;&#9733;&#9733;&#9733;
&#9733;&#9733;&#9733;&#9733;
&#9733;&#9733;&#9733;
&#9733;&#9733;
User Reviews
scottsimpson2
Very good Software.
Additional Project Details
googletag.cmd.push(function() {
googletag.display('div-gpt-ad-0-0');CentOS_6.5安装FastDFS_5.05
1.安装依赖包和开发工具:
yum install vim vim-enhanced wget zip unzip telnet ntsysv compat*
apr* pcre* pcre-* nasm* gcc gcc* gcc-c++ ntp make imake cmake
automake autoconf zlib zlib-devel glibc glibc-devel glib2 libxml
glib2-devel libxml2 libxml2-devel bzip2 bzip2-devel libXpm
libXpm-devel libidn libidn-devel libtool libtool-ltdl-devel*
libmcrypt libmcrypt-devel libevent-devel libmcrypt* curl curl-devel
perl perl-Net-SSLeay pcre pcre-devel ncurses ncurses-devel openssl
openssl-devel openldap openldap-devel openldap-clients
openldap-servers krb5 krb5-devel e2fsprogs e2fsprogs-devel libjpeg
libpng libjpeg-devel libjpeg-6b libjpeg-devel-6b libpng-devel
libtiff-devel freetype freetype-devel fontconfig-devel gd gd-devel
kernel screen sysstat flex bison nss_ldap pam-devel
compat-libstdc++-33 gettext-devel libXft-devel libXtst-devel
2.安装libfastcommon:
tar zxvf libfastcommon-1.0.7.tar.gz -C /usr/src
cd /usr/src/libfastcommon-1.0.7/
./make.sh install
ln -s /usr/lib64/libfastcommon.so
/usr/local/lib/libfastcommon.so
ln -s /usr/lib64/libfastcommon.so /usr/lib/libfastcommon.so
ln -s /usr/lib64/libfdfsclient.so
/usr/local/lib/libfdfsclient.so
ln -s /usr/lib64/libfdfsclient.so /usr/lib/libfdfsclient.so
3.安装FastDFS_5.02:
tar zxvf FastDFS_v5.05.tar.gz -C /usr/src/
cd /usr/src/fastdfs-5.05/
sed -i 's#/usr/local/bin/#/usr/bin/#g' init.d/fdfs_storaged
sed -i 's#/usr/local/bin/#/usr/bin/#g' init.d/fdfs_trackerd
./make.sh install
4.编辑tracker.conf配置文件:
mkdir -p /home/fdfs/tracker
cp /etc/fdfs/tracker.conf.sample /etc/fdfs/tracker.conf
vim /etc/fdfs/tracker.conf
disabled=false
bind_addr=
port=22122
connect_timeout=30
network_timeout=60
base_path=/home/fdfs/tracker/
max_connections=256
accept_threads=1
work_threads=4
store_lookup=1
store_group=group1
store_server=0
store_path=0
download_server=0
reserved_storage_space = 10%
log_level=info
run_by_group=
run_by_user=
allow_hosts=*
sync_log_buff_interval = 10
check_active_interval = 120
thread_stack_size = 64KB
storage_ip_changed_auto_adjust = true
storage_sync_file_max_delay = 86400
storage_sync_file_max_time = 300
use_trunk_file = false
slot_min_size = 256
slot_max_size =16MB
trunk_file_size = 64MB
trunk_create_file_advance = false
trunk_create_file_time_base = 02:00
trunk_create_file_interval = 86400
trunk_create_file_space_threshold = 20G
trunk_init_check_occupying = false
trunk_init_reload_from_binlog = false
trunk_compress_binlog_min_interval = 0
use_storage_id = false
storage_ids_filename = storage_ids.conf
id_type_in_filename = ip
store_slave_file_use_link = false
rotate_error_log = false
error_log_rotate_time=00:00
rotate_error_log_size = 0
log_file_keep_days = 0
use_connection_pool = false
connection_pool_max_idle_time = 3600
http.server_port=8080
http.check_alive_interval=30
http.check_alive_type=tcp
http.check_alive_uri=/status.html
5.启动trackerd服务:
service fdfs_trackerd start
cat /home/fdfs/tracker/logs/trackerd.log
chkconfig --level 2345 fdfs_trackerd on
ps -aux | grep fdfs_trackerd
6.编辑storage.conf配置文件:
mkdir -p /home/fdfs/storage
cp /etc/fdfs/storage.conf.sample /etc/fdfs/storage.conf
vim /etc/fdfs/storage.conf
disabled=false
group_name=group1
bind_addr=
client_bind=true
port=23000
connect_timeout=30
network_timeout=60
heart_beat_interval=30
stat_report_interval=60
base_path=/home/fdfs/storage/
max_connections=256
buff_size = 256KB
accept_threads=1
work_threads=4
disk_rw_separated = true
disk_reader_threads = 1
disk_writer_threads = 1
sync_wait_msec=50
sync_interval=0
sync_start_time=00:00
sync_end_time=23:59
write_mark_file_freq=500
store_path_count=1
store_path0=/home/fdfs/storage/
subdir_count_per_path=256
tracker_server=127.0.0.1:22122
log_level=info
run_by_group=
run_by_user=
allow_hosts=*
file_distribute_path_mode=0
file_distribute_rotate_count=100
fsync_after_written_bytes=0
sync_log_buff_interval=10
sync_binlog_buff_interval=10
sync_stat_file_interval=300
thread_stack_size=512KB
upload_priority=10
if_alias_prefix=
check_file_duplicate=0
file_signature_method=hash
key_namespace=FastDFS
keep_alive=0
use_access_log = false
rotate_access_log = false
access_log_rotate_time=00:00
rotate_error_log = false
error_log_rotate_time=00:00
rotate_access_log_size = 0
rotate_error_log_size = 0
log_file_keep_days = 0
file_sync_skip_invalid_record=false
use_connection_pool = false
connection_pool_max_idle_time = 3600
http.domain_name=
http.server_port=80
7.启动storaged服务:
service fdfs_storaged start
cat /home/fdfs/storage/logs/storaged.log
chkconfig --level 2345 fdfs_storaged on
ps -aux | grep fdfs_storaged
8.安装Nginx:
tar zxvf fastdfs-nginx-module_v1.16.tar.gz -C /usr/src
vim /usr/src/fastdfs-nginx-module/src/config
ngx_addon_name=ngx_http_fastdfs_module
HTTP_MODULES="$HTTP_MODULES ngx_http_fastdfs_module"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS
$ngx_addon_dir/ngx_http_fastdfs_module.c"
CORE_INCS="$CORE_INCS /usr/include/fastdfs
/usr/include/fastcommon/"
CORE_LIBS="$CORE_LIBS -L/usr/local/lib -lfastcommon
-lfdfsclient"
CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64
-DFDFS_OUTPUT_CHUNK_SIZE='256*1024'
-DFDFS_MOD_CONF_FILENAME='"/etc/fdfs/mod_fastdfs.conf"'"
groupadd www
useradd -s /sbin/nologin -g www www
mkdir -p /home/www/log
mkdir -p /home/www/pid
tar zxvf nginx-1.9.0.tar.gz -C /usr/src/
cd /usr/src/nginx-1.9.0/
./configure --prefix=/usr/local/nginx \
--add-module=/usr/src/fastdfs-nginx-module/src \
--user=www \
--group=www \
--with-http_gunzip_module \
--with-pcre
make && make install
9.配置Nginx:
cp /usr/src/fastdfs-nginx-module/src/mod_fastdfs.conf
/etc/fdfs/
cp /usr/src/fastdfs-5.05/conf/{anti-steal.jpg,http.conf,mime.types}
/etc/fdfs/
touch /home/www/log/mod_fastdfs.log
ln -s /home/fdfs/storage/data /home/fdfs/storage/data/M00
vim /usr/local/nginx/conf/nginx.conf
error_log /home/www/log/error.
pid /home/www/pid/nginx.
worker_rlimit_nofile 51200;
worker_connections& 51200;
include&&&&&&
default_type& application/octet-
log_format& main& '$remote_addr -
$remote_user [$time_local] "$request" '
&&&&&&&&&&&&&&&&&&&&&
'$status $body_bytes_sent "$http_referer" '
&&&&&&&&&&&&&&&&&&&&&
'"$http_user_agent" "$http_x_forwarded_for"';
sendfile&&&&&&&
keepalive_timeout& 65;
&&& server
listen&&&&&&
server_name&
access_log&
/home/www/log/access.log&
location / {
&&&&&&&&&&&
&&&&&&&&&&&
index& index.html index.
error_page&& 500 502 503
504& /50x.
location = /50x.html {
&&&&&&&&&&&
&&& location
/group1/M00{
/home/fdfs/storage/;
ngx_fastdfs_
vim /etc/fdfs/mod_fastdfs.conf
connect_timeout=2
network_timeout=30
base_path=/tmp
load_fdfs_parameters_from_tracker=true
storage_sync_file_max_delay = 86400
use_storage_id = false
storage_ids_filename = storage_ids.conf
tracker_server=127.0.0.1:22122
storage_server_port=23000
group_name=group1
url_have_group_name = true
store_path_count=1
store_path0=/home/fdfs/storage/
log_level=info
log_filename=/home/www/log/mod_fastdfs.log
response_mode=proxy
if_alias_prefix=
#include http.conf
flv_support = true
flv_extension = flv
group_count = 1
group_name=group1
storage_server_port=23000
store_path_count=1
store_path0=/home/fdfs/storage/
chown -R www:www /home/www/pid
chown -R www:www /home/www/log
chown -R www:www /home/www/log/mod_fastdfs.log
10.启动nginx服务:
service nginx start
ps -aux | grep nginx
netstat -anptu | grep 80
11.配置客户端:
ln -s /home/fdfs/storage/data /home/fdfs/storage/data/M00
cp /etc/fdfs/client.conf.sample /etc/fdfs/client.conf
vim /etc/fdfs/client.conf
connect_timeout=30
network_timeout=60
base_path=/tmp
tracker_server=127.0.0.1:22122
log_level=info
use_connection_pool = false
connection_pool_max_idle_time = 3600
load_fdfs_parameters_from_tracker=false
use_storage_id = false
storage_ids_filename = storage_ids.conf
http.tracker_server_port=80
fdfs_upload_file /etc/fdfs/client.conf
/etc/fdfs/anti-steal.jpg
#能返回类似"group1/M00/00/00/wKgfolWmGAyAQSuqAABdrZgsqUU285.jpg"这样的路径即为成功!
fdfs_download_file /etc/fdfs/client.conf
group1/M00/00/00/wKgfolWmGAyAQSuqAABdrZgsqUU285.jpg
查看文件属性:
fdfs_file_info /etc/fdfs/client.conf
group1/M00/00/00/wKgfolWmGAyAQSuqAABdrZgsqUU285.jpg
删除文件:
fdfs_delete_file /etc/fdfs/client.conf
group1/M00/00/00/wKgfolWmGoOEBO0bAAAAAHf4omo816.log
查看storage状态:
fdfs_monitor /etc/fdfs/client.conf
##################################################
#STORAGE SERVER的状态通常有七种:
FDFS_STORAGE_STATUS:INIT&&&&&
:初始化,尚未得到同步已有数据的源服务器
# FDFS_STORAGE_STATUS:WAIT_SYNC :等待同步,已得到同步已有数据的源服务器
# FDFS_STORAGE_STATUS:SYNCING&&
# FDFS_STORAGE_STATUS:DELETED&&
:已删除,该服务器从本组中摘除
# FDFS_STORAGE_STATUS:OFFLINE&&
FDFS_STORAGE_STATUS:ONLINE&&&
:在线,尚不能提供服务
FDFS_STORAGE_STATUS:ACTIVE&&&
:在线,可以提供服务
##################################################
已投稿到:
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。当前位置: &
【rom】小米4原生安卓5.0.2包放出了赶紧的下载
编辑:chen
来源:网络
  开发者@秋叶随风ivan已经完成了原生Android 5.0.2系统的小米3与小米4的适配,喜欢原生风格的机友们不妨考虑一下。由于硬件平台大体相同,因此该ROM支持小米手机3联通/电信版、小米手机4联通3G/电信3G版以及小米手机4移动/联通4G版。
  刷机包:【】(密码:l8pn)
  Recovery:【】(密码:r0t7)
  目前该ROM还存在两个比较明显的Bug,其一是多用户功能使用之后文件管理器会FC,另外就是通话中灭屏状态下触摸屏可操作。
【上一篇】
【下一篇】
推荐阅读:
看完这篇文章有何感觉?
PP助手准备为您下载应用
未越狱版:鳄鱼小顽皮爱洗澡
如果在10秒后下载任务还没有开始,请下载并安装:
下载步骤如下:ylw6006 的BLOG
用户名:ylw6006
文章数:225
评论数:674
访问量:1222238
注册日期:
阅读量:3853
阅读量:2317
阅读量:2584
51CTO推荐博文
由于网站使用nfs共享方式保存用户上传的图片,附件等资料,然后通过apache下载的方式供用户访问,在网站架构初期,使用这种简单的方式实现了静态资源的读写分离,但随着网站数据量的增加,图片服务器渐渐成为整个网站的短板,缘次催生了使用fastfds的想法,故而先进行一番简单的测试!在开始之前还是先来看看fastfds的介绍信息:
FastDFS is an open source high performance distributed file system (DFS). It's major functions include: file storing, file syncing and file accessing, and design for high capacity and load balancing.
FastDFS is an open source high performance distributed file system. It's major functions include: file storing, file syncing and file accessing (file uploading and file downloading), and it can resolve the high capacity and load balancing problem. FastDFS should meet the requirement of the website whose service based on files such as photo sharing site and vidio sharing site.
FastDFS has two roles: tracker and storage. The tracker takes charge of scheduling and load balancing for file access. The storage store files and it's function is file management including: file storing, file syncing, providing file access interface. It also manage the meta data which are attributes representing as key value pair of the file. For example: width=1024, the key is &width& and the value is &1024&.
The tracker and storage contain one or more servers. The servers in the tracker or storage cluster can be added to or removed from the cluster by any time without affecting the online services. The servers in the tracker cluster are peer to peer.
The storarge servers organizing by the file volume/group to obtain high capacity. The storage system contains one or more volumes whose files are independent among these volumes. The capacity of the whole storage system equals to the sum of all volumes' capacity. A file volume contains one or more storage servers whose files are same among these servers. The servers in a file volume backup each other, and all these servers are load balancing. When adding a storage server to a volume, files already existing in this volume are replicated to this new server automatically, and when this replication done, system will switch this server online to providing storage services. When the whole storage capacity is insufficiency, you can add one or more volumes to expand the storage capacity. To do this, you need to add one or more storage servers.
The identification of a file is composed of two parts: the volume name and the file name.
fastdfs是一个开源的,高性能的的分布式文件系统,他主要的功能包括:文件存储,同步和访问,设计基于高可用和负载均衡,fastfd非常适用于基于文件服务的站点,例如图片分享和视频分享网站
fastfds有两个角色:跟踪服务和存储服务,跟踪服务控制,调度文件以负载均衡的方式访问;存储服务包括:文件存储,文件同步,提供文件访问接口,同时以key value的方式管理文件的元数据
跟踪和存储服务可以由1台或者多台服务器组成,同时可以动态的添加,删除跟踪和存储服务而不会对在线的服务产生影响,在集群中,tracker服务是对等的
存储系统由一个或多个卷组成,卷与卷之间的文件是相互独立的,所有卷的文件容量累加就是整个存储系统中的文件容量。一个卷可以由一台或多台存储服务器组成,一个卷下的存储服务器中的文件都是相同的,卷中的多台存储服务器起到了冗余备份和负载均衡的作用。在卷中增加服务器时,同步已有的文件由系统自动完成,同步完成后,系统自动将新增服务器切换到线上提供服务。当存储空间不足或即将耗尽时,可以动态添加卷。只需要增加一台或多台服务器,并将它们配置为一个新的卷,这样就扩大了存储系统的容量。
下面几张图可以清楚的说明fastfds的架构和文件上传和下载流程等:
下面将介绍下fastdfs在rhel上的部署过程
tracker服务器:192.168.123.110/24
storage服务器:192.168.123.20/24
一:编译安装
[root@db1&~]#&wget&/downloads/libevent/libevent/libevent-2.0.14 &-stable.tar.gz &[root@db1&~]#&tar&-zxvpf&libevent-2.0.14-stable.tar.gz& &[root@db1&~]#&cd&libevent-2.0.14-stable &[root@db1&libevent-2.0.14-stable]#&./configure&--prefix=/usr/local/libevent-2.0.14&&&& &make&&&&make&install &[root@db1&~]#&wget&/files/FastDFS_v3.02.tar.gz &[root@db1&~]#&tar&-zxvf&FastDFS_v3.02.tar.gz& &[root@db1&~]#&cd&FastDFS &[root@db1&FastDFS]#&grep&-A&4&'/usr/local/FastDFS'&make.sh& &TARGET_PREFIX=/usr/local/FastDFS &TARGET_CONF_PATH=/etc/fdfs &WITH_HTTPD=1&WITH_LINUX_SERVICE=1&[root@db1&FastDFS]#&./make.sh&C_INCLUDE_PATH=/usr/local/libevent-2.0.14/include&& &LIBRARY_PATH=/usr/local/libevent-2.0.14/lib &[root@db1&FastDFS]#&./make.sh&install &[root@db1&FastDFS]#&ls&/etc/fdfs/ &client.conf&&http.conf&&mime.types&&storage.conf&&tracker.conf&
二:tracker配置文件
[root@db1&~]#&grep&-v&'^#'&/etc/fdfs/tracker.conf&|grep&-v&'^$' &disabled=false&bind_addr=192.168.123.110 &port=22122&connect_timeout=30&network_timeout=60&base_path=/home/data/fastdfs &max_connections=256&work_threads=4&store_lookup=2&store_group=group2&store_server=0&store_path=0&download_server=0&reserved_storage_space&=&4GB&log_level=info&run_by_group= &run_by_user= &allow_hosts=* &sync_log_buff_interval&=&10&check_active_interval&=&120&thread_stack_size&=&64KB&storage_ip_changed_auto_adjust&=&true&storage_sync_file_max_delay&=&86400&storage_sync_file_max_time&=&300&use_trunk_file&=&false& &slot_min_size&=&256&slot_max_size&=&16MB&trunk_file_size&=&64MB&http.disabled=false&http.server_port=8080&http.check_alive_interval=30&http.check_alive_type=tcp&http.check_alive_uri=/status.html &http.need_find_content_type=true&&[root@db1&~]#&grep&-v&'^#'&/etc/fdfs/http.conf&&|grep&-v&'^$' &http.default_content_type&=&application/octet-stream &http.mime_types_filename=/etc/fdfs/mime.types &http.anti_steal.check_token=false&http.anti_steal.token_ttl=900&http.anti_steal.secret_key=FastDFS&http.anti_steal.token_check_fail=/home/data/fastdfs/conf/anti-steal.jpg&
三:启动tracker服务,需要注意tracker.conf文件最后一行为#include httpd.conf
[root@db1&~]#&/usr/local/FastDFS/bin/fdfs_trackerd&/etc/fdfs/tracker.conf& &/usr/local/FastDFS/bin/fdfs_trackerd:&error&while&loading&shared&libraries:&libevent- &2.0.so.5:&cannot&open&shared&object&file:&No&such&file&or&directory &[root@db1&~]#&echo&'/usr/local/libevent-2.0.14/include/'&&/etc/ld.so.conf &[root@db1&~]#&echo&'/usr/local/libevent-2.0.14/lib/'&&/etc/ld.so.conf &[root@db1&~]#&ldconfig &[root@db1&~]#&/usr/local/FastDFS/bin/fdfs_trackerd&/etc/fdfs/tracker.conf& &[&17:52:25]&ERROR&-&file:&tracker_func.c,&line:&160,&&/home/data/fastdfs&& &can't&be&accessed,&error&info:&No&such&file&or&directory &[root@db1&~]#&mkdir&-p&/home/data/fastdfs &[root@db1&~]#&/usr/local/FastDFS/bin/fdfs_trackerd&/etc/fdfs/tracker.conf& &[root@db1&~]#&echo&$? &22 &[root@db1&~]#&cat&&/home/data/fastdfs/logs/trackerd.log& &[&17:52:50]&ERROR&-&file:&../common/fdfs_http_shared.c,&line:&128,&param& &&http.mime_types_filename&&not&exist&or&is&empty &[root@db1&~]#&tail&-1&/etc/fdfs/tracker.conf& &#include&http.conf &[root@db1&~]#&/usr/local/FastDFS/bin/fdfs_trackerd&/etc/fdfs/tracker.conf& &[root@db1&~]#&echo&$? &0 &[root@db1&~]#&ps&-ef&|grep&track &root&&&&&&3535&&&&&1&&0&15:47&?&&&&&&&&00:00:00&/usr/local/FastDFS/bin/fdfs_trackerd& &/etc/fdfs/tracker.conf &&[root@db1&~]#&netstat&-ntpl&|grep&fdfs &tcp&&&&&&&&0&&&&&&0&192.168.123.110:22122&&&&&&&0.0.0.0:*&&&&&&&&&&&&&&&&&&&LISTEN&&&&&& &3535/fdfs_trackerd&& &tcp&&&&&&&&0&&&&&&0&192.168.123.110:8080&&&&&&&&0.0.0.0:*&&&&&&&&&&&&&&&&&&&LISTEN&&&&&& &3535/fdfs_trackerd&&
四:storage配置文件
[root@db2&~]#&grep&-v&'^#'&/etc/fdfs/storage.conf&|grep&-v&'^$' &disabled=false&group_name=group1&bind_addr=192.168.123.20 &client_bind=true&port=23000&connect_timeout=30&network_timeout=60&heart_beat_interval=30&stat_report_interval=60&base_path=/home/data/fastdfs &max_connections=256&buff_size&=&256KB&work_threads=4&disk_rw_separated&=&true&disk_rw_direct&=&false&disk_reader_threads&=&1&disk_writer_threads&=&1&sync_wait_msec=50&sync_interval=0&sync_start_time=00:00 &sync_end_time=23:59 &write_mark_file_freq=500&store_path_count=1&store_path0=/home/data/fastdfs &subdir_count_per_path=256&tracker_server=192.168.123.110:22122 &log_level=info&run_by_group= &run_by_user= &allow_hosts=* &file_distribute_path_mode=0&file_distribute_rotate_count=100&fsync_after_written_bytes=0&sync_log_buff_interval=10&sync_binlog_buff_interval=10&sync_stat_file_interval=300&thread_stack_size=512KB&upload_priority=10&if_alias_prefix= &check_file_duplicate=0 &key_namespace=FastDFS&keep_alive=0&http.disabled=false&httphttp.domain_name= &http.server_port=8888&http.trunk_size=256KB&http.need_find_content_type=true&&[root@db2&~]#&grep&-v&'^#'&/etc/fdfs/client.conf&&|grep&-v&'^$' &connect_timeout=30&network_timeout=60&base_path=/home/data/fastdfs &tracker_server=192.168.123.110:22122 &log_level=info&http.tracker_server_port=8080&&[root@db2&~]#&&grep&-v&'^#'&/etc/fdfs/http.conf&|grep&-v&'^$' &http.default_content_type&=&application/octet-stream &http.mime_types_filename=mime.types &http.anti_steal.check_token=false&http.anti_steal.token_ttl=900&http.anti_steal.secret_key=FastDFS&http.anti_steal.token_check_fail=/home/data/fastdfs/conf/anti-steal.jpg&
五:启动storage,需要注意storage.conf文件最后一行为#include httpd.conf
[root@db2&~]#&mkdir&-p&/home/data/fastdfs &[root@db2&~]#&echo&'/usr/local/libevent-2.0.14/include/'&&/etc/ld.so.conf &[root@db2&~]#&echo&'/usr/local/libevent-2.0.14/lib/'&&/etc/ld.so.conf &[root@db2&~]#&ldconfig &&[root@db2&~]#&tail&-2&/etc/fdfs/storage.conf& &#use&&#include&&directive&to&include&HTTP&other&settings &#include&http.conf &&[root@db2&~]#&/usr/local/FastFDS/bin/fdfs_storaged&/etc/fdfs/storage.conf& &mkdir&data&path:&00&... &mkdir&data&path:&01&... &mkdir&data&path:&02&... &&&&输出省略&&&& &data&path:&/home/data/fastdfs/data,&mkdir&sub&dir&done. &&[root@db2&~]#&ps&-ef&|grep&fdfs &root&&&&&14451&&&&&1&&0&16:15&?&&&&&&&&00:00:00&/usr/local/FastFDS/bin/fdfs_storaged& &/etc/fdfs/storage.conf &root&&&&&1&&0&16:16&pts/1&&&&00:00:00&grep&fdfs &&[root@db2&~]#&netstat&-ntpl&|grep&fdfs &tcp&&&&&&&&0&&&&&&0&192.168.123.20:8888&&&&&&&&&0.0.0.0:*&&&&&&&&&&&&&&&&&&&LISTEN&&&&&& &14451/fdfs_storaged& &tcp&&&&&&&&0&&&&&&0&192.168.123.20:23000&&&&&&&&0.0.0.0:*&&&&&&&&&&&&&&&&&&&LISTEN&&&&&& &14451/fdfs_storaged&&
五:测试文件上传
&[root@db2 ~]# /usr/local/FastFDS/bin/fdfs_test /etc/fdfs/client.conf upload /etc/passwd
This is FastDFS client test program v3.02
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.
[ 16:25:59] INFO - base_path=/home/data/fastdfs, 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.123.20, port=23000 group_name=group1, ip_addr=192.168.123.20, port=23000
storage_upload_by_filename
group_name=group1, remote_filename=M00/00/00/wKh7FFAWRRfcMOGtAAAHKBGhZhE8065783
source ip address: 192.168.123.20
file timestamp= 16:25:59
file size=1832
file crc32=
storage_upload_slave_by_filename
group_name=group1, remote_filename=M00/00/00/wKh7FFAWRRfcMOGtAAAHKBGhZhE8065783_big
source ip address: 192.168.123.20
file timestamp= 16:25:59
file size=1832
file crc32=
[root@db2 ~]# /usr/local/FastFDS/bin/fdfs_test /etc/fdfs/client.conf upload 2.jpg
This is FastDFS client test program v3.02
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.
[ 16:29:22] INFO - base_path=/home/data/fastdfs, 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.123.20, port=23000 group_name=group1, ip_addr=192.168.123.20, port=23000
storage_upload_by_filename
group_name=group1, remote_filename=M00/00/00/wKh7FFAWReLzPs4sAAEYquSDGwc472.jpg
source ip address: 192.168.123.20
file timestamp= 16:29:22
file size=71850
file crc32=
storage_upload_slave_by_filename
group_name=group1, remote_filename=M00/00/00/wKh7FFAWReLzPs4sAAEYquSDGwc472_big.jpg
source ip address: 192.168.123.20
file timestamp= 16:29:22
file size=71850
file crc32=
本文出自 “” 博客,谢绝转载!
了这篇文章
类别:┆阅读(0)┆评论(0)
本文收录至博客专题:《》
15:18:40 17:23:06 17:39:58 11:41:03 18:31:55 16:50:39 08:17:38 17:33:19 21:57:10 10:35:40 &&1&
&&页数 ( 1/2 ) &

我要回帖

更多关于 安卓4.0.4系统下载 的文章

 

随机推荐