FastDFS ~ 分布式文件系统。


文章目录

    • FastDFS ~ 分布式文件系统。
      • 文件系统。
          • 分布式文件系统。
          • 主流文件系统。
            • NFS。
          • GFS(Google 文件系统)。
          • HDFS。
          • OSS。
          • 七牛云。
            • 百度云。
      • fastdfs。
      • 安装。
      • 配置。
      • 启动。
            • 源配置文件。
      • Java-client。
          • 配置。
          • .conf 配置文件、所在目录、加载优先顺序。
          • .properties 配置文件、所在目录、加载优先顺序。
          • 上传文件。
          • 查询文件。
          • 下载文件。


文件系统。

文件系统是操作系统用于明确存储设备(常见的是磁盘,也有基于 NAND Flash 的固态硬盘)或分区上的文件的方法和数据结构;即在存储设备上组织文件的方法。操作系统中负责管理和存储文件信息的软件机构称为文件管理系统,简称文件系统。文件系统由三部分组成:文件系统的接口,对对象操纵和管理的软件集合,对象及属性。从系统角度来看,文件系统是对文件存储设备的空间进行组织和分配,负责文件存储并对存入的文件进行保护和检索的系统。具体地说,它负责为用户建立文件,存入、读出、修改、转储文件,控制文件的存取,当用户不再使用时撤销文件等。


分布式文件系统。

分布式文件系统(Distributed File System,DFS)是指文件系统管理的物理存储资源不一定直接连接在本地节点上,而是通过计算机网络与节点(可简单的理解为一台计算机)相连;或是若干不同的逻辑磁盘分区或卷标组合在一起而形成的完整的有层次的文件系统。DFS 为分布在网络上任意位置的资源提供一个逻辑上的树形文件系统结构,从而使用户访问分布在网络上的共享文件更加简便。单独的 DFS 共享文件夹的作用是相对于通过网络上的其他共享文件夹的访问点。


主流文件系统。
NFS。

NFS 是基于 UDP/IP 协议的应用,其实现主要是采用远程过程调用 RPC 机制,RPC 提供了一组与机器、操作系统以及低层传送协议无关的存取远程文件的操作。RPC 采用了 XDR 的支持。XDR 是一种与机器无关的数据描述编码的协议,他以独立与任意机器体系结构的格式对网上传送的数据进行编码和解码,支持在异构系统之间数据的传送。

https://baike.baidu.com/item/%E7%BD%91%E7%BB%9C%E6%96%87%E4%BB%B6%E7%B3%BB%E7%BB%9F/9719420?fromtitle=NFS&fromid=812203&fr=aladdin


GFS(Google 文件系统)。

GFS 是一个可扩展的分布式文件系统,用于大型的、分布式的、对大量数据进行访问的应用。它运行于廉价的普通硬件上,并提供容错功能。它可以给大量的用户提供总体性能较高的服务。

在这里插入图片描述

HDFS。

Hadoop 分布式文件系统(HDFS)是指被设计成适合运行在通用硬件(commodity hardware)上的分布式文件系统(Distributed File System)。它和现有的分布式文件系统有很多共同点。但同时,它和其他的分布式文件系统的区别也是很明显的。HDFS 是一个高度容错性的系统,适合部署在廉价的机器上。HDFS 能提供高吞吐量的数据访问,非常适合大规模数据集上的应用。HDFS 放宽了一部分 POSIX 约束,来实现流式读取文件系统数据的目的。HDFS 在最开始是作为 Apache Nutch 搜索引擎项目的基础架构而开发的。HDFS 是 Apache Hadoop Core项目的一部分。
HDFS 有着高容错性(fault-tolerant)的特点,并且设计用来部署在低廉的(low-cost)硬件上。而且它提供高吞吐量(high throughput)来访问应用程序的数据,适合那些有着超大数据集(large data set)的应用程序。HDFS 放宽了(relax)POSIX 的要求(requirements)这样可以实现流的形式访问(streaming access)文件系统中的数据。

在这里插入图片描述

OSS。

https://help.aliyun.com/product/31815.html?spm=5176.7933691.1309819.8.195e2a66Qz2Nhv

对象存储服务(Object Storage Service,OSS)是一种海量、安全、低成本、高可靠的云存储服务,适合存放任意类型的文件。容量和处理能力弹性扩展,多种存储类型供选择,全面优化存储成本。


七牛云。
百度云。

fastdfs。

https://www.oschina.net/p/fastdfs?hmsr=aladdin1e1

FastDFS 是一个开源的分布式文件系统,她对文件进行管理,功能包括:文件存储、文件同步、文件访问(文件上传、文件下载)等,解决了大容量存储和负载均衡的问题。特别适合以文件为载体的在线服务,如相册网站、视频网站等等。

FastDFS 服务端有两个角色:跟踪器(tracker)和存储节点(storage)。跟踪器主要做调度工作,在访问上起负载均衡的作用。

存储节点存储文件,完成文件管理的所有功能:存储、同步和提供存取接口,FastDFS 同时对文件的 meta data 进行管理。所谓文件的meta data就是文件的相关属性,以键值对(key value pair)方式表示,如:width=1024,其中的 key 为 width,value 为 1024。文件 meta data 是文件属性列表,可以包含多个键值对。

在这里插入图片描述

Tracker 服务器管理 Storage 服务器。

  • client 询问 tracker 上传到的 storage,不需要附加参数;
  • tracker 返回一台可用的 storage;
  • client 直接和 storage 通讯完成文件上传。

在这里插入图片描述
客户端上传文件后存储服务器返回文件 ID 给客户端,此文件 ID 用于以后访问该文件的索引信息。

在这里插入图片描述

  • 组名。
    文件上传后所丰的 storage 组名。在文件上传后由 storage 服务器。

  • 虚拟磁盘路径。
    storage 配置的虚拟路径。与磁盘选项 storage_path * 对应。如果配置了 storage_path0,则是 M00;如果配置了 storage_path1,则是 M01。

  • 数据两级目录。
    storage 服务器在每个虚拟机路径下创建的两级目录,用于存储数据文件。

  • 文件名。
    与文件上传时不同。是由存储服务器根据特定信息生成。(源存储服务器 IP 地址、文件创建时间戳、文件大小、随机数和文件拓展名等信息)。


安装。

https://github.com/happyfish100/fastdfs/releases/tag/V5.05

https://gitee.com/fastdfs100/fastdfs/wikis/Home?sort_id=1711583

  • 编译环境。

yum install git gcc gcc-c++ make automake autoconf libtool pcre pcre-devel zlib zlib-devel openssl-devel wget vim -y

geek@geek-PC:~/Downloads$ scp fastdfs-5.05.tar.gz root@192.168.142.161:/root/geek/tools_my
  • 磁盘目录
说明 位置
所有安装包 /usr/local/src
数据存储位置 /home/dfs/

// 这里我为了方便把日志什么的都放到了dfs。

mkdir /home/dfs # 创建数据存储目录。
cd /usr/local/src # 切换到安装目录准备下载安装包
  • 安装 libfatscommon。
git clone https://github.com/happyfish100/libfastcommon.git --depth 1
cd libfastcommon/
./make.sh && ./make.sh install #编译安装
  • 安装 FastDFS。
cd ../ #返回上一级目录
git clone https://github.com/happyfish100/fastdfs.git --depth 1
cd fastdfs/
./make.sh && ./make.sh install #编译安装

配置。

