CentOS 7 安装、测试和部署FastDFS
目录
FastDFS环境搭建
安装 libfastcommon 库
安装FastDFS
查看编译后的文件
FastDFS配置
FastDFS启动
启动tracker服务
启动storage服务
查看storage是否已经注册到了tracker下
查看存储文件的目录
FastDFS重启
FastDFS关闭
使用fdfs_test进行测试
修改client.conf配置文件,修改两个配置
创建base_path指定的目录
fdfs命令格式
FastDFS的HTTP访问
安装Nginx并且添加FastDFS模块
nginx安装
将编译好的Nginx替换原有的Nginx
修改Nginx配置文件
重启Nginx
设置开机自启
FastDFS环境搭建
[root@centos_7_fastdfs01 ~]# yum install -y make cmake gcc gcc-c++ wget perl lrzsz
安装 libfastcommon 库
- 链接: https://pan.baidu.com/s/1PS4fmN4D6Krwqc9a2tk5Yw 提取码: b66k
- 将下载好的文件上传到Linux系统下
[root@centos_7_fastdfs01 ~]# tar -zxvf libfastcommon-1.0.75.tar.gz
- 切换到解压后的libfastcommon目录,执行make脚本进行编译
[root@centos_7_fastdfs01 ~]# cd libfastcommon-1.0.75
[root@centos_7_fastdfs01 libfastcommon-1.0.75]# ./make.sh
- 执行make install进行安装
[root@centos_7_fastdfs01 libfastcommon-1.0.39]# ./make.sh install
mkdir -p /usr/lib64
mkdir -p /usr/lib
mkdir -p /usr/include/fastcommon
install -m 755 libfastcommon.so /usr/lib64
install -m 644 common_define.h hash.h chain.h logger.h base64.h shared_func.h pthread_func.h ini_file_reader.h _os_define.h sockopt.h sched_thread.h http_func.h md5.h local_ip_func.h avl_tree.h ioevent.h ioevent_loop.h fast_task_queue.h fast_timer.h process_ctrl.h fast_mblock.h connection_pool.h fast_mpool.h fast_allocator.h fast_buffer.h skiplist.h multi_skiplist.h flat_skiplist.h skiplist_common.h system_info.h fast_blocked_queue.h php7_ext_wrapper.h id_generator.h char_converter.h char_convert_loader.h common_blocked_queue.h multi_socket_client.h skiplist_set.h fc_list.h /usr/include/fastcommon
if [ ! -e /usr/lib/libfastcommon.so ]; then ln -s /usr/lib64/libfastcommon.so /usr/lib/libfastcommon.so; fi
[root@centos_7_fastdfs01 libfastcommon-1.0.39]# echo $?
0
[root@centos_7_fastdfs01 libfastcommon-1.0.39]#
安装FastDFS
- 链接:https://pan.baidu.com/s/1AUlnfJAhSrji_vn8M_jOPQ 提取码: auae
- 链接:https://pan.baidu.com/s/1auPbOU7Nwy_kUqy0mkGFSg?pwd=pq1v 提取码:pq1v
- 将下载好的文件上传到Linux系统上
[root@centos_7_fastdfs01 ~]# ll fastdfs-6.12.2.tar.gz
-rw-r--r--. 1 root root 5312227 12月 21 09:07 fastdfs-6.12.2.tar.gz [root@centos_7_fastdfs01 ~]# tar xf fastdfs-6.12.2.tar.gz
[root@localhost ~]# tar xf libserverframe-1.2.5.tar.gz
[root@localhost ~]# cd libserverframe-1.2.5
[root@localhost libserverframe-1.2.5]# ./make.sh
[root@localhost libserverframe-1.2.5]# ./make.sh install
- 切换到解压后FastDFS的目录,执行make脚本进行编译
[root@centos_7_fastdfs01 fastdfs-6.12.2]# ./make.sh
- 执行make install进行安装
[root@centos_7_fastdfs01 fastdfs-6.12.2]# ./make.sh install
查看编译后的文件
- 查看FastDFS相关的可执行程序
[root@centos_7_fastdfs01 fastdfs-6.12.2]# ll /usr/bin/fdfs*
-rwxr-xr-x 1 root root 317424 12月 20 18:01 /usr/bin/fdfs_appender_test
-rwxr-xr-x 1 root root 317200 12月 20 18:01 /usr/bin/fdfs_appender_test1
-rwxr-xr-x 1 root root 304056 12月 20 18:01 /usr/bin/fdfs_append_file
-rwxr-xr-x 1 root root 303784 12月 20 18:01 /usr/bin/fdfs_crc32
-rwxr-xr-x 1 root root 304112 12月 20 18:01 /usr/bin/fdfs_delete_file
-rwxr-xr-x 1 root root 304840 12月 20 18:01 /usr/bin/fdfs_download_file
-rwxr-xr-x 1 root root 304440 12月 20 18:01 /usr/bin/fdfs_file_info
-rwxr-xr-x 1 root root 322336 12月 20 18:01 /usr/bin/fdfs_monitor
-rwxr-xr-x 1 root root 1111584 12月 20 18:01 /usr/bin/fdfs_storaged
-rwxr-xr-x 1 root root 327328 12月 20 18:01 /usr/bin/fdfs_test
-rwxr-xr-x 1 root root 326536 12月 20 18:01 /usr/bin/fdfs_test1
-rwxr-xr-x 1 root root 453848 12月 20 18:01 /usr/bin/fdfs_trackerd
-rwxr-xr-x 1 root root 305040 12月 20 18:01 /usr/bin/fdfs_upload_appender
-rwxr-xr-x 1 root root 306064 12月 20 18:01 /usr/bin/fdfs_upload_file
[root@centos_7_fastdfs01 fastdfs-6.12.2]#
- 查看FastDFS的配置文件
[root@centos_7_fastdfs01 fastdfs-6.12.2]# ll /etc/fdfs/
总用量 24
-rw-r--r-- 1 root root 1461 12月 20 18:01 client.conf.sample
-rw-r--r-- 1 root root 7927 12月 20 18:01 storage.conf.sample
-rw-r--r-- 1 root root 105 12月 20 18:01 storage_ids.conf.sample
-rw-r--r-- 1 root root 7389 12月 20 18:01 tracker.conf.sample
[root@centos_7_fastdfs01 fastdfs-5.11]#
- 解压后将fastdfs-6.12.2/conf目录下的两个文件拷贝到/etc/fdfs/
[root@centos_7_fastdfs01 conf]# pwd
/root/fastdfs-6.12.2/conf
[root@centos_7_fastdfs01 conf]# cp -av http.conf /etc/fdfs/
"http.conf" -> "/etc/fdfs/http.conf"
[root@centos_7_fastdfs01 conf]# cp -av mime.types /etc/fdfs/
"mime.types" -> "/etc/fdfs/mime.types"
[root@centos_7_fastdfs01 conf]#
FastDFS配置
- 去掉/etc/fdfs/目录下FastDFS配置文件的后缀名 .sample
[root@centos_7_fastdfs01 conf]# cd /etc/fdfs/
[root@centos_7_fastdfs01 fdfs]# ll
\总用量 60
-rw-r--r-- 1 root root 1461 12月 20 18:01 client.conf.sample
-rw-rw-r-- 1 root root 955 6月 3 2017 http.conf
-rw-rw-r-- 1 root root 31172 6月 3 2017 mime.types
-rw-r--r-- 1 root root 7927 12月 20 18:01 storage.conf.sample
-rw-r--r-- 1 root root 105 12月 20 18:01 storage_ids.conf.sample
-rw-r--r-- 1 root root 7389 12月 20 18:01 tracker.conf.sample
[root@centos_7_fastdfs01 fdfs]# mv -v ./tracker.conf.sample ./tracker.conf
"./tracker.conf.sample" -> "./tracker.conf"
[root@centos_7_fastdfs01 fdfs]# mv -v ./storage.conf.sample ./storage.conf
"./storage.conf.sample" -> "./storage.conf"
[root@centos_7_fastdfs01 fdfs]# ll
总用量 60
-rw-r--r-- 1 root root 1461 12月 20 18:01 client.conf.sample
-rw-rw-r-- 1 root root 955 6月 3 2017 http.conf
-rw-rw-r-- 1 root root 31172 6月 3 2017 mime.types
-rw-r--r-- 1 root root 7927 12月 20 18:01 storage.conf
-rw-r--r-- 1 root root 105 12月 20 18:01 storage_ids.conf.sample
-rw-r--r-- 1 root root 7389 12月 20 18:01 tracker.conf
[root@centos_7_fastdfs01 fdfs]#
- 修改tracker.conf文件
[root@localhost fdfs]# grep 'base_path' /etc/fdfs/tracker.conf
base_path = /opt/fastdfs
[root@localhost fdfs]# sed -i 's@base_path = \/opt\/fastdfs@base_path = \/opt\/fastdfs\/tracker@g' /etc/fdfs/tracker.conf
[root@localhost fdfs]# grep 'base_path' /etc/fdfs/tracker.conf
base_path = /opt/fastdfs/tracker
[root@localhost fdfs]#
- 修改storage.conf文件
[root@localhost fdfs]# grep 'base_path' /etc/fdfs/storage.conf
base_path = /opt/fastdfs
# if store_path0 not exists, it's value is base_path (NOT recommended)
# the base_path should be independent (different) of the store paths
[root@localhost fdfs]# sed -i 's@base_path = \/opt\/fastdfs@base_path = \/opt\/fastdfs\/storage@g' /etc/fdfs/storage.conf
[root@localhost fdfs]# grep 'base_path' /etc/fdfs/storage.conf
base_path = /opt/fastdfs/storage
# if store_path0 not exists, it's value is base_path (NOT recommended)
# the base_path should be independent (different) of the store paths
[root@localhost fdfs]#
[root@centos_7_fastdfs01 fdfs]# mkdir -pv /opt/fastdfs/storage
[root@centos_7_fastdfs01 fdfs]# ll /opt/fastdfs/storage
总用量 0
[root@centos_7_fastdfs01 fdfs]#
[root@centos_7_fastdfs01 fdfs]# grep 'store_path_count' /etc/fdfs/storage.conf
store_path_count=1
[root@centos_7_fastdfs01 fdfs]#
[root@localhost fdfs]# grep 'store_path0' /etc/fdfs/storage.conf
# if store_path0 not exists, it's value is base_path (NOT recommended)
store_path0 = /opt/fastdfs
[root@localhost storage]# sed -i 's@store_path0 = \/opt\/fastdfs\/storage\/files@store_path0 = \/opt\/fastdfs\/storage@' /etc/fdfs/storage.conf
[root@localhost storage]# grep 'store_path0' /etc/fdfs/storage.conf
# if store_path0 not exists, it's value is base_path (NOT recommended)
store_path0 = /opt/fastdfs/storage
[root@localhost storage]#
[root@localhost fdfs]# grep 'tracker_server' /etc/fdfs/storage.conf
# tracker_server can ocur more than once for multi tracker servers.
# the value format of tracker_server is "HOST:PORT",
tracker_server = 192.168.209.121:22122
tracker_server = 192.168.209.122:22122
[root@localhost fdfs]# sed -i 's@tracker_server = 192.168.209.121:22122@tracker_server=192.168.80.69:22122@' /etc/fdfs/storage.conf
[root@localhost fdfs]# grep 'tracker_server' /etc/fdfs/storage.conf
# tracker_server can ocur more than once for multi tracker servers.
# the value format of tracker_server is "HOST:PORT",
tracker_server=192.168.80.69:22122
tracker_server = 192.168.209.122:22122
[root@localhost fdfs]# sed -i 's@tracker_server = 192.168.209.122:22122@tracker_server=192.168.80.69:22122@' /etc/fdfs/storage.conf
[root@localhost fdfs]# grep 'tracker_server' /etc/fdfs/storage.conf
# tracker_server can ocur more than once for multi tracker servers.
# the value format of tracker_server is "HOST:PORT",
tracker_server=192.168.80.69:22122
tracker_server=192.168.80.69:22122
[root@localhost fdfs]#
[root@centos_7_fastdfs01 fdfs]# mkdir -pv /opt/fastdfs/storage/files
mkdir: 已创建目录 "/opt/fastdfs/storage/files"
[root@centos_7_fastdfs01 fdfs]#
FastDFS启动
启动tracker服务
[root@centos_7_fastdfs01 fdfs]# fdfs_trackerd /etc/fdfs/tracker.conf
[root@centos_7_fastdfs01 fdfs]#
启动storage服务
[root@centos_7_fastdfs01 fdfs]# fdfs_storaged /etc/fdfs/storage.conf
[root@centos_7_fastdfs01 fdfs]#
查看storage是否已经注册到了tracker下
[root@centos_7_fastdfs01 fdfs]# fdfs_monitor /etc/fdfs/storage.conf
[2024-12-20 18:39:04] DEBUG - base_path=/opt/fastdfs/storage, connect_timeout=30, network_timeout=60, tracker_server_count=1, anti_steal_token=0, anti_steal_secret_key length=0, use_connection_pool=0, g_connection_pool_max_idle_time=3600s, use_storage_id=0, storage server id count: 0
server_count=1, server_index=0
tracker server is 192.168.80.69:22122
group count: 1
Group 1:
group name = group1
disk total space = 30705 MB
disk free space = 28376 MB
trunk free space = 0 MB
storage server count = 1
active server count = 1
storage server port = 23000
storage HTTP port = 8888
store path count = 1
subdir count per path = 256
current write server index = 0
current trunk file id = 0
Storage 1:
id = 192.168.80.69
ip_addr = 192.168.80.69 (centos_7_fastdfs01) ACTIVE
http domain =
version = 5.11
join time = 2024-12-20 18:38:13
up time = 2024-12-20 18:38:13
total storage = 30705 MB
free storage = 28376 MB
upload priority = 10
store_path_count = 1
subdir_count_per_path = 256
storage_port = 23000
storage_http_port = 8888
current_write_path = 0
source storage id =
if_trunk_server = 0
connection.alloc_count = 256
connection.current_count = 0
connection.max_count = 0
total_upload_count = 0
success_upload_count = 0
total_append_count = 0
success_append_count = 0
total_modify_count = 0
success_modify_count = 0
total_truncate_count = 0
success_truncate_count = 0
total_set_meta_count = 0
success_set_meta_count = 0
total_delete_count = 0
success_delete_count = 0
total_download_count = 0
success_download_count = 0
total_get_meta_count = 0
success_get_meta_count = 0
total_create_link_count = 0
success_create_link_count = 0
total_delete_link_count = 0
success_delete_link_count = 0
total_upload_bytes = 0
success_upload_bytes = 0
total_append_bytes = 0
success_append_bytes = 0
total_modify_bytes = 0
success_modify_bytes = 0
stotal_download_bytes = 0
success_download_bytes = 0
total_sync_in_bytes = 0
success_sync_in_bytes = 0
total_sync_out_bytes = 0
success_sync_out_bytes = 0
total_file_open_count = 0
success_file_open_count = 0
total_file_read_count = 0
success_file_read_count = 0
total_file_write_count = 0
success_file_write_count = 0
last_heart_beat_time = 2024-12-20 18:38:44
last_source_update = 1970-01-01 08:00:00
last_sync_update = 1970-01-01 08:00:00
last_synced_timestamp = 1970-01-01 08:00:00
[root@centos_7_fastdfs01 fdfs]#
查看存储文件的目录
[root@centos_7_fastdfs01 fdfs]# cd /opt/fastdfs/storage/
[root@centos_7_fastdfs01 storage]# ls
data files logs
[root@centos_7_fastdfs01 storage]# cd data/
[root@centos_7_fastdfs01 data]# ls
fdfs_storaged.pid storage_stat.dat sync
[root@centos_7_fastdfs01 data]# cd ../logs/
[root@centos_7_fastdfs01 logs]# ls
storaged.log
[root@centos_7_fastdfs01 logs]# cd ../files/
[root@centos_7_fastdfs01 files]# ls
data
[root@centos_7_fastdfs01 files]# cd data/
[root@centos_7_fastdfs01 data]# ls
00 0C 18 24 30 3C 48 54 60 6C 78 84 90 9C A8 B4 C0 CC D8 E4 F0 FC
01 0D 19 25 31 3D 49 55 61 6D 79 85 91 9D A9 B5 C1 CD D9 E5 F1 FD
02 0E 1A 26 32 3E 4A 56 62 6E 7A 86 92 9E AA B6 C2 CE DA E6 F2 FE
03 0F 1B 27 33 3F 4B 57 63 6F 7B 87 93 9F AB B7 C3 CF DB E7 F3 FF
04 10 1C 28 34 40 4C 58 64 70 7C 88 94 A0 AC B8 C4 D0 DC E8 F4
05 11 1D 29 35 41 4D 59 65 71 7D 89 95 A1 AD B9 C5 D1 DD E9 F5
06 12 1E 2A 36 42 4E 5A 66 72 7E 8A 96 A2 AE BA C6 D2 DE EA F6
07 13 1F 2B 37 43 4F 5B 67 73 7F 8B 97 A3 AF BB C7 D3 DF EB F7
08 14 20 2C 38 44 50 5C 68 74 80 8C 98 A4 B0 BC C8 D4 E0 EC F8
09 15 21 2D 39 45 51 5D 69 75 81 8D 99 A5 B1 BD C9 D5 E1 ED F9
0A 16 22 2E 3A 46 52 5E 6A 76 82 8E 9A A6 B2 BE CA D6 E2 EE FA
0B 17 23 2F 3B 47 53 5F 6B 77 83 8F 9B A7 B3 BF CB D7 E3 EF FB
[root@centos_7_fastdfs01 data]#
FastDFS重启
- 重启tracker
[root@centos_7_fastdfs01 data]# fdfs_trackerd /etc/fdfs/tracker.conf restart
waiting for pid [12493] exit ...
starting ...
[root@centos_7_fastdfs01 data]#
- 重启storage
[root@centos_7_fastdfs01 data]# fdfs_storaged /etc/fdfs/storage.conf restart
waiting for pid [12502] exit ...
starting ...
[root@centos_7_fastdfs01 data]#
FastDFS关闭
- 关闭tracker执行命令
[root@centos_7_fastdfs01 data]# fdfs_trackerd /etc/fdfs/tracker.conf stop
waiting for pid [12525] exit ...
pid [12525] exit.
[root@centos_7_fastdfs01 data]#
- 关闭storage执行命令
[root@centos_7_fastdfs01 data]# fdfs_storaged /etc/fdfs/storage.conf stop
waiting for pid [12536] exit ...
pid [12536] exit.
[root@centos_7_fastdfs01 data]#
使用fdfs_test进行测试
修改client.conf配置文件,修改两个配置
[root@localhost data]# find / -name client.conf
/etc/fdfs/client.conf
/root/fastdfs-6.12.2/conf/client.conf
/root/fastdfs-6.12.2/docker/dockerfile_local-v6.0.9/build_image-v6.0.8/conf/client.conf
/root/fastdfs-6.12.2/docker/dockerfile_local-v6.0.9/build_image-v6.0.9/conf/client.conf
/root/fastdfs-6.12.2/docker/dockerfile_local-v6.0.9/fastdfs-conf/conf/client.conf
/root/fastdfs-6.12.2/docker/dockerfile_local/conf/client.conf
/root/fastdfs-6.12.2/docker/dockerfile_network/conf/client.conf
[root@localhost data]# grep 'base_path' /root/fastdfs-6.12.2/conf/client.conf
base_path = /opt/fastdfs
[root@localhost data]# sed -i 's@base_path = \/opt\/fastdfs@base_path = \/opt\/fastdfs\/client@' /root/fastdfs-6.12.2/conf/client.conf
[root@localhost data]# grep 'base_path' /root/fastdfs-6.12.2/conf/client.conf
base_path = /opt/fastdfs/client
[root@localhost data]# [root@centos_7_fastdfs01 data]#
[root@localhost data]# grep 'tracker_server' /root/fastdfs-6.12.2/conf/client.conf
# tracker_server can ocur more than once for multi tracker servers.
# the value format of tracker_server is "HOST:PORT",
tracker_server = 192.168.0.196:22122
tracker_server = 192.168.0.197:22122
http.tracker_server_port = 80
[root@localhost data]# sed -i 's@tracker_server = 192.168.0.196:22122@tracker_server = 192.168.80.69:22122@' /root/fastdfs-6.12.2/conf/client.conf
[root@localhost data]# sed -i 's@tracker_server = 192.168.0.197:22122@tracker_server = 192.168.80.69:22122@' /root/fastdfs-6.12.2/conf/client.conf
[root@localhost data]# grep 'tracker_server' /root/fastdfs-6.12.2/conf/client.conf
# tracker_server can ocur more than once for multi tracker servers.
# the value format of tracker_server is "HOST:PORT",
tracker_server = 192.168.80.69:22122
tracker_server = 192.168.80.69:22122
http.tracker_server_port = 80
[root@localhost data]#
创建base_path指定的目录
[root@centos_7_fastdfs01 data]# mkdir -pv /opt/fastdfs/client
mkdir: 已创建目录 "/opt/fastdfs/client"
[root@centos_7_fastdfs01 data]#
fdfs命令格式
- 上传文件:fdfs_test <config_file> <operation> <local_filename>
- config_file:配置文件的位置
- operation:upload,download,getmeta,setmeta,delete and query_servers,上传使用的是upload
- local_filename:要上传的文件名字
[root@localhost data]# touch /opt/1.txt
[root@localhost data]# /usr/bin/fdfs_test /root/fastdfs-6.12.2/conf/client.conf upload /opt/1.txt
This is FastDFS client test program v6.12.2
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 http://www.fastken.com/
for more detail.
tracker_query_storage_store_list_without_group:
server 1. group_name=, ip_addr=192.168.80.69, port=23000
group_name=group1, ip_addr=192.168.80.69, port=23000
storage_upload_by_filename
group_name=group1, remote_filename=M00/00/00/wKhQRWdmHnKAfVHQAAAAAAAAAAA048.txt
source ip address: 192.168.80.69
file timestamp=2024-12-21 09:48:34
file size=0
file crc32=0
example file url: http://192.168.80.69/group1/M00/00/00/wKhQRWdmHnKAfVHQAAAAAAAAAAA048.txt
storage_upload_slave_by_filename
group_name=group1, remote_filename=M00/00/00/wKhQRWdmHnKAfVHQAAAAAAAAAAA048_big.txt
source ip address: 192.168.80.69
file timestamp=2024-12-21 09:48:34
file size=0
file crc32=0
example file url: http://192.168.80.69/group1/M00/00/00/wKhQRWdmHnKAfVHQAAAAAAAAAAA048_big.txt
[root@localhost data]#
- 下载文件命令:fdfs_test <config_file> download <group_name> <remote_filename>
- group_name: 要下载的文件所在的组名
- remote_filename:要下载的文件名(要指定在fastDFS中存储的名字)
- 删除文件命令:fdfs_test <config_file> delete <group_name> <remote_filename>
FastDFS的HTTP访问
安装Nginx并且添加FastDFS模块
- 检查并安装 Nginx 依赖的库
[root@centos_7_fastdfs01 opt]# yum install gcc openssl openssl-devel pcre pcre-devel zlib zlib-devel –y
- 压缩包下载链接:https://pan.baidu.com/s/1oyAGij2RxO5fE89Rn2hDXA 提取码: 9vhm
- 将Fastdfs的Nginx扩展模块源代码上传到Linux上,并解压
[root@centos_7_fastdfs01 ~]# ll fastdfs-nginx-module-1.24.tar.gz
-rw-r--r-- 1 root root 23002 12月 20 19:15 fastdfs-nginx-module-1.24.tar.gz
[root@centos_7_fastdfs01 ~]# tar xf fastdfs-nginx-module-1.24.tar.gz
[root@centos_7_fastdfs01 ~]# ll fastdfs-nginx-module-1.24
总用量 16
-rw-rw-r-- 1 root root 3208 12月 5 2023 HISTORY
-rw-rw-r-- 1 root root 2584 12月 5 2023 INSTALL
-rw-rw-r-- 1 root root 7816 12月 5 2023 LICENSE
drwxrwxr-x 2 root root 109 12月 5 2023 src
[root@centos_7_fastdfs01 ~]#
- 压缩包下载链接:https://pan.baidu.com/s/1IvqllSyAUkI1OQRp0FIMjg 提取码: gjmb
- 将Nginx的tar包上传到Linux上,并解压
[root@centos_7_fastdfs01 ~]# ll nginx-1.26.2.tar.gz
-rw-r--r-- 1 root root 1244789 12月 20 19:19 nginx-1.26.2.tar.gz
[root@centos_7_fastdfs01 ~]# tar xf nginx-1.26.2.tar.gz
[root@centos_7_fastdfs01 ~]# ll nginx-1.26.2
总用量 828
drwxr-xr-x 6 502 games 326 12月 20 19:19 auto
-rw-r--r-- 1 502 games 327851 8月 13 00:39 CHANGES
-rw-r--r-- 1 502 games 501527 8月 13 00:39 CHANGES.ru
drwxr-xr-x 2 502 games 168 12月 20 19:19 conf
-rwxr-xr-x 1 502 games 2611 8月 12 22:28 configure
drwxr-xr-x 4 502 games 72 12月 20 19:19 contrib
drwxr-xr-x 2 502 games 40 12月 20 19:19 html
-rw-r--r-- 1 502 games 1397 8月 12 22:28 LICENSE
drwxr-xr-x 2 502 games 21 12月 20 19:19 man
-rw-r--r-- 1 502 games 49 8月 12 22:28 README
drwxr-xr-x 9 502 games 91 8月 13 00:39 src
[root@centos_7_fastdfs01 ~]#
- 切换至解压后的Nginx主目录,执行配置操作
[root@centos_7_fastdfs01 src]# pwd
/root/fastdfs-nginx-module-1.24/src
[root@centos_7_fastdfs01 src]# ll
总用量 84
-rw-rw-r-- 1 root root 43458 12月 5 2023 common.c
-rw-rw-r-- 1 root root 3995 12月 5 2023 common.h
-rw-rw-r-- 1 root root 1078 12月 5 2023 config
-rw-rw-r-- 1 root root 3725 12月 5 2023 mod_fastdfs.conf
-rw-rw-r-- 1 root root 28668 12月 5 2023 ngx_http_fastdfs_module.c
[root@localhost src]# grep 'CORE_INCS' config
CORE_INCS="$CORE_INCS /usr/local/include"
[root@localhost src]# sed -i 's@CORE_INCS="$CORE_INCS /usr/local/include"@CORE_INCS="$CORE_INCS /usr/include/fastdfs /usr/include/fastcommon/"@' config
[root@localhost src]# grep 'CORE_INCS' config
CORE_INCS="$CORE_INCS /usr/include/fastdfs /usr/include/fastcommon/"
[root@localhost src]#
[root@centos_7_fastdfs01 src]# grep 'CORE_LIBS=' config
CORE_LIBS="$CORE_LIBS -lfastcommon -lserverframe -lfdfsclient"
[root@centos_7_fastdfs01 src]# sed -i 's@CORE_LIBS="$CORE_LIBS -lfastcommon -lserverframe -lfdfsclient"@CORE_LIBS="$CORE_LIBS -L/usr/lib -lfastcommon -lfdfsclient"@' config
[root@centos_7_fastdfs01 src]# grep 'CORE_LIBS=' config
CORE_LIBS="$CORE_LIBS -L/usr/lib -lfastcommon -lfdfsclient"
[root@centos_7_fastdfs01 src]#
- 复制fastdfs-nginx-module/src/mod_fastdfs.conf 到/etc/fdfs目录下
[root@centos_7_fastdfs01 src]# cd /root/fastdfs-nginx-module-1.24/src/
[root@centos_7_fastdfs01 src]# cp -av mod_fastdfs.conf /etc/fdfs
"mod_fastdfs.conf" -> "/etc/fdfs/mod_fastdfs.conf"
[root@centos_7_fastdfs01 src]#
- 在/etc/fdfs目录下修改mod_dastdfs.conf文件
[root@centos_7_fastdfs01 src]# grep 'tracker_server=' /etc/fdfs/mod_fastdfs.conf
tracker_server=tracker:22122
[root@centos_7_fastdfs01 src]# grep 'storage_server_port=' /etc/fdfs/mod_fastdfs.conf
storage_server_port=23000
#storage_server_port=23000
#storage_server_port=23000
[root@centos_7_fastdfs01 src]# grep 'group_name=' /etc/fdfs/mod_fastdfs.conf
group_name=group1
#group_name=group1
#group_name=group2
[root@centos_7_fastdfs01 src]# grep 'url_have_group_name =' /etc/fdfs/mod_fastdfs.conf
url_have_group_name = false
[root@centos_7_fastdfs01 src]# sed -i 's@url_have_group_name = false@url_have_group_name = true@' /etc/fdfs/mod_fastdfs.conf
[root@centos_7_fastdfs01 src]# grep 'url_have_group_name =' /etc/fdfs/mod_fastdfs.conf
url_have_group_name = true
[root@centos_7_fastdfs01 src]#
[root@centos_7_fastdfs01 src]# grep 'store_path0=' /etc/fdfs/mod_fastdfs.conf
store_path0=/home/yuqing/fastdfs
#store_path0=/home/yuqing/fastdfs
#store_path0=/home/yuqing/fastdfs
[root@centos_7_fastdfs01 src]# sed -i 's@store_path0=\/home\/yuqing\/fastdfs@store_path0=\/opt\/fastdfs\/storage@' /etc/fdfs/mod_fastdfs.conf
[root@centos_7_fastdfs01 src]# grep 'store_path0=' /etc/fdfs/mod_fastdfs.conf
store_path0=/opt/fastdfs/storage
#store_path0=/opt/fastdfs/storage
#store_path0=/opt/fastdfs/storage
[root@centos_7_fastdfs01 src]#
- store_path0=你上面设置的默认数据存储目录(我这里是/opt/fastdfs/storage)
[root@centos_7_fastdfs01 src]# grep -nE -B2 '^tracker_server|^storage_server_port|^group_name|^url_have_group_name|^store_path0' /etc/fdfs/mod_fastdfs.conf
38-# "host:port", host can be hostname or ip address
39-# valid only when load_fdfs_parameters_from_tracker is true
40:tracker_server=tracker:22122
--
42-# the port of the local storage server
43-# the default value is 23000
44:storage_server_port=23000
45-
46-# the group name of the local storage server
47:group_name=group1
--
51-# set to true when uri like ${group_name}/M00/00/00/xxx, such as group1/M00/xxx
52-# default value is false
53:url_have_group_name = true
--
60-# the paths must be exist
61-# must same as storage.conf
62:store_path0=/opt/fastdfs/storage
[root@centos_7_fastdfs01 src]#
nginx安装
[root@centos_7_fastdfs01 nginx-1.26.2]# ./configure --add-module=/root/fastdfs-nginx-module-1.24/src/ ; echo $?
[root@localhost nginx-1.26.2]# make ; echo $?
[root@localhost nginx-1.26.2]# make install ; echo $?
将编译好的Nginx替换原有的Nginx
[root@localhost nginx-1.26.2]# cp -av ./objs/nginx /usr/local/nginx/sbin/
cp:是否覆盖"/usr/local/nginx/sbin/nginx"? y
"./objs/nginx" -> "/usr/local/nginx/sbin/nginx"
[root@localhost nginx-1.26.2]#
修改Nginx配置文件
[root@localhost nginx-1.26.2]# vim /usr/local/nginx/conf/nginx.conf
[root@localhost nginx-1.26.2]#
- 编辑内容如下:
location /group1/M00/{
ngx_fastdfs_module;
}
- 检测配置语法:
[root@localhost nginx-1.26.2]# /usr/local/nginx/sbin/nginx -t
ngx_http_fastdfs_set pid=48551
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
[root@localhost nginx-1.26.2]#
[root@localhost nginx-1.26.2]# /usr/local/nginx/sbin/nginx
ngx_http_fastdfs_set pid=48588
[root@localhost nginx-1.26.2]#
[root@localhost nginx-1.26.2]# ps aux | grep nginx
root 48589 0.0 0.0 30500 672 ? Ss 10:07 0:00 nginx: master process /usr/local/nginx/sbin/nginx
root 48615 0.0 0.0 112824 988 pts/0 S+ 10:07 0:00 grep --color=auto nginx
[root@localhost nginx-1.26.2]#
[root@localhost nginx-1.26.2]# grep -Ev '^$|#' /usr/local/nginx/conf/nginx.conf
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
location /group1/M00/{
ngx_fastdfs_module;
}
location / {
root html;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
[root@localhost nginx-1.26.2]#
重启Nginx
- 重启Nginx
[root@localhost storage]# /usr/local/nginx/sbin/nginx -s reload
ngx_http_fastdfs_set pid=1892
- 访问这个随机生成的URL地址
- 查看上传文件
[root@localhost ~]# find / ! -path "/usr/share/*" ! -path "/home/*" -type f -name '*.jpg'
/root/fastdfs-6.12.2/conf/anti-steal.jpg
/root/fastdfs-6.12.2/docker/dockerfile_local-v6.0.9/build_image-v6.0.9/conf/anti-steal.jpg
/root/fastdfs-6.12.2/docker/dockerfile_local-v6.0.9/fastdfs-conf/conf/anti-steal.jpg
/opt/fastdfs/storage/files/data/00/00/wKhQRWdmJpiAfePhAALWLpLaytE611.jpg
/opt/fastdfs/storage/files/data/00/00/wKhQRWdmJpiAfePhAALWLpLaytE611_big.jpg
/opt/fastdfs/storage/files/data/00/00/wKhQRWdmKlyAaTPUAALWLpLaytE578.jpg
/opt/fastdfs/storage/files/data/00/00/wKhQRWdmKlyAaTPUAALWLpLaytE578_big.jpg
/opt/fastdfs/storage/data/00/00/wKhQRWdmLPCAEuWyAALWLpLaytE221.jpg
/opt/fastdfs/storage/data/00/00/wKhQRWdmLPCAEuWyAALWLpLaytE221_big.jpg
/opt/1.jpg
[root@localhost ~]#
设置开机自启
[root@localhost storage]# cat >>/etc/rc.d/rc.local<<EOF
>
> ### hanyw $(date +%F_%T)
> /usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf
> /usr/bin/fdfs_storaged /etc/fdfs/storage.conf
> /usr/local/nginx/sbin/nginx
> ### hanyw $(date +%F_%T)
> EOF
[root@localhost storage]# cat /etc/rc.d/rc.local
#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot.
touch /var/lock/subsys/local
### hanyw 2024-12-21_11:06:54
/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf
/usr/bin/fdfs_storaged /etc/fdfs/storage.conf
/usr/local/nginx/sbin/nginx
### hanyw 2024-12-21_11:06:54
[root@localhost storage]#
相关文章:
CentOS 7 安装、测试和部署FastDFS
目录 FastDFS环境搭建 安装 libfastcommon 库 安装FastDFS 查看编译后的文件 FastDFS配置 FastDFS启动 启动tracker服务 启动storage服务 查看storage是否已经注册到了tracker下 查看存储文件的目录 FastDFS重启 FastDFS关闭 使用fdfs_test进行测试 修改client.co…...
elasticache备份
Elasticsearch 本地快照操作流程 配置快照存储路径 在 elasticsearch.yml 文件中配置以下字段以指定数据、日志和快照存储路径:path:data: /data/data # 数据存储路径logs: /data/log # 日志存储路径repo: /data/snapshot # 快照存储路径确保路径 /dat…...
wordpress调用指定分类ID下 相同标签的内容
要在WordPress中调用分类ID为1、3、7的分类下,具有相同标签的前10个内容,可以使用自定义的WordPress查询(WP_Query)。以下是实现此功能的步骤和示例代码: 步骤: 确定共同标签: 首先,你需要确定分类1、3、…...
Spring Security 6 系列之五 - 授权管理
之所以想写这一系列,是因为之前工作过程中使用Spring Security,但当时基于spring-boot 2.3.x,其默认的Spring Security是5.3.x。之后新项目升级到了spring-boot 3.3.0,结果一看Spring Security也升级为6.3.0,关键是其风…...
贪心算法求解跳跃游戏
跳跃游戏1: 代码随想录链接:代码随想录 思路: 求解是否能够跳到数组的最后一个位置,关键在于跳跃的覆盖范围 因此设置一个变量表示每次移动时能够覆盖的范围,该变量的初始值为0 因为坐标的位置受到覆盖范围的限制,因此只能遍历覆盖范围内…...
4大应用场景揭秘:AI视频监控在养老院中的智能化管理与安全保障
随着人口老龄化的加剧,养老院的管理面临着越来越多的挑战。传统的人工巡查方式不仅难以做到全天候监控,而且存在响应迟缓、效率低下等问题。为了解决这些问题,AI视频监控系统,利用人工智能技术提供了一种高效、智能化的解决方案。…...
构建简洁之美:我的第一个前端页面
实现界面效果 1. HTML示例代码 <!DOCTYPE html> <html lang"zh-CN"> <head><meta charset"UTF-8"><meta name"viewport" content"widthdevice-width, initial-scale1.0"><link rel"stylesheet…...
重拾设计模式--备忘录模式
文章目录 备忘录模式(Memento Pattern)概述定义: 作用:实现状态的保存与恢复支持撤销 / 恢复操作 备忘录模式UML图备忘录模式的结构原发器(Originator):备忘录(Memento)&…...
联通光猫怎么自己改桥接模式?
环境: 联通光猫 ZXHN F677V9 硬件版本号 V9.0 软件版本号 V9.0.0P1T3 问题描述: 联通光猫怎么自己改桥接模式 家里用的是ZXHN F677V9 光猫,最近又搞了个软路由,想改桥接模式 解决方案: 1.拿到最新超级密码&…...
UITableView实现通讯录效果
// // TableViewIndexViewController.m // study2024 // // Created by figo zhu on 2024/12/22. //#import "TableViewIndexViewController.h" //实现协议UITableViewDelegate,UITableViewDataSource interface TableViewIndexViewController ()<UITableView…...
Pytorch | 利用NI-FGSM针对CIFAR10上的ResNet分类器进行对抗攻击
Pytorch | 利用NI-FGSM针对CIFAR10上的ResNet分类器进行对抗攻击 CIFAR数据集NI-FGSM介绍背景算法流程 NI-FGSM代码实现NI-FGSM算法实现攻击效果 代码汇总nifgsm.pytrain.pyadvtest.py 之前已经针对CIFAR10训练了多种分类器: Pytorch | 从零构建AlexNet对CIFAR10进行…...
【Matlab】绘制混淆矩阵示意图+colormap调整方法
主代码 %https://blog.csdn.net/weixin_42943114/article/details/81811556 %https://blog.csdn.net/Mark711/article/details/141144280 clc clear close all warning off %% 原始数据 % 假设groundTruth和predictions是已经定义好的向量 TrueLabels [1 2 1 3 2 3 1 3 2 1 4…...
计算机视觉目标检测——DETR(End-to-End Object Detection with Transformers)
计算机视觉目标检测——DETR(End-to-End Object Detection with Transformers) 文章目录 计算机视觉目标检测——DETR(End-to-End Object Detection with Transformers)摘要Abstract一、DETR算法1. 摘要(Abstract)2. 引言(Introduction&#…...
资源型数字化平台该如何顺利运营?
一、引言 随着信息技术的迅猛发展,资源型数字化平台在各领域的重要性日益凸显。此类平台整合各类资源,以数字化手段提升资源利用效率与价值,但确保其顺利运营面临诸多挑战。 二、资源型数字化平台特点 资源型数字化平台具有资源整合性&…...
写SQL太麻烦?免费搭建 Text2SQL 应用,智能写 SQL | OceanBase AI 实践
自OceanBase 4.3.3版本推出以来,向量检索的能力受到了很多客户的关注,也纷纷表达希望OB能拓展更多 多模数据库大模型 的AI应用实践。 在上篇文章 👉 OceanBase LLM,免费构建你的专属 AI 助手 ,我们介绍了如何去搭建一…...
Linux系统编程——系统内核中的信号
目录 一、前言 二、系统内核中的信号 三、sigset_t 四、信号集操作 1、sigpending(); 2、sigemptyset(); 3、sigfillset(sigset_t *set); 4、int sigaddset ()和sigdelset() 编辑 5、sigismember() 6、sigprocmask() 五、信号集操作代码演示 六、深入理解进程的信…...
Mapbox-GL 中 `token` 的使用
Mapbox-GL 是一个开源的 JavaScript 库,允许开发者在网页上渲染交互式地图。token 在 Mapbox 中主要是指 access token,它用于身份验证和授权,确保应用程序能够访问 Mapbox 的地图服务。 下面详细解析 Mapbox GL 中 token 的使用,…...
PostgreSQL标识符长度限制不能超过63字节
文章目录 问题:标识符太长会被截断分析相关源码可以尝试以下案例 问题:标识符太长会被截断 在创建表时,发现表名太长会自动被截断,导致查询表时报错了。 分析 参考:https://www.postgresql.org/docs/current/limits…...
【Token】校验、会话技术、登录请求、拦截器【期末实训】实战项目学生和班级管理系统\Day15-后端Web实战(登录认证)\讲义
登录认证 在前面的课程中,我们已经实现了部门管理、员工管理的基本功能,但是大家会发现,我们并没有登录,就直接访问到了Tlias智能学习辅助系统的后台。 这是不安全的,所以我们今天的主题就是登录认证。 最终我们要实现…...
电机相关内容
文章目录 电枢电阻电动机电动势系数负载转矩直流电动机的角速度和速度关系 电枢电阻 电枢电阻的计算公式如下: 基于欧姆定律的公式: R a V a − V b I a R_a \frac{V_a - V_b}{I_a} RaIaVa−Vb 其中, ( V a ) (V_a) (Va…...
电商环境下的财务ERP系统架构
先介绍一下自己的工作经历,2002年开始进入ERP实施行业,专注于O记EBS系统,正好赶上中国经济和信息化高度发展的阶段,先后实施过很多大国企和民企的大型ERP项目,在实施过程中逐渐对ERP系统的架构、模块设计有更深入的认识…...
Gitlab 数据备份全攻略:命令、方法与注意事项
文章目录 1、备份命令2、备份目录名称说明3、手工备份配置文件3.1 备份配置文件3.2 备份ssh文件 4、备份注意事项4.1 停止puma和sicdekiq组件4.2 copy策略需要更多磁盘空间 5、数据备份方法5.1 docker命令备份5.2 kubectl命令备份5.3 参数说明5.4、选择性备份5.5、非tar备份5.6…...
基于单片机的视力保护及身姿矫正器设计(论文+源码)
1. 系统设计 在本次设计中,其系统整个框图如图2-1所示。其主要的核心控制模块由超声波模块,光敏电阻,按键模块,复位电路,红外模块,LCD显示等组成。其包括自动模式,手动模式。自动模式ÿ…...
设计模式之【观察者模式】
观察者模式: 应用于发布-订阅消息模型中,订阅者订阅一个主题后,当有新消息到达时,所有订阅者都会收到通知。 主要关注的是对象之间的通信。是一种对象之间的一对多关系,多个对象依赖于一个对象,当被依赖的…...
杂七杂八的网络安全知识
一、信息安全概述 1.信息与信息安全 信息与信息技术 信息奠基人:香农:信息是用来消除随机不确定性的东西 信息的定义:信息是有意义的数据,是一种要适当保护的资产。数据经过加工处理之后,就成为信息。而信息需要经…...
【落羽的落羽 C语言篇】数据存储简介
文章目录 一、整型提升1. 概念2. 规则 二、大小端字节序1. 概念2. 练习练习1练习2 三、浮点数在内存中的存储1. 规则2. 练习 一、整型提升 1. 概念 C语言中,整型算术运算至少是以“缺省整型类型”(int)的精度来进行的。为了达到这个精度&am…...
linux----文件访问(c语言)
linux文件访问相关函数 打开文件函数 - open 函数原型:int open(const char *pathname, int flags, mode_t mode);参数说明: pathname:这是要打开的文件的路径名,可以是绝对路径或者相对路径。例如,"/home/user/…...
垂起固定翼无人机大面积森林草原巡检技术详解
垂起固定翼无人机大面积森林草原巡检技术是一种高效、精准的监测手段,以下是对该技术的详细解析: 一、垂起固定翼无人机技术特点 垂起固定翼无人机结合了多旋翼和固定翼无人机的优点,具备垂直起降、飞行距离长、速度快、高度高等特点。这种无…...
汽车电子零部件(15):AVM全景影像系统
概述: 使用ADAS全景监控(AVM)精确停车和操纵。这项先进技术采用多个摄像头,提供车辆周围环境的鸟瞰图。 360度全景监控系统: 360 AVM系统可以帮助驾驶员360度查看车辆周围的情况,避免发生碰撞。360 AVM系统由一个电子控制单元(ECU)和四个摄像头组成。ECU将处理四个摄…...
G口带宽服务器与1G独享带宽服务器:深度剖析其差异
在数据洪流涌动的数字化时代,服务器作为数据处理的核心,其性能表现直接关系到业务的流畅度和用户体验的优劣。随着技术的飞速发展,G口带宽服务器与1G独享带宽服务器已成为众多企业的优选方案。然而,这两者之间究竟有何细微差别&am…...
鸿蒙项目云捐助第十一讲鸿蒙App应用的捐助成功自定义对话框组件实现
在生活中,用户做了一个好事后,很多场合都会收到一份感谢。在捐助的行业也是一样的,用户捐出了一片爱心,就会收获一份温情。这里的温情是通过自定义对话框实现的。 一、通过自定义对话框组件实现捐款成功的信息页 这里用户捐款成…...
Elasticsearch-分词器详解
什么是分词器 1、分词器介绍 对文本进行分析处理的一种手段,基本处理逻辑为按照预先制定的分词规则,把原始文档分割成若干更小粒度的词项,粒度大小取决于分词器规则。 常用的中文分词器有ik按照切词的粒度粗细又分为:ik_max_word和ik_smart&…...
Android笔试面试题AI答之Android基础(3)
文章目录 1.谈一谈 Android 的安全机制一、系统架构层面的安全设计二、核心安全机制三、其他安全机制与措施 2.Android 的四大组件是哪四大?3.Android 的四大组件都需要在清单文件中注册吗?4.介绍几个常用的Linux命令一、文件和目录管理二、用户和权限管…...
酷黑金色配色 影片素材不过时 色彩丰富 电影主题html
本套大作业共计8个HTML页面,网页中包含:DIVCSS、下拉菜单栏、banner轮播图、图片放大效果、鼠标滑过效果、视频、小图标及按钮设计、登录注册页等,同时设计了logo;本作品花费大量时间去整理素材,大部分素材均使用Photo…...
《Go 语言变量》
《Go 语言变量》 介绍 Go 语言是一种静态类型、编译型的编程语言,由 Google 开发。它以其简洁的语法、高效的并发处理和强大的标准库而闻名。在 Go 语言中,变量是存储数据的基本单位,它们可以是各种数据类型,如整数、浮点数、布…...
Tool之Excalidraw:Excalidraw(开源的虚拟手绘风格白板)的简介、安装和使用方法、艾米莉应用之详细攻略
Tool之Excalidraw:Excalidraw(开源的虚拟手绘风格白板)的简介、安装和使用方法、艾米莉应用之详细攻略 目录 Excalidraw 简介 1、Excalidraw 的主要特点: Excalidraw 安装和使用方法 1、Excalidraw的安装 T1、使用 npm 安装: T2、使用 …...
Llama 3 模型系列解析(一)
目录 1. 引言 1.1 Llama 3 的简介 1.2 性能评估 1.3 开源计划 1.4 多模态扩展 ps 1. 缩放法则 2. 超额训练(Over-training) 3. 计算训练预算 4. 如何逐步估算和确定最优模型? 2. 概述 2.1 Llama 3 语言模型开发两个主要阶段 2.2…...
重拾设计模式--观察者模式
文章目录 观察者模式(Observer Pattern)概述观察者模式UML图作用:实现对象间的解耦支持一对多的依赖关系易于维护和扩展 观察者模式的结构抽象主题(Subject):具体主题(Concrete Subject…...
3-Gin 渲染 --[Gin 框架入门精讲与实战案例]
在 Gin 框架中,渲染指的是将数据传递给模板,并生成 HTML 或其他格式的响应内容。Gin 支持多种类型的渲染,包括 String HTML、JSON、XML 等。 String 渲染 在 Gin 框架中,String 渲染方法允许你直接返回一个字符串作为 HTTP 响应…...
回溯---java---黑马
回溯 概念 程序在运行过程中分成了多个阶段 通过某些手段,将数据恢复到某一阶段,称之为回溯 手段包括:方法栈、自定义栈 使用基本数据类型n public class Backtracking{public static void main(String[] args) {rec(1);}public void r…...
【数据结构】排序(附测试源码)
【数据结构】排序(附测试源码) 本节是数据结构排序版(不完整版,没有C语言版的哈希表) 1.排序概念: 1.1所谓排序,就是使一串记录,按照其中的某个或某些关键字的大小,递增…...
【翻译】大型 Transformer 模型推理优化
翻译原文:Large Transformer Model Inference Optimization | LilLog 原文作者:Lilian Weng 目录 方法概述蒸馏 Distillation量化 Quantization Transformer 量化的挑战训练后量化 (PTQ) 混合精度量化 Mixed-precision quantization细粒度量化量化的二…...
RabbitMQ概述
目录 RabbitMQ概述 前言 MQ MQ的作用 为什么选择RabbitMQ RabbitMQ的介绍 RabbitMQ概述 前言 Rabbit, 兔⼦的意思 互联⽹⾏业很多公司, 都喜欢⽤动物命名产品, 或者作为公司的logo, 吉祥物. ⽐如: 腾讯的企鹅, 京东的狗, 美团的袋⿏, 携程的海豚,阿⾥就更多了, 蚂蚁, ⻜…...
《PCI密码卡技术规范》题目
单选1 在《PCI密码卡技术规范》中,下列哪项不属于PCI密码卡的功能()。 A.密码运算功能 B.密钥管理功能 C.物理随机数产生功能 D.随主计算机可信检测功能 正确答案:D. <font style="color:#DF2A3F;">解析:</font> 单选 2 在《PCI密码卡技术规…...
AI开发:使用支持向量机(SVM)进行文本情感分析训练 - Python
支持向量机是AI开发中最常见的一种算法。之前我们已经一起初步了解了它的概念和应用,今天我们用它来进行一次文本情感分析训练。 一、概念温习 支持向量机(SVM)是一种监督学习算法,广泛用于分类和回归问题。 它的核心思想是通过…...
ECharts柱状图-柱图42,附视频讲解与代码下载
引言: 在数据可视化的世界里,ECharts凭借其丰富的图表类型和强大的配置能力,成为了众多开发者的首选。今天,我将带大家一起实现一个柱状图图表,通过该图表我们可以直观地展示和分析数据。此外,我还将提供…...
呼入机器人:24小时客户服务的未来趋势
呼入机器人:24小时客户服务的未来趋势 作者:开源大模型智能呼叫中心系统FreeAICC,Github:https://github.com/FreeIPCC/FreeAICC 在当今快节奏的商业环境中,客户服务已成为企业竞争的核心要素之一。随着人工智能技术…...
FFmpeg 安装教程(Windows 系统)
1. 前言 FFmpeg 是一个用于处理视频、音频等多媒体文件的开源工具包。它支持几乎所有的多媒体格式转换、剪辑和编辑,是开发者和多媒体工作者必备的工具。本文详细讲解如何在 Windows 系统上安装 FFmpeg 并进行基本配置。 2. 下载 FFmpeg 安装包 打开 Dpwnload FFmp…...
左神算法基础巩固--1
文章目录 时间复杂度常数时间的操作时间复杂度的定义时间复杂度的作用剖析递归行为和递归行为时间复杂度的估算 排序选择排序冒泡排序插入排序归并排序小和问题问题描述解题思路 快速排序荷兰国旗问题问题描述 堆排序堆结构大根堆小根堆 桶排序 二分二分搜索 ^的运用不用额外空…...
基于鲲鹏服务器的打砖块小游戏部署
案例介绍 鲲鹏服务器是基于鲲鹏处理器的新一代数据中心服务器,适用于大数据、分布式存储、高性能计算和数据库等应用。鲲鹏服务器具有高性能、低功耗、灵活的扩展能力,适合大数据分析、软件定义存储、Web等应用场景。 本案例将指导开发者如何在鲲鹏服务…...