[root@192 fastdfs-5.05]# ll /etc/fdfs/
total 20
-rw-r--r--. 1 root root 1461 Jun 29 01:21 client.conf.sample
-rw-r--r--. 1 root root 7829 Jun 29 01:21 storage.conf.sample
-rw-r--r--. 1 root root 7102 Jun 29 01:21 tracker.conf.sample[root@192 fastdfs-5.05]# mkdir /home/fastdfs
[root@192 fastdfs-5.05]# cp /etc/fdfs/tracker.conf.sample /etc/fdfs/tracker.conf
[root@192 fastdfs-5.05]# cp /etc/fdfs/storage.conf.sample /etc/fdfs/storage.confcp /usr/etc/fdfs/client.conf.sample /etc/fdfs/client.conf
# 客户端文件,测试用。
cp /usr/local/src/fastdfs/conf/http.conf /etc/fdfs/
# 供 nginx 访问使用。
cp /usr/local/src/fastdfs/conf/mime.types /etc/fdfs/
# 供 nginx 访问使用。
  • tracker 配置。
# the tracker server port
port=22122# the base path to store data and log files
base_path=/home/fastdfs
  • storage 配置。
# the name of the group this storage server belongs to
#
# comment or remove this item for fetching from tracker server,
# in this case, use_storage_id must set to true in tracker.conf,
# and storage_ids.conf must be configed correctly.
group_name=group1# the storage server port
port=23000# connect timeout in seconds
# default value is 30s
connect_timeout=30# the base path to store data and log files
base_path=/home/fastdfs# store_path#, based 0, if store_path0 not exists, it's value is base_path
# the paths must be exist
store_path0=/home/fastdfs/fdfs_storage
#store_path1=/home/yuqing/fastdfs2# 上报 tracker 地址。
# tracker_server can ocur more than once, and tracker_server format is
#  "host:port", host can be hostname or ip address
#tracker_server=192.168.209.121:22122
tracker_server=192.168.162.161:22122

启动。

[root@192 bin]# /usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf restart
[root@192 bin]# /usr/bin/fdfs_storaged /etc/fdfs/storage.conf restart
[root@192 bin]# ps -ef | grep storage
root      10581   9777  0 01:51 pts/0    00:00:00 grep --color=auto storage
[root@192 bin]# ps -ef | grep tracker
root      10566      1  0 01:47 ?        00:00:00 /usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf restart
root      10583   9777  0 01:51 pts/0    00:00:00 grep --color=auto tracker
[root@192 bin]# /usr/bin/fdfs_storaged /etc/fdfs/storage.conf start
^C
[root@192 bin]# vim /etc/fdfs/tracker.conf
[root@192 bin]# vim /etc/fdfs/storage.conf
[root@192 bin]# /usr/bin/fdfs_storaged /etc/fdfs/storage.conf start
[root@192 bin]# ps -ef | grep tracker
root      10566      1  0 01:47 ?        00:00:00 /usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf restart
root      10601   9777  0 01:56 pts/0    00:00:00 grep --color=auto tracker
[root@192 bin]# ps -ef | grep storage
root      10591      1  0 01:56 ?        00:00:00 /usr/bin/fdfs_storaged /etc/fdfs/storage.conf start
root      10603   9777  0 01:57 pts/0    00:00:00 grep --color=auto storage

源配置文件。
[root@192 fastdfs-5.05]# cat /etc/fdfs/tracker.conf
# is this config file disabled
# false for enabled
# true for disabled
disabled=false# bind an address of this host
# empty for bind all addresses of this host
bind_addr=# the tracker server port
port=22122# connect timeout in seconds
# default value is 30s
connect_timeout=30# network timeout in seconds
# default value is 30s
network_timeout=60# the base path to store data and log files
base_path=/home/yuqing/fastdfs# max concurrent connections this server supported
max_connections=256# accept thread count
# default value is 1
# since V4.07
accept_threads=1# work thread count, should <= max_connections
# default value is 4
# since V2.00
work_threads=4# the method of selecting group to upload files
# 0: round robin
# 1: specify group
# 2: load balance, select the max free space group to upload file
store_lookup=2# which group to upload file
# when store_lookup set to 1, must set store_group to the group name
store_group=group2# which storage server to upload file
# 0: round robin (default)
# 1: the first server order by ip address
# 2: the first server order by priority (the minimal)
store_server=0# which path(means disk or mount point) of the storage server to upload file
# 0: round robin
# 2: load balance, select the max free space path to upload file
store_path=0# which storage server to download file
# 0: round robin (default)
# 1: the source storage server which the current file uploaded to
download_server=0# reserved storage space for system or other applications.
# if the free(available) space of any stoarge server in 
# a group <= reserved_storage_space, 
# no file can be uploaded to this group.
# bytes unit can be one of follows:
### G or g for gigabyte(GB)
### M or m for megabyte(MB)
### K or k for kilobyte(KB)
### no unit for byte(B)
### XX.XX% as ratio such as reserved_storage_space = 10%
reserved_storage_space = 10%#standard log level as syslog, case insensitive, value list:
### emerg for emergency
### alert
### crit for critical
### error
### warn for warning
### notice
### info
### debug
log_level=info#unix group name to run this program, 
#not set (empty) means run by the group of current user
run_by_group=#unix username to run this program,
#not set (empty) means run by current user
run_by_user=# allow_hosts can ocur more than once, host can be hostname or ip address,
# "*" means match all ip addresses, can use range like this: 10.0.1.[1-15,20] or
# host[01-08,20-25].domain.com, for example:
# allow_hosts=10.0.1.[1-15,20]
# allow_hosts=host[01-08,20-25].domain.com
allow_hosts=*# sync log buff to disk every interval seconds
# default value is 10 seconds
sync_log_buff_interval = 10# check storage server alive interval seconds
check_active_interval = 120# thread stack size, should >= 64KB
# default value is 64KB
thread_stack_size = 64KB# auto adjust when the ip address of the storage server changed
# default value is true
storage_ip_changed_auto_adjust = true# storage sync file max delay seconds
# default value is 86400 seconds (one day)
# since V2.00
storage_sync_file_max_delay = 86400# the max time of storage sync a file
# default value is 300 seconds
# since V2.00
storage_sync_file_max_time = 300# if use a trunk file to store several small files
# default value is false
# since V3.00
use_trunk_file = false # the min slot size, should <= 4KB
# default value is 256 bytes
# since V3.00
slot_min_size = 256# the max slot size, should > slot_min_size
# store the upload file to trunk file when it's size <=  this value
# default value is 16MB
# since V3.00
slot_max_size = 16MB# the trunk file size, should >= 4MB
# default value is 64MB
# since V3.00
trunk_file_size = 64MB# if create trunk file advancely
# default value is false
# since V3.06
trunk_create_file_advance = false# the time base to create trunk file
# the time format: HH:MM
# default value is 02:00
# since V3.06
trunk_create_file_time_base = 02:00# the interval of create trunk file, unit: second
# default value is 38400 (one day)
# since V3.06
trunk_create_file_interval = 86400# the threshold to create trunk file
# when the free trunk file size less than the threshold, will create 
# the trunk files
# default value is 0
# since V3.06
trunk_create_file_space_threshold = 20G# if check trunk space occupying when loading trunk free spaces
# the occupied spaces will be ignored
# default value is false
# since V3.09
# NOTICE: set this parameter to true will slow the loading of trunk spaces 
# when startup. you should set this parameter to true when neccessary.
trunk_init_check_occupying = false# if ignore storage_trunk.dat, reload from trunk binlog
# default value is false
# since V3.10
# set to true once for version upgrade when your version less than V3.10
trunk_init_reload_from_binlog = false# the min interval for compressing the trunk binlog file
# unit: second
# default value is 0, 0 means never compress
# FastDFS compress the trunk binlog when trunk init and trunk destroy
# recommand to set this parameter to 86400 (one day)
# since V5.01
trunk_compress_binlog_min_interval = 0# if use storage ID instead of IP address
# default value is false
# since V4.00
use_storage_id = false# specify storage ids filename, can use relative or absolute path
# since V4.00
storage_ids_filename = storage_ids.conf# id type of the storage server in the filename, values are:
## ip: the ip address of the storage server
## id: the server id of the storage server
# this paramter is valid only when use_storage_id set to true
# default value is ip
# since V4.03
id_type_in_filename = ip# if store slave file use symbol link
# default value is false
# since V4.01
store_slave_file_use_link = false# if rotate the error log every day
# default value is false
# since V4.02
rotate_error_log = false# rotate error log time base, time format: Hour:Minute
# Hour from 0 to 23, Minute from 0 to 59
# default value is 00:00
# since V4.02
error_log_rotate_time=00:00# rotate error log when the log file exceeds this size
# 0 means never rotates log file by log file size
# default value is 0
# since V4.02
rotate_error_log_size = 0# keep days of the log files
# 0 means do not delete old log files
# default value is 0
log_file_keep_days = 0# if use connection pool
# default value is false
# since V4.05
use_connection_pool = false# connections whose the idle time exceeds this time will be closed
# unit: second
# default value is 3600
# since V4.05
connection_pool_max_idle_time = 3600# HTTP port on this tracker server
http.server_port=8080# check storage HTTP server alive interval seconds
# <= 0 for never check
# default value is 30
http.check_alive_interval=30# check storage HTTP server alive type, values are:
#   tcp : connect to the storge server with HTTP port only, 
#        do not request and get response
#   http: storage check alive url must return http status 200
# default value is tcp
http.check_alive_type=tcp# check storage HTTP server alive uri/url
# NOTE: storage embed HTTP server support uri: /status.html
http.check_alive_uri=/status.html
[root@192 fastdfs-5.05]# cat /etc/fdfs/storage.conf
# is this config file disabled
# false for enabled
# true for disabled
disabled=false# the name of the group this storage server belongs to
#
# comment or remove this item for fetching from tracker server,
# in this case, use_storage_id must set to true in tracker.conf,
# and storage_ids.conf must be configed correctly.
group_name=group1# bind an address of this host
# empty for bind all addresses of this host
bind_addr=# if bind an address of this host when connect to other servers 
# (this storage server as a client)
# true for binding the address configed by above parameter: "bind_addr"
# false for binding any address of this host
client_bind=true# the storage server port
port=23000# connect timeout in seconds
# default value is 30s
connect_timeout=30# network timeout in seconds
# default value is 30s
network_timeout=60# heart beat interval in seconds
heart_beat_interval=30# disk usage report interval in seconds
stat_report_interval=60# the base path to store data and log files
base_path=/home/yuqing/fastdfs# max concurrent connections the server supported
# default value is 256
# more max_connections means more memory will be used
max_connections=256# the buff size to recv / send data
# this parameter must more than 8KB
# default value is 64KB
# since V2.00
buff_size = 256KB# accept thread count
# default value is 1
# since V4.07
accept_threads=1# work thread count, should <= max_connections
# work thread deal network io
# default value is 4
# since V2.00
work_threads=4# if disk read / write separated
##  false for mixed read and write
##  true for separated read and write
# default value is true
# since V2.00
disk_rw_separated = true# disk reader thread count per store base path
# for mixed read / write, this parameter can be 0
# default value is 1
# since V2.00
disk_reader_threads = 1# disk writer thread count per store base path
# for mixed read / write, this parameter can be 0
# default value is 1
# since V2.00
disk_writer_threads = 1# when no entry to sync, try read binlog again after X milliseconds
# must > 0, default value is 200ms
sync_wait_msec=50# after sync a file, usleep milliseconds
# 0 for sync successively (never call usleep)
sync_interval=0# storage sync start time of a day, time format: Hour:Minute
# Hour from 0 to 23, Minute from 0 to 59
sync_start_time=00:00# storage sync end time of a day, time format: Hour:Minute
# Hour from 0 to 23, Minute from 0 to 59
sync_end_time=23:59# write to the mark file after sync N files
# default value is 500
write_mark_file_freq=500# path(disk or mount point) count, default value is 1
store_path_count=1# store_path#, based 0, if store_path0 not exists, it's value is base_path
# the paths must be exist
store_path0=/home/yuqing/fastdfs
#store_path1=/home/yuqing/fastdfs2# subdir_count  * subdir_count directories will be auto created under each 
# store_path (disk), value can be 1 to 256, default value is 256
subdir_count_per_path=256# tracker_server can ocur more than once, and tracker_server format is
#  "host:port", host can be hostname or ip address
tracker_server=192.168.209.121:22122#standard log level as syslog, case insensitive, value list:
### emerg for emergency
### alert
### crit for critical
### error
### warn for warning
### notice
### info
### debug
log_level=info#unix group name to run this program, 
#not set (empty) means run by the group of current user
run_by_group=#unix username to run this program,
#not set (empty) means run by current user
run_by_user=# allow_hosts can ocur more than once, host can be hostname or ip address,
# "*" means match all ip addresses, can use range like this: 10.0.1.[1-15,20] or
# host[01-08,20-25].domain.com, for example:
# allow_hosts=10.0.1.[1-15,20]
# allow_hosts=host[01-08,20-25].domain.com
allow_hosts=*# the mode of the files distributed to the data path
# 0: round robin(default)
# 1: random, distributted by hash code
file_distribute_path_mode=0# valid when file_distribute_to_path is set to 0 (round robin), 
# when the written file count reaches this number, then rotate to next path
# default value is 100
file_distribute_rotate_count=100# call fsync to disk when write big file
# 0: never call fsync
# other: call fsync when written bytes >= this bytes
# default value is 0 (never call fsync)
fsync_after_written_bytes=0# sync log buff to disk every interval seconds
# must > 0, default value is 10 seconds
sync_log_buff_interval=10# sync binlog buff / cache to disk every interval seconds
# default value is 60 seconds
sync_binlog_buff_interval=10# sync storage stat info to disk every interval seconds
# default value is 300 seconds
sync_stat_file_interval=300# thread stack size, should >= 512KB
# default value is 512KB
thread_stack_size=512KB# the priority as a source server for uploading file.
# the lower this value, the higher its uploading priority.
# default value is 10
upload_priority=10# the NIC alias prefix, such as eth in Linux, you can see it by ifconfig -a
# multi aliases split by comma. empty value means auto set by OS type
# default values is empty
if_alias_prefix=# if check file duplicate, when set to true, use FastDHT to store file indexes
# 1 or yes: need check
# 0 or no: do not check
# default value is 0
check_file_duplicate=0# file signature method for check file duplicate
## hash: four 32 bits hash code
## md5: MD5 signature
# default value is hash
# since V4.01
file_signature_method=hash# namespace for storing file indexes (key-value pairs)
# this item must be set when check_file_duplicate is true / on
key_namespace=FastDFS# set keep_alive to 1 to enable persistent connection with FastDHT servers
# default value is 0 (short connection)
keep_alive=0# you can use "#include filename" (not include double quotes) directive to 
# load FastDHT server list, when the filename is a relative path such as 
# pure filename, the base path is the base path of current/this config file.
# must set FastDHT server list when check_file_duplicate is true / on
# please see INSTALL of FastDHT for detail
##include /home/yuqing/fastdht/conf/fdht_servers.conf# if log to access log
# default value is false
# since V4.00
use_access_log = false# if rotate the access log every day
# default value is false
# since V4.00
rotate_access_log = false# rotate access log time base, time format: Hour:Minute
# Hour from 0 to 23, Minute from 0 to 59
# default value is 00:00
# since V4.00
access_log_rotate_time=00:00# if rotate the error log every day
# default value is false
# since V4.02
rotate_error_log = false# rotate error log time base, time format: Hour:Minute
# Hour from 0 to 23, Minute from 0 to 59
# default value is 00:00
# since V4.02
error_log_rotate_time=00:00# rotate access log when the log file exceeds this size
# 0 means never rotates log file by log file size
# default value is 0
# since V4.02
rotate_access_log_size = 0# rotate error log when the log file exceeds this size
# 0 means never rotates log file by log file size
# default value is 0
# since V4.02
rotate_error_log_size = 0# keep days of the log files
# 0 means do not delete old log files
# default value is 0
log_file_keep_days = 0# if skip the invalid record when sync file
# default value is false
# since V4.02
file_sync_skip_invalid_record=false# if use connection pool
# default value is false
# since V4.05
use_connection_pool = false# connections whose the idle time exceeds this time will be closed
# unit: second
# default value is 3600
# since V4.05
connection_pool_max_idle_time = 3600# use the ip address of this storage server if domain_name is empty,
# else this domain name will ocur in the url redirected by the tracker server
http.domain_name=# the port of the web server on this storage server
http.server_port=8888

Java-client。

https://github.com/happyfish100/fastdfs-client-java

底层:Socket。

<?xml version="1.0" encoding="UTF-8"?>
<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.geek</groupId><artifactId>fastdfs_geek</artifactId><version>1.0-SNAPSHOT</version><parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>2.1.3.RELEASE</version></parent><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><!-- https://mvnrepository.com/artifact/net.oschina.zcx7878/fastdfs-client-java --><dependency><groupId>net.oschina.zcx7878</groupId><artifactId>fastdfs-client-java</artifactId><version>1.27.0.0</version></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></dependency><dependency><groupId>commons-io</groupId><artifactId>commons-io</artifactId><version>2.4</version></dependency></dependencies></project>
配置。
.conf 配置文件、所在目录、加载优先顺序。

配置文件名 fdfs_client.conf(或使用其它文件名xxx_yyy.conf)。

文件所在位置可以是项目 classpath(或 OS 文件系统目录比如 /opt/)。

/opt/fdfs_client.conf
C:\Users\James\config\fdfs_client.conf

优先按 OS 文件系统路径读取,没有找到才查找项目 classpath,尤其针对 Linux 环境下的相对路径比如。

fdfs_client.conf
config/fdfs_client.conf


.properties 配置文件、所在目录、加载优先顺序。

配置文件名 fastdfs-client.properties(或使用其它文件名 xxx-yyy.properties)。

文件所在位置可以是项目 classpath(或 OS 文件系统目录比如 /opt/)。

/opt/fastdfs-client.properties
C:\Users\James\config\fastdfs-client.properties

优先按 OS 文件系统路径读取,没有找到才查找项目 classpath,尤其针对 Linux 环境下的相对路径比如。

fastdfs-client.properties
config/fastdfs-client.properties

fastdfs.connect_timeout_in_seconds=5
fastdfs.network_timeout_in_seconds=30
fastdfs.charset=UTF-8
fastdfs.http_anti_steal_token=false
fastdfs.http_secret_key=FastDFS1234567890
fastdfs.http_tracker_http_port=80
fastdfs.tracker_servers=192.168.142.161:22122
fastdfs.connection_pool.enabled=true
fastdfs.connection_pool.max_count_per_entry=500
fastdfs.connection_pool.max_idle_time=3600
fastdfs.connection_pool.max_wait_time_in_ms=1000

上传文件。
package com.geek.fastdfs;import org.csource.common.MyException;
import org.csource.common.NameValuePair;
import org.csource.fastdfs.*;
import org.junit.Test;import java.io.IOException;public class TestFastDfs {private String conf_filename = "config/fdfs-client.properties";@Testpublic void testUpload() {System.out.println("java.version=" + System.getProperty("java.version"));try {// 加载配置文件。ClientGlobal.initByProperties(conf_filename);System.out.println("network_timeout=" + ClientGlobal.g_network_timeout + "ms");System.out.println("charset=" + ClientGlobal.g_charset);// 创建 Tracker 客户端。TrackerClient tracker = new TrackerClient();TrackerServer trackerServer = tracker.getConnection();StorageServer storageServer = null;// 定义 Storage 客户端。StorageClient1 client = new StorageClient1(trackerServer, storageServer);// 文件元信息。NameValuePair[] metaList = new NameValuePair[1];metaList[0] = new NameValuePair("fileName", "hello.txt");// 执行上传。String fileId = client.upload_file1("C:\\Users\\geek\\Desktop\\hello.txt", "txt", metaList);System.out.println("upload success. file id is: " + fileId);int i = 0;while (i++ < 10) {byte[] result = client.download_file1(fileId);System.out.println(i + ", download result is: " + result.length);}} catch (IOException e) {e.printStackTrace();} catch (MyException e) {e.printStackTrace();}}
}/*
java.version=1.8.0_241
network_timeout=30000ms
charset=UTF-8
upload success. file id is: group1/M00/00/00/wKiOoV74416Ab7YEAAAAETi0qDc272.txt
1, download result is: 17
2, download result is: 17
3, download result is: 17
4, download result is: 17
5, download result is: 17
6, download result is: 17
7, download result is: 17
8, download result is: 17
9, download result is: 17
10, download result is: 17Process finished with exit code 0*/
  • 查看文件。

group1/M00/00/00/wKiOoV74416Ab7YEAAAAETi0qDc272.txt

[root@192 00]# pwd
/home/fastdfs/fdfs_storage/data/00/00
[root@192 00]# ll
total 8
-rw-r--r--. 1 root root 17 Jun 29 02:37 wKiOoV74416Ab7YEAAAAETi0qDc272.txt
-rw-r--r--. 1 root root 18 Jun 29 02:37 wKiOoV74416Ab7YEAAAAETi0qDc272.txt-m

查询文件。
    @Testpublic void testQuery() {System.out.println("java.version=" + System.getProperty("java.version"));try {// 加载配置文件。ClientGlobal.initByProperties(conf_filename);System.out.println("network_timeout=" + ClientGlobal.g_network_timeout + "ms");System.out.println("charset=" + ClientGlobal.g_charset);// 创建 Tracker 客户端。TrackerClient tracker = new TrackerClient();TrackerServer trackerServer = tracker.getConnection();StorageServer storageServer = null;// 定义 Storage 客户端。StorageClient1 client = new StorageClient1(trackerServer, storageServer);FileInfo fileInfo = client.query_file_info("group1", "M00/00/00/wKiOoV74416Ab7YEAAAAETi0qDc272.txt");System.out.println("fileInfo = " + fileInfo);// fileInfo = source_ip_addr = 192.168.142.161, file_size = 17, create_timestamp = 2020-06-29 02:37:18, crc32 = 951363639// 根据文件 id 查询。FileInfo fileInfo1 = client.query_file_info1("group1/M00/00/00/wKiOoV74416Ab7YEAAAAETi0qDc272.txt");System.out.println("fileInfo1 = " + fileInfo1);// 查询元信息。NameValuePair[] metadata1 = client.get_metadata1("group1/M00/00/00/wKiOoV74416Ab7YEAAAAETi0qDc272.txt");System.out.println("metadata1 = " + metadata1);// 关闭。trackerServer.close();} catch (IOException e) {e.printStackTrace();} catch (MyException e) {e.printStackTrace();}}

下载文件。
    @Testpublic void testDown() {System.out.println("java.version=" + System.getProperty("java.version"));try {// 加载配置文件。ClientGlobal.initByProperties(conf_filename);System.out.println("network_timeout=" + ClientGlobal.g_network_timeout + "ms");System.out.println("charset=" + ClientGlobal.g_charset);// 创建 Tracker 客户端。TrackerClient tracker = new TrackerClient();TrackerServer trackerServer = tracker.getConnection();StorageServer storageServer = null;// 定义 Storage 客户端。StorageClient1 client = new StorageClient1(trackerServer, storageServer);byte[] bytes = client.download_file1("group1/M00/00/00/wKiOoV74416Ab7YEAAAAETi0qDc272.txt");File file = new File("./a.txt");FileOutputStream fileOutputStream = new FileOutputStream(file);fileOutputStream.write(bytes);fileOutputStream.close();// 关闭。trackerServer.close();} catch (IOException e) {e.printStackTrace();} catch (MyException e) {e.printStackTrace();}}
查看全文
如若内容造成侵权/违法违规/事实不符,请联系编程学习网邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!

相关文章

  1. 银行家算法

    一、死锁及银行家算法背景介绍 1 .死锁1.1定义:指的是多个进程在运行过程中因为争夺资源而造成的种僵局,当进程处于这种僵局状态时,若无外力作用,他们都将无法再向前推进的状态。1.2 产生死锁的原因:(1)竞争非可剥夺性资; (2)进程推进不当。1.3产生死锁的必要条件:(1)互斥…...

    2024/4/30 13:36:01
  2. 福建师范大学2020年8月课程考试《德育论》作业考核试题

    【声明】本博文内容,如有侵权,请告知我,我会删除 如回复不及时,联系威信-xhmcz122 德育论A卷试题 一、单选(共10题,每题1分,共10分。) 1.孟子曰:“人之所以异于禽兽者几希,去之,存之。舜明于庶物,察于人伦,由仁义行,非行仁义也”。 A.庶民;君子 B.君子;庶民 2.…...

    2024/4/28 12:22:01
  3. navigate 远程连接 linux mysql 数据库

    第一种 开放3306端口 且 授权所有ip可以远程连接或者 自己是被授权可连接ip 且 mysql 的 root and password exists第二种:3306 端口外网不可访问。 且 linux 的 root and password exists 且 mysql 的 root and password exists①②...

    2024/5/6 21:25:30
  4. Intellij IDEA Community 实现 Ultimate 的功能

    Ultimate 与 Community 版本区别 Intellij IDEA 官网 https://www.jetbrains.com/idea/download/#section=windows 有两个下载链接,分别是 Ultimate 和 Community Ultimate 的很多功能 Comminuty 都没有,所以很多新手朋友都会去下只有30天试用期的 Ultimate 版本(因为 Ultim…...

    2024/5/6 22:36:35
  5. 2020.7.24训练总结

    感受:感觉出来短板在哪了。dp不够准,图论见的太少,水题做的太慢。还有一些思维题不够相信自己的结论(明明是对的),总是想要自己推翻自己想出来的结论,推翻不了就觉得自己是错的(什么狗屁逻辑对的当然推翻不了了!!)。还是要加强自己的在思维方面的准确度。有些思维题…...

    2024/5/4 18:47:25
  6. 2020电工(初级)模拟考试题库及电工(初级)实操考试视频

    题库来源:安全生产模拟考试一点通公众号小程序2020电工(初级)模拟考试题库及电工(初级)实操考试视频,包含电工(初级)模拟考试题库答案解析及电工(初级)实操考试视频练习。由安全生产模拟考试一点通公众号结合国家电工(初级)考试最新大纲及电工(初级)考试真题出具…...

    2024/5/6 20:04:38
  7. 2020R1快开门式压力容器操作模拟考试系统及R1快开门式压力容器操作在线考试

    题库来源:安全生产模拟考试一点通公众号小程序2020R1快开门式压力容器操作模拟考试系统及R1快开门式压力容器操作在线考试,包含R1快开门式压力容器操作模拟考试系统答案解析及R1快开门式压力容器操作在线考试练习。由安全生产模拟考试一点通公众号结合国家R1快开门式压力容器…...

    2024/4/14 18:28:05
  8. (2.3.15)Java的不可变类

    不可变类的意思是创建该类的实例后,该实例的属性是不可改变的; 所以不可变类并不是指该类是被final修饰的,而是指该类的属性是被final修饰的 一、什么是不可变类 Effective Java中定义: 不可变类:其实例不能被修改的类。每个实例中包含的所有信息都必须在创建该实例的时候…...

    2024/4/24 2:43:21
  9. java创建线程的三种方式、以及创建线程池的四中方式 (待完善)

    一、概述1.1 java创建线程的三种方式继承Thread类创建线程类实现Runnable接口通过Callable和Future创建线程1.2 java创建线程池的四种方式newCachedThreadPool 创建一个可缓存的线程池,如果线程池长度超过处理需求,可灵活回收空闲线程,若无可回收,则新建线程newFixedThrea…...

    2024/4/30 17:16:17
  10. 410.分割数组的最大值 (二分法)------ 力扣每日打卡Day6

    目录1.题目2.题目分析3.代码二分法实现4.总结 1.题目给定一个非负整数数组和一个整数 m,你需要将这个数组分成 m 个非空的连续子数组。设计一个算法使得这 m 个子数组各自和的最大值最小。注意: 数组长度 n 满足以下条件:1 ≤ n ≤ 1000 1 ≤ m ≤ min(50, n)来源:力扣(Leet…...

    2024/5/6 21:46:48
  11. WEB-矛盾

    题目的意思是num不是数字但是num=1,我们看看这个函数而且php是一个弱类型的语言 ==表示的是等于 ,只要数值等于就可以了,类型无所谓的可以验证一下没问题...

    2024/4/26 13:51:18
  12. oracle select in超过1000条报错解决方法

    本博客介绍oracle select in超过1000条数据的解决方法,java框架是采用mybatis的,这可以说是一种比较常见的错误:select * from A where id in(...),oracle官方函数做了限定,in里的参数只能1000个,所以超过1000个参数就会报错,解决方法是将集合分为每个集合1000的小集合,…...

    2024/4/22 16:52:36
  13. Java面向对象入门

    Java面向对象入门到入土(施工中)1.面向对象基础1.1概述1.2面向对象特征1.2.1封装性1.2.2继承性1.2.3多态性1.3类与对象1.3.1 类与对象的关系1.3.2 类的定义格式1.3.3 属性与方法1.3.4对象的创建1.4创建对象内存分析1.4.1 栈(stack)1.4.2 堆(heap)1.4.3 方法区1.5构造方法…...

    2024/4/28 1:06:16
  14. 关于 Promise 的一些个人总结

    什么是 Promise?我认为通俗点讲,Promise是一个构造函数。Promise 使用方式:let p = new Promise((resolve, reject) => {resolve("成功了!") }).then(res => {console.log(res) }).catch(res => {console.log(res) })Promise 在新建时可以选择性的传入两…...

    2024/5/2 0:28:37
  15. 不使用IDE发布Tomcat工程的三种方法

    文章目录将项目部署到Tomcat中的三种方式第一种:拷贝这个文件到webapps目录下第二种:配置虚拟路径方式一第三种:配置虚拟路径方式二 将项目部署到Tomcat中的三种方式 第一种:拷贝这个文件到webapps目录下将工程包放入到webapps目录下即可访问 访问project工程:http://localhost…...

    2024/4/30 15:20:58
  16. 邮件发送

    邮件发送原理及实现 1、原理图2、传输协议 2.1、SMTP协议 发送邮件: 我们通常把处理用户smtp请求(邮件发送请求)的服务器称之为SMTP服务器(邮件发送服务器)。 SMTP服务器地址:一般是smtp.xxx.com,比如163邮箱是smtp.163.com 2.2、POP3协议 接收邮件: 我们通常把处理永辉p…...

    2024/5/6 23:46:14
  17. 零基础入门NLP-新闻文本分类【Task3】

    零基础入门NLP-新闻文本分类【Task3】Task3 基于机器学习的文本分类学习目标文本表示方法One-hotBag of WordsN-gramTF-IDF基于机器学习的文本分类Count Vectors + RidgeClassifierTF-IDF + RidgeClassifier本章小结 Task3 基于机器学习的文本分类 学习目标学会TF-IDF的原理和使…...

    2024/4/9 3:01:23
  18. Java初学日记七之系统异常类

    Java中的异常类 一、什么是异常 在Java中,程序编写和运行时,经常会碰到一些非正常情况,导致程序不能正常运行。而我们将这些情况分为两大类,一种是编译时异常,一种是运行时异常。 所有的异常都是从Throwable继承而来 Throwable有两个子类,Error和Exception。 Error类: 其…...

    2024/4/24 4:07:56
  19. 小程序商家如何享受到视频号的流量红利?

    作为短视频领域的新手,视频号的成长速度快的惊人。 与抖音、快手这些成熟的短视频平台相比,微信的视频号就像一个还待生长的幼儿,弱小却又有着无限的未来。01微信扶持视频号的原因 1.补上内容形式上的短板 在视频号推出之前,腾讯曾推出多个短视频APP,如微视,但投入市场之…...

    2024/5/6 10:48:19
  20. 做一个公式计算器,使用双栈(数值栈、运算符栈)实现,支持常见科学计算器具备的功能和括号

    做一个公式计算器,使用双栈(数值栈、运算符栈)实现,支持常见科学计算器具备的功能和括号 基本功能介绍注意,本文章不给出完整代码,先说明一下 整体逻辑介绍 -------------------------- name:公式计算器 author:Ugex.Savelar date:2020-7-25 -------------------------- …...

    2024/4/26 10:35:15

最新文章

  1. 【redis】redis持久化分析

    目录 持久化Redis持久化redis持久化的方式持久化策略的设置1. RDB&#xff08;快照&#xff09;fork(多进程)RDB配置触发RDB备份自动备份手动执行命令备份&#xff08;save | bgsave&#xff09;flushall命令主从同步触发动态停止RDB RDB 文件恢复验证 RDB 文件是否被加载 RDB …...

    2024/5/7 8:10:23
  2. 梯度消失和梯度爆炸的一些处理方法

    在这里是记录一下梯度消失或梯度爆炸的一些处理技巧。全当学习总结了如有错误还请留言&#xff0c;在此感激不尽。 权重和梯度的更新公式如下&#xff1a; w w − η ⋅ ∇ w w w - \eta \cdot \nabla w ww−η⋅∇w 个人通俗的理解梯度消失就是网络模型在反向求导的时候出…...

    2024/5/6 9:38:23
  3. 从头开发一个RISC-V的操作系统(二)RISC-V 指令集架构介绍

    文章目录 前提ISA的基本介绍ISA是什么CISC vs RISCISA的宽度 RISC-V指令集RISC-V ISA的命名规范模块化的ISA通用寄存器Hart特权级别内存管理与保护异常和中断 目标&#xff1a;通过这一个系列课程的学习&#xff0c;开发出一个简易的在RISC-V指令集架构上运行的操作系统。 前提…...

    2024/5/5 1:33:57
  4. Java-运算符

    运算符 Java语言支持如下运算符&#xff1a; 算术运算符&#xff1a;&#xff0c;-&#xff0c;*&#xff0c;/&#xff0c;%&#xff0c;&#xff0c;--复制运算符&#xff1a;关系运算符&#xff1a;>, <, >, <, , !instanceof逻辑运算符&#xff1a;&&…...

    2024/5/6 22:48:41
  5. 416. 分割等和子集问题(动态规划)

    题目 题解 class Solution:def canPartition(self, nums: List[int]) -> bool:# badcaseif not nums:return True# 不能被2整除if sum(nums) % 2 ! 0:return False# 状态定义&#xff1a;dp[i][j]表示当背包容量为j&#xff0c;用前i个物品是否正好可以将背包填满&#xff…...

    2024/5/6 18:23:10
  6. 【Java】ExcelWriter自适应宽度工具类(支持中文)

    工具类 import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.CellType; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet;/*** Excel工具类** author xiaoming* date 2023/11/17 10:40*/ public class ExcelUti…...

    2024/5/6 18:40:38
  7. Spring cloud负载均衡@LoadBalanced LoadBalancerClient

    LoadBalance vs Ribbon 由于Spring cloud2020之后移除了Ribbon&#xff0c;直接使用Spring Cloud LoadBalancer作为客户端负载均衡组件&#xff0c;我们讨论Spring负载均衡以Spring Cloud2020之后版本为主&#xff0c;学习Spring Cloud LoadBalance&#xff0c;暂不讨论Ribbon…...

    2024/5/6 23:37:19
  8. TSINGSEE青犀AI智能分析+视频监控工业园区周界安全防范方案

    一、背景需求分析 在工业产业园、化工园或生产制造园区中&#xff0c;周界防范意义重大&#xff0c;对园区的安全起到重要的作用。常规的安防方式是采用人员巡查&#xff0c;人力投入成本大而且效率低。周界一旦被破坏或入侵&#xff0c;会影响园区人员和资产安全&#xff0c;…...

    2024/5/6 7:24:07
  9. VB.net WebBrowser网页元素抓取分析方法

    在用WebBrowser编程实现网页操作自动化时&#xff0c;常要分析网页Html&#xff0c;例如网页在加载数据时&#xff0c;常会显示“系统处理中&#xff0c;请稍候..”&#xff0c;我们需要在数据加载完成后才能继续下一步操作&#xff0c;如何抓取这个信息的网页html元素变化&…...

    2024/5/7 0:32:52
  10. 【Objective-C】Objective-C汇总

    方法定义 参考&#xff1a;https://www.yiibai.com/objective_c/objective_c_functions.html Objective-C编程语言中方法定义的一般形式如下 - (return_type) method_name:( argumentType1 )argumentName1 joiningArgument2:( argumentType2 )argumentName2 ... joiningArgu…...

    2024/5/6 6:01:13
  11. 【洛谷算法题】P5713-洛谷团队系统【入门2分支结构】

    &#x1f468;‍&#x1f4bb;博客主页&#xff1a;花无缺 欢迎 点赞&#x1f44d; 收藏⭐ 留言&#x1f4dd; 加关注✅! 本文由 花无缺 原创 收录于专栏 【洛谷算法题】 文章目录 【洛谷算法题】P5713-洛谷团队系统【入门2分支结构】&#x1f30f;题目描述&#x1f30f;输入格…...

    2024/5/6 7:24:06
  12. 【ES6.0】- 扩展运算符(...)

    【ES6.0】- 扩展运算符... 文章目录 【ES6.0】- 扩展运算符...一、概述二、拷贝数组对象三、合并操作四、参数传递五、数组去重六、字符串转字符数组七、NodeList转数组八、解构变量九、打印日志十、总结 一、概述 **扩展运算符(...)**允许一个表达式在期望多个参数&#xff0…...

    2024/5/7 1:54:46
  13. 摩根看好的前智能硬件头部品牌双11交易数据极度异常!——是模式创新还是饮鸩止渴?

    文 | 螳螂观察 作者 | 李燃 双11狂欢已落下帷幕&#xff0c;各大品牌纷纷晒出优异的成绩单&#xff0c;摩根士丹利投资的智能硬件头部品牌凯迪仕也不例外。然而有爆料称&#xff0c;在自媒体平台发布霸榜各大榜单喜讯的凯迪仕智能锁&#xff0c;多个平台数据都表现出极度异常…...

    2024/5/6 20:04:22
  14. Go语言常用命令详解(二)

    文章目录 前言常用命令go bug示例参数说明 go doc示例参数说明 go env示例 go fix示例 go fmt示例 go generate示例 总结写在最后 前言 接着上一篇继续介绍Go语言的常用命令 常用命令 以下是一些常用的Go命令&#xff0c;这些命令可以帮助您在Go开发中进行编译、测试、运行和…...

    2024/5/7 0:32:51
  15. 用欧拉路径判断图同构推出reverse合法性:1116T4

    http://cplusoj.com/d/senior/p/SS231116D 假设我们要把 a a a 变成 b b b&#xff0c;我们在 a i a_i ai​ 和 a i 1 a_{i1} ai1​ 之间连边&#xff0c; b b b 同理&#xff0c;则 a a a 能变成 b b b 的充要条件是两图 A , B A,B A,B 同构。 必要性显然&#xff0…...

    2024/5/6 7:24:04
  16. 【NGINX--1】基础知识

    1、在 Debian/Ubuntu 上安装 NGINX 在 Debian 或 Ubuntu 机器上安装 NGINX 开源版。 更新已配置源的软件包信息&#xff0c;并安装一些有助于配置官方 NGINX 软件包仓库的软件包&#xff1a; apt-get update apt install -y curl gnupg2 ca-certificates lsb-release debian-…...

    2024/5/6 7:24:04
  17. Hive默认分割符、存储格式与数据压缩

    目录 1、Hive默认分割符2、Hive存储格式3、Hive数据压缩 1、Hive默认分割符 Hive创建表时指定的行受限&#xff08;ROW FORMAT&#xff09;配置标准HQL为&#xff1a; ... ROW FORMAT DELIMITED FIELDS TERMINATED BY \u0001 COLLECTION ITEMS TERMINATED BY , MAP KEYS TERMI…...

    2024/5/6 19:38:16
  18. 【论文阅读】MAG:一种用于航天器遥测数据中有效异常检测的新方法

    文章目录 摘要1 引言2 问题描述3 拟议框架4 所提出方法的细节A.数据预处理B.变量相关分析C.MAG模型D.异常分数 5 实验A.数据集和性能指标B.实验设置与平台C.结果和比较 6 结论 摘要 异常检测是保证航天器稳定性的关键。在航天器运行过程中&#xff0c;传感器和控制器产生大量周…...

    2024/5/6 7:24:03
  19. --max-old-space-size=8192报错

    vue项目运行时&#xff0c;如果经常运行慢&#xff0c;崩溃停止服务&#xff0c;报如下错误 FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory 因为在 Node 中&#xff0c;通过JavaScript使用内存时只能使用部分内存&#xff08;64位系统&…...

    2024/5/7 0:32:49
  20. 基于深度学习的恶意软件检测

    恶意软件是指恶意软件犯罪者用来感染个人计算机或整个组织的网络的软件。 它利用目标系统漏洞&#xff0c;例如可以被劫持的合法软件&#xff08;例如浏览器或 Web 应用程序插件&#xff09;中的错误。 恶意软件渗透可能会造成灾难性的后果&#xff0c;包括数据被盗、勒索或网…...

    2024/5/6 21:25:34
  21. JS原型对象prototype

    让我简单的为大家介绍一下原型对象prototype吧&#xff01; 使用原型实现方法共享 1.构造函数通过原型分配的函数是所有对象所 共享的。 2.JavaScript 规定&#xff0c;每一个构造函数都有一个 prototype 属性&#xff0c;指向另一个对象&#xff0c;所以我们也称为原型对象…...

    2024/5/6 7:24:02
  22. C++中只能有一个实例的单例类

    C中只能有一个实例的单例类 前面讨论的 President 类很不错&#xff0c;但存在一个缺陷&#xff1a;无法禁止通过实例化多个对象来创建多名总统&#xff1a; President One, Two, Three; 由于复制构造函数是私有的&#xff0c;其中每个对象都是不可复制的&#xff0c;但您的目…...

    2024/5/7 7:26:29
  23. python django 小程序图书借阅源码

    开发工具&#xff1a; PyCharm&#xff0c;mysql5.7&#xff0c;微信开发者工具 技术说明&#xff1a; python django html 小程序 功能介绍&#xff1a; 用户端&#xff1a; 登录注册&#xff08;含授权登录&#xff09; 首页显示搜索图书&#xff0c;轮播图&#xff0…...

    2024/5/7 0:32:47
  24. 电子学会C/C++编程等级考试2022年03月(一级)真题解析

    C/C++等级考试(1~8级)全部真题・点这里 第1题:双精度浮点数的输入输出 输入一个双精度浮点数,保留8位小数,输出这个浮点数。 时间限制:1000 内存限制:65536输入 只有一行,一个双精度浮点数。输出 一行,保留8位小数的浮点数。样例输入 3.1415926535798932样例输出 3.1…...

    2024/5/6 16:50:57
  25. 配置失败还原请勿关闭计算机,电脑开机屏幕上面显示,配置失败还原更改 请勿关闭计算机 开不了机 这个问题怎么办...

    解析如下&#xff1a;1、长按电脑电源键直至关机&#xff0c;然后再按一次电源健重启电脑&#xff0c;按F8健进入安全模式2、安全模式下进入Windows系统桌面后&#xff0c;按住“winR”打开运行窗口&#xff0c;输入“services.msc”打开服务设置3、在服务界面&#xff0c;选中…...

    2022/11/19 21:17:18
  26. 错误使用 reshape要执行 RESHAPE,请勿更改元素数目。

    %读入6幅图像&#xff08;每一幅图像的大小是564*564&#xff09; f1 imread(WashingtonDC_Band1_564.tif); subplot(3,2,1),imshow(f1); f2 imread(WashingtonDC_Band2_564.tif); subplot(3,2,2),imshow(f2); f3 imread(WashingtonDC_Band3_564.tif); subplot(3,2,3),imsho…...

    2022/11/19 21:17:16
  27. 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机...

    win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”问题的解决方法在win7系统关机时如果有升级系统的或者其他需要会直接进入一个 等待界面&#xff0c;在等待界面中我们需要等待操作结束才能关机&#xff0c;虽然这比较麻烦&#xff0c;但是对系统进行配置和升级…...

    2022/11/19 21:17:15
  28. 台式电脑显示配置100%请勿关闭计算机,“准备配置windows 请勿关闭计算机”的解决方法...

    有不少用户在重装Win7系统或更新系统后会遇到“准备配置windows&#xff0c;请勿关闭计算机”的提示&#xff0c;要过很久才能进入系统&#xff0c;有的用户甚至几个小时也无法进入&#xff0c;下面就教大家这个问题的解决方法。第一种方法&#xff1a;我们首先在左下角的“开始…...

    2022/11/19 21:17:14
  29. win7 正在配置 请勿关闭计算机,怎么办Win7开机显示正在配置Windows Update请勿关机...

    置信有很多用户都跟小编一样遇到过这样的问题&#xff0c;电脑时发现开机屏幕显现“正在配置Windows Update&#xff0c;请勿关机”(如下图所示)&#xff0c;而且还需求等大约5分钟才干进入系统。这是怎样回事呢&#xff1f;一切都是正常操作的&#xff0c;为什么开时机呈现“正…...

    2022/11/19 21:17:13
  30. 准备配置windows 请勿关闭计算机 蓝屏,Win7开机总是出现提示“配置Windows请勿关机”...

    Win7系统开机启动时总是出现“配置Windows请勿关机”的提示&#xff0c;没过几秒后电脑自动重启&#xff0c;每次开机都这样无法进入系统&#xff0c;此时碰到这种现象的用户就可以使用以下5种方法解决问题。方法一&#xff1a;开机按下F8&#xff0c;在出现的Windows高级启动选…...

    2022/11/19 21:17:12
  31. 准备windows请勿关闭计算机要多久,windows10系统提示正在准备windows请勿关闭计算机怎么办...

    有不少windows10系统用户反映说碰到这样一个情况&#xff0c;就是电脑提示正在准备windows请勿关闭计算机&#xff0c;碰到这样的问题该怎么解决呢&#xff0c;现在小编就给大家分享一下windows10系统提示正在准备windows请勿关闭计算机的具体第一种方法&#xff1a;1、2、依次…...

    2022/11/19 21:17:11
  32. 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”的解决方法...

    今天和大家分享一下win7系统重装了Win7旗舰版系统后&#xff0c;每次关机的时候桌面上都会显示一个“配置Windows Update的界面&#xff0c;提示请勿关闭计算机”&#xff0c;每次停留好几分钟才能正常关机&#xff0c;导致什么情况引起的呢&#xff1f;出现配置Windows Update…...

    2022/11/19 21:17:10
  33. 电脑桌面一直是清理请关闭计算机,windows7一直卡在清理 请勿关闭计算机-win7清理请勿关机,win7配置更新35%不动...

    只能是等着&#xff0c;别无他法。说是卡着如果你看硬盘灯应该在读写。如果从 Win 10 无法正常回滚&#xff0c;只能是考虑备份数据后重装系统了。解决来方案一&#xff1a;管理员运行cmd&#xff1a;net stop WuAuServcd %windir%ren SoftwareDistribution SDoldnet start WuA…...

    2022/11/19 21:17:09
  34. 计算机配置更新不起,电脑提示“配置Windows Update请勿关闭计算机”怎么办?

    原标题&#xff1a;电脑提示“配置Windows Update请勿关闭计算机”怎么办&#xff1f;win7系统中在开机与关闭的时候总是显示“配置windows update请勿关闭计算机”相信有不少朋友都曾遇到过一次两次还能忍但经常遇到就叫人感到心烦了遇到这种问题怎么办呢&#xff1f;一般的方…...

    2022/11/19 21:17:08
  35. 计算机正在配置无法关机,关机提示 windows7 正在配置windows 请勿关闭计算机 ,然后等了一晚上也没有关掉。现在电脑无法正常关机...

    关机提示 windows7 正在配置windows 请勿关闭计算机 &#xff0c;然后等了一晚上也没有关掉。现在电脑无法正常关机以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容&#xff0c;让我们赶快一起来看一下吧&#xff01;关机提示 windows7 正在配…...

    2022/11/19 21:17:05
  36. 钉钉提示请勿通过开发者调试模式_钉钉请勿通过开发者调试模式是真的吗好不好用...

    钉钉请勿通过开发者调试模式是真的吗好不好用 更新时间:2020-04-20 22:24:19 浏览次数:729次 区域: 南阳 > 卧龙 列举网提醒您:为保障您的权益,请不要提前支付任何费用! 虚拟位置外设器!!轨迹模拟&虚拟位置外设神器 专业用于:钉钉,外勤365,红圈通,企业微信和…...

    2022/11/19 21:17:05
  37. 配置失败还原请勿关闭计算机怎么办,win7系统出现“配置windows update失败 还原更改 请勿关闭计算机”,长时间没反应,无法进入系统的解决方案...

    前几天班里有位学生电脑(windows 7系统)出问题了&#xff0c;具体表现是开机时一直停留在“配置windows update失败 还原更改 请勿关闭计算机”这个界面&#xff0c;长时间没反应&#xff0c;无法进入系统。这个问题原来帮其他同学也解决过&#xff0c;网上搜了不少资料&#x…...

    2022/11/19 21:17:04
  38. 一个电脑无法关闭计算机你应该怎么办,电脑显示“清理请勿关闭计算机”怎么办?...

    本文为你提供了3个有效解决电脑显示“清理请勿关闭计算机”问题的方法&#xff0c;并在最后教给你1种保护系统安全的好方法&#xff0c;一起来看看&#xff01;电脑出现“清理请勿关闭计算机”在Windows 7(SP1)和Windows Server 2008 R2 SP1中&#xff0c;添加了1个新功能在“磁…...

    2022/11/19 21:17:03
  39. 请勿关闭计算机还原更改要多久,电脑显示:配置windows更新失败,正在还原更改,请勿关闭计算机怎么办...

    许多用户在长期不使用电脑的时候&#xff0c;开启电脑发现电脑显示&#xff1a;配置windows更新失败&#xff0c;正在还原更改&#xff0c;请勿关闭计算机。。.这要怎么办呢&#xff1f;下面小编就带着大家一起看看吧&#xff01;如果能够正常进入系统&#xff0c;建议您暂时移…...

    2022/11/19 21:17:02
  40. 还原更改请勿关闭计算机 要多久,配置windows update失败 还原更改 请勿关闭计算机,电脑开机后一直显示以...

    配置windows update失败 还原更改 请勿关闭计算机&#xff0c;电脑开机后一直显示以以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容&#xff0c;让我们赶快一起来看一下吧&#xff01;配置windows update失败 还原更改 请勿关闭计算机&#x…...

    2022/11/19 21:17:01
  41. 电脑配置中请勿关闭计算机怎么办,准备配置windows请勿关闭计算机一直显示怎么办【图解】...

    不知道大家有没有遇到过这样的一个问题&#xff0c;就是我们的win7系统在关机的时候&#xff0c;总是喜欢显示“准备配置windows&#xff0c;请勿关机”这样的一个页面&#xff0c;没有什么大碍&#xff0c;但是如果一直等着的话就要两个小时甚至更久都关不了机&#xff0c;非常…...

    2022/11/19 21:17:00
  42. 正在准备配置请勿关闭计算机,正在准备配置windows请勿关闭计算机时间长了解决教程...

    当电脑出现正在准备配置windows请勿关闭计算机时&#xff0c;一般是您正对windows进行升级&#xff0c;但是这个要是长时间没有反应&#xff0c;我们不能再傻等下去了。可能是电脑出了别的问题了&#xff0c;来看看教程的说法。正在准备配置windows请勿关闭计算机时间长了方法一…...

    2022/11/19 21:16:59
  43. 配置失败还原请勿关闭计算机,配置Windows Update失败,还原更改请勿关闭计算机...

    我们使用电脑的过程中有时会遇到这种情况&#xff0c;当我们打开电脑之后&#xff0c;发现一直停留在一个界面&#xff1a;“配置Windows Update失败&#xff0c;还原更改请勿关闭计算机”&#xff0c;等了许久还是无法进入系统。如果我们遇到此类问题应该如何解决呢&#xff0…...

    2022/11/19 21:16:58
  44. 如何在iPhone上关闭“请勿打扰”

    Apple’s “Do Not Disturb While Driving” is a potentially lifesaving iPhone feature, but it doesn’t always turn on automatically at the appropriate time. For example, you might be a passenger in a moving car, but your iPhone may think you’re the one dri…...

    2022/11/19 21:16:57