当前位置: 首页 > news >正文

ElasticSearch常见的索引_集群的备份与恢复方案

方案一:使用Elasticsearch的快照和恢复功能进行备份和恢复。该方案适用于集群整体备份与迁移,包括全量、增量备份和恢复。

方案二:通过reindex操作在集群内或跨集群同步数据。该方案适用于相同集群但不同索引层面的迁移,或者跨集群的索引迁移。缺点是跨集群迁移时需要在elasticsearch.yml中添加目标集群IP白名单。

方案三:使用elasticdump来迁移映射和数据。该方案适用于仅对索引层面进行数据或映射的迁移,支持analyzer/mapping/data等操作。相较于reindex跨集群操作,elasticdump无须配置白名单。

思考:直接拷贝文件能实现集群备份吗?

reindex 更适合同集群内

elasticsearch-dump

elasticsearch-dump 是一个开源的用于导入和导出 Elasticsearch 数据的命令行工具,通过将 输入(input) 发送到输出(output)进行工作。输入和输出即可以是 Elasticsearch URL 也可以是文件。

Elasticsearch/OpenSearch:

  • format: {protocol}://{host}:{port}/{index}
  • example: http://127.0.0.1:9200/my_index

File:

  • format: {FilePath}
  • example: /Users/evantahler/Desktop/dump.json

github 地址:https://github.com/elasticsearch-dump/elasticsearch-dump

使用

安装 elasticsearch-dump

前提:需要 node 环境

npm install elasticdump
./bin/elasticdump
npm install elasticdump -g
elasticdump

迁移指定索引的settings

node elasticdump \
--input=http://"<UserName>:<YourPassword>"@<YourEsHost>/<YourEsIndex> \
--output=http://"<OtherName>:<OtherPassword>"@<OtherEsHost>/<OtherEsIndex> \
--type=settings

导出指定索引的mapping

node D:\software\nodejs\node_global\node_modules\elasticdump\bin\elasticdump --input=https://elastic:r9wUensJ6tO3Wv1A*Wnn@192.168.2.131:9200/user_test --output=/data/my_index_mapping.json --type=mapping

报错如下:

Wed, 23 Oct 2024 05:55:34 GMT | starting dump
Wed, 23 Oct 2024 05:55:34 GMT | Error Emitted => self-signed certificate in certificate chain
Wed, 23 Oct 2024 05:55:34 GMT | Error Emitted => self-signed certificate in certificate chain
Wed, 23 Oct 2024 05:55:34 GMT | Total Writes: 0
Wed, 23 Oct 2024 05:55:34 GMT | dump ended with error (get phase) => Error: self-signed certificate in certificate chain

解决方案:

这个错误是由于 SSL 证书验证失败导致的。SSL 证书验证用于确保与服务器建立的连接是安全和可信的。

在这种情况下,错误消息中提到了 “certificate verify failed: self signed certificate in certificate chain”,这意味着服务器使用的是自签名证书,而不是由受信任的证书颁发机构(CA)签署的证书。

由于之前未接触过证书相关内容,这里我选择暂时忽略证书验证错误。

NODE_TLS_REJECT_UNAUTHORIZED=0解决办法:https://developer.aliyun.com/article/1341433

Windows 环境下设置环境变量,使用 set 语法,命名后不加空格,直接附上两个 &&, 然后空格,跟上新的命令。

设置变量后再执行 elasticdump 操作。

set NODE_TLS_REJECT_UNAUTHORIZED=0
node D:\software\nodejs\node_global\node_modules\elasticdump\bin\elasticdump --input=https://elastic:r9wUensJ6tO3Wv1A*Wnn@192.168.2.131:9200/user_test --output=/data/my_index_mapping.json --type=mapping

成功:

Tue, 03 Dec 2024 06:53:18 GMT | starting dump
(node:30260) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
(Use `node --trace-warnings ...` to show where the warning was created)
Tue, 03 Dec 2024 06:53:18 GMT | got 1 objects from source elasticsearch (offset: 0)
Tue, 03 Dec 2024 06:53:18 GMT | sent 1 objects to destination file, wrote 1
Tue, 03 Dec 2024 06:53:18 GMT | got 0 objects from source elasticsearch (offset: 1)
Tue, 03 Dec 2024 06:53:18 GMT | Total Writes: 1
Tue, 03 Dec 2024 06:53:18 GMT | dump complete

这里注意,导出文件目录需要提前创建,否则会报异常。

导出整个索引:

node D:\software\nodejs\node_global\node_modules\elasticdump\bin\elasticdump --input=https://elastic:r9wUensJ6tO3Wv1A*Wnn@192.168.2.131:9200/user_test --output==D:\elasticdump\user_test_data_dump.json --type=data

导入并覆盖索引数据:

node D:\software\nodejs\node_global\node_modules\elasticdump\bin\elasticdump --input=D:\my_data.json --output==https://elastic:r9wUensJ6tO3Wv1A*Wnn@192.168.2.131:9200/user_test --type=data --overwrite

导入过程中遇到报错如下图:

报错信息如下:

{_index: 'user_test',_id: 'MmJ_vJIBBoiadQhNyziv',status: 500,error: {type: 'not_x_content_exception',reason: 'Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes'}

解决方案:https://blog.csdn.net/star1210644725/article/details/134254334

原因是导入的JSON数据格式不对
当前 json文件内容:

{"index":{}}
{"id":"B0IAFZ9FOC","name":"小鹏汽车汽车充电站(三沙永兴港务综合楼小鹏20kW目的地站)","type":"","type_code":"11100","address":"永兴岛机场路永兴港务综合楼地面停车场","province_name":"海南省","province_code":"460000","city_name":"三沙","city_code":"289","distrcit_name":"西沙区","district_code":"460301","geopoint_gcj02":"16.833967,112.34004","geopoint_bd09":"16.840137798581825,112.34653419459671","geopoint_wgs84":"16.835594173343946,112.33512523956057"}

修改后 json文件内容:

{"_index":"user_test","_id":"kWJbvJIBBoiadQhNBzfq","_score":1,"_source":{"id":"B0IAFZ9FOC","name":"小鹏汽车汽车充电站(三沙永兴港务综合楼小鹏20kW目的地站)","type":"","type_code":"11100","address":"永兴岛机场路永兴港务综合楼地面停车场","province_name":"海南省","province_code":"460000","city_name":"三沙","city_code":"289","distrcit_name":"西沙区","district_code":"460301","geopoint_gcj02":"16.833967,112.34004","geopoint_bd09":"16.840137798581825,112.34653419459671","geopoint_wgs84":"16.835594173343946,112.33512523956057"}}

再次导入,成功

C:\Windows\system32>node D:\software\nodejs\node_global\node_modules\elasticdump\bin\elasticdump --input=D:\elasticdump\my_index_data.json --output=https://elastic:r9wUensJ6tO3Wv1A*Wnn@192.168.2.131:9200/user_test --type=data --overwrite
Thu, 24 Oct 2024 03:11:48 GMT | starting dump
Thu, 24 Oct 2024 03:11:48 GMT | got 23 objects from source file (offset: 0)
(node:2820) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
(Use `node --trace-warnings ...` to show where the warning was created)
Thu, 24 Oct 2024 03:11:49 GMT | sent 23 objects to destination elasticsearch, wrote 23
Thu, 24 Oct 2024 03:11:49 GMT | got 0 objects from source file (offset: 23)
Thu, 24 Oct 2024 03:11:49 GMT | Total Writes: 23
Thu, 24 Oct 2024 03:11:49 GMT | dump complete

Reference

https://www.alibabacloud.com/help/zh/es/use-cases/use-elasticsearch-dump-to-migrate-data

https://www.elastic.co/guide/en/elasticsearch/reference/current/snapshot-restore.html

ElasticSearch 实战:使用elasticdump导出导入数据](https://blog.csdn.net/qq_33240556/article/details/137261150))

对数据文件内容格式有特殊限制,个人感觉更适合用于ES迁移到ES。

Snapshot and restore

快照可以对正在运行的 ElasticSearch 集群进行备份。

快照可以做一下事情:

  1. 定期备份数据,不用停止 ElasticSearch 运行;
  2. 在删除数据或机器故障后恢复数据;
  3. 在不同的集群间转移数据;
  4. 降低存储成本。

快照工作流

Elasticsearch 将快照存储在一个被称为快照存储库的集群外部存储位置。在拍摄快照或恢复数据前必须在 ElasticSearch 集群中注册这个快照仓库。Elasticsearch 支持多种云存储库类型,包括:

  • 亚马逊网络服务 S3
  • 谷歌云存储(GCS)
  • 微软 Azure

注册快照存储库后,我们可以使用快照生命周期管理(SLM)自动拍摄和管理快照。之后我们可以恢复或者转移数据。

Elasticsearch的快照和恢复功能是一种备份及恢复索引数据的方法,可保护数据免于意外丢失或受到系统故障的影响。

ElasticSearch 将快照存储到快照仓库里。在你可以进行快照拍摄或恢复之前,你必须在集群上注册一个快照存储库。

快照操作步骤

https://www.elastic.co/guide/en/elasticsearch/reference/current/snapshot-restore.html

使用创建快照 API。快照名称支持日期数学。

创建快照

  1. 注册快照,将文件系统的路径或父目录添加到每个 ElasticSearch 节点的 <font style="color:rgb(0, 0, 0);">elasticsearch.yml</font> 文件中的 <font style="color:rgb(0, 0, 0);">path.repo</font>设置中
path:repo:- /www/elasticsearch/elasticsearch-8.15.2/backup
  1. 注册仓库指定文件路径
PUT /_snapshot/my_backup
{"type": "fs","settings": {"location": "/www/elasticsearch/elasticsearch-8.15.2/backup"}
}

响应结果:

{"acknowledged": true
}

创造前置模拟条件,构造几条数据。

PUT /snapshot_testPOST /_bulk
{ "index" : { "_index" : "snapshot_test", "_id" : "1" } }
{ "field1" : "value1" }
{ "delete" : { "_index" : "snapshot_test", "_id" : "2" } }
{ "create" : { "_index" : "snapshot_test", "_id" : "3" } }
{ "field1" : "value3" }
{ "update" : {"_id" : "1", "_index" : "snapshot_test"} }
{ "doc" : {"field2" : "value2"} }
  1. 拍摄快照
    1. 全量备份,即创建整个集群的快照、
PUT /_snapshot/my_backup/snapshot_cluster?wait_for_completion=true
2. 按需备份
PUT /_snapshot/my_backup/snapshot_test?wait_for_completion=true
{"indices": "snapshot_*","ignore_unanailablt": true,"include_global_state": false,"metedata": {"taken_by": "mingyi","taken_because": "backup before upgrading"}
}{"snapshot": {"snapshot": "my_backup","uuid": "V2teco__TtK8PvhFbPCz5w","version_id": 7040299,"version": "7.4.2","indices": ["my_backup"],"include_global_state": false,"state": "SUCCESS","start_time": "2024-12-02T16:24:04.841Z","start_time_in_millis": 1733156644841,"end_time": "2024-12-02T16:24:05.043Z","end_time_in_millis": 1733156645043,"duration_in_millis": 202,"failures": [],"shards": {"total": 1,"failed": 0,"successful": 1}}
}

恢复快照

为了保护集群安全,Elasticsearch 8.X版本不再默认选择批量删除索引。如果需要进行该操作,可以使用以下命令行开启批量操作功能。

POST /_snapshot/{快照仓库名}/{索引名}/_restore

快照常见操作

# 查看快照库
GET /_snapshot?pretty# 查看所有快照存储库
GET /_snapshot/_all# 查看快照状态
GET /_snapshot/my_backup/snapshot_test/_status# 删除快照
DELETE /_snapshot/my_backup/snapshot_test

遇到问题

Docker 内执行请求报错:

{"error": {"root_cause": [{"type": "exception","reason": "failed to create blob container"}],"type": "exception","reason": "failed to create blob container","caused_by": {"type": "access_denied_exception","reason": "/www/elasticsearch/backup/tests-asrNlJfrQqy9DGEe2OkXoA"}},"status": 500
}

进入容器内执行如下命令后再请求,正常。

chown -R elasticsearch /www/elasticsearch/backup

bulk api

curl -H 'Content-Type: application/x-ndjson'  -s -XPOST localhost:9200/_bulk --data-binary @accounts.json

使用

准备索引文件:

{"id":"5829F807-7A3C-4E1B-8DB1-5F938DEAAE64","province":"辽宁省","city":"沈阳市","district":"大东区","land_name":"东至:用地界线南至:用地界线及山嘴子路北侧道路红线西至:东望街东侧道路红线北至:用地界线","usage_level":"工业用地","public_notice_number":"沈土网挂[2024]13号","data_source":"中国土地市场网","data_source_url":"https://www.landchina.com/#/landDetail?id=gyggzd5140a162-7896-444b-93b4-121ac355b11b&type=高级搜索&path=出让公告","crawl_time":"2024-07-31 15:30:24"}
{"id":"0005E5AD-2311-49E4-B8D0-F930643677A2","province":"辽宁省","city":"沈阳市","district":"苏家屯区","land_name":"东至:用地界线西至:18米规划路东侧道路红线南至:四环路北侧规划绿线北至:18米规划路南侧道路红线","usage_level":"其它用地","public_notice_number":"沈土网挂[2024]14号","data_source":"中国土地市场网","data_source_url":"https://www.landchina.com/#/landSupplyDetail?id=gygg1e19375c-103f-40d6-ba4d-982329b2f542&type=出让公告&path=0","crawl_time":"2024-08-06 14:31:35"}

调用接口

curl -H 'Content-Type: application/x-ndjson' -XPOST https://elastic:r9wUensJ6tO3Wv1A*Wnn@192.168.2.131:9200/user_test/_bulk --data-binary @D:\index_data.json

响应结果:

curl: (6) Could not resolve host: application
curl: (60) schannel: SEC_E_UNTRUSTED_ROOT (0x80090325) - 证书链是由不受信任的颁发机构颁发的。
More details here: https://curl.se/docs/sslcerts.html

解决方案:https://wenku.csdn.net/answer/4cp3ucvbbu

再次请求:

curl -k -H "Content-Type: application/x-ndjson" -H "Authorization: ApiKey VVZlZWo1SUJyN3VPRWVRb0dfUkc6REhBYXVjbkFTcEdKRUpKT2MxeFp6Zw==" -X POST "https://192.168.2.131:9200/user_test/_bulk"  --data-binary @D:\index_data.json
{"error": {"root_cause": [{"type": "illegal_argument_exception","reason": "Malformed action/metadata line [1], expected field [create], [delete], [index] or [update] but found [id]"}],"type": "illegal_argument_exception","reason": "Malformed action/metadata line [1], expected field [create], [delete], [index] or [update] but found [id]"},"status": 400
}

原因是 json 文件格式不正确,修改格式为(切记最后要留一个空行):

{ "index": {} }
{"id":"5829F807-7A3C-4E1B-8DB1-5F938DEAAE64","province":"辽宁省","city":"沈阳市","district":"大东区","land_name":"东至:用地界线南至:用地界线及山嘴子路北侧道路红线西至:东望街东侧道路红线北至:用地界线","usage_level":"工业用地","public_notice_number":"沈土网挂[2024]13号","data_source":"中国土地市场网","data_source_url":"https://www.landchina.com/#/landDetail?id=gyggzd5140a162-7896-444b-93b4-121ac355b11b&type=高级搜索&path=出让公告","crawl_time":"2024-07-31 15:30:24"}
{ "index": {} }
{"id":"0005E5AD-2311-49E4-B8D0-F930643677A2","province":"辽宁省","city":"沈阳市","district":"苏家屯区","land_name":"东至:用地界线西至:18米规划路东侧道路红线南至:四环路北侧规划绿线北至:18米规划路南侧道路红线","usage_level":"其它用地","public_notice_number":"沈土网挂[2024]14号","data_source":"中国土地市场网","data_source_url":"https://www.landchina.com/#/landSupplyDetail?id=gygg1e19375c-103f-40d6-ba4d-982329b2f542&type=出让公告&path=0","crawl_time":"2024-08-06 14:31:35"}

再次执行请求,结果如下:

{"errors": false,"took": 0,"items": [{"index": {"_index": "user_test","_id": "05jPi5MBRvkzqTvFLXbX","_version": 1,"result": "created","_shards": {"total": 2,"successful": 1,"failed": 0},"_seq_no": 2,"_primary_term": 1,"status": 201}},{"index": {"_index": "user_test","_id": "1JjPi5MBRvkzqTvFLXbX","_version": 1,"result": "created","_shards": {"total": 2,"successful": 1,"failed": 0},"_seq_no": 3,"_primary_term": 1,"status": 201}}]
}

Reference

https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html

https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/current/indexing-bulk.html

Postman方式:https://blog.csdn.net/SevenBerry/article/details/124873987

相关文章:

ElasticSearch常见的索引_集群的备份与恢复方案

方案一&#xff1a;使用Elasticsearch的快照和恢复功能进行备份和恢复。该方案适用于集群整体备份与迁移&#xff0c;包括全量、增量备份和恢复。 方案二&#xff1a;通过reindex操作在集群内或跨集群同步数据。该方案适用于相同集群但不同索引层面的迁移&#xff0c;或者跨集…...

vue图片之放大、缩小、1:1、刷新、左切换、全屏、右切换、左旋咋、右旋转、x轴翻转、y轴翻转

先上效果&#xff0c;代码在下面 <template><!-- 图片列表 --><div class"image-list"><img:src"imageSrc"v-for"(imageSrc, index) in images":key"index"click"openImage(index)"error"handleI…...

Docker多架构镜像构建踩坑记

背景 公司为了做信创项目的亮点&#xff0c;需要将现有的一套在X86上运行的应用系统迁移到ARM服务器上运行&#xff0c;整个项目通过后端Java&#xff0c;前端VUEJS开发通过CICD做成Docker镜像在K8S里面运行。但是当前的CICD产品不支持ARM的镜像构建&#xff0c;于是只能手工构…...

“pinn是无网格的”???

“pinn是无网格的”&#xff1f;&#xff1f;&#xff1f; PINN&#xff0c;即物理信息神经网络&#xff08;Physics-Informed Neural Networks&#xff09;&#xff0c;是一种将物理定律作为先验知识整合到神经网络训练过程中的方法。它之所以被称为“无网格”的&#xff0c;…...

换一个ip地址是什么意思?换一个网络ip地址会变吗

在网络的世界里&#xff0c;IP地址如同每台设备的“身份证”&#xff0c;是确保网络信息能够准确传输到指定目标的关键。然而&#xff0c;在某些情况下&#xff0c;我们可能需要更换这个“身份证”&#xff0c;也就是更换IP地址。那么&#xff0c;换一个IP地址究竟是什么意思&a…...

JavaWeb学习--cookie和session,实现登录的记住我和验证码功能

目录 &#xff08;一&#xff09;Cookie概述 1.什么叫Cookie 2.Cookie规范 3.Cookie的覆盖 4.cookie的最大存活时间 ​​​​​​&#xff08;Cookie的生命&#xff09; &#xff08;二&#xff09; Cookie的API 1.创建Cookie&#xff1a;new 构造方法 2.保存到客户端浏…...

深度学习:基于MindSpore的极简风大模型微调

什么是PEFT&#xff1f;What is PEFT&#xff1f; PEFT(Parameter Efficient Fine-Tuning)是一系列让大规模预训练模型高效适应于新任务或新数据集的技术。 PEFT在保持大部分模型权重冻结&#xff0c;只修改或添加一小部份参数。这种方法极大得减少了计算量和存储开销&#x…...

【LeetCode力扣热题100】【LeetCode 1】两数之和

方法一&#xff1a;暴力循环 两层循环&#xff0c;遍历所有的组合&#xff0c;直到满足条件&#xff0c;返回结果。 class Solution { public:vector<int> twoSum(vector<int>& nums, int target) {for(int i0; i<nums.size()-1 ;i){for(int j i1; j<…...

定制链接类名,两类跳转传参,vue路由重定向,404,模式设置

router-link-exact-active 和 router -link-active两个类名都太长&#xff0c;可以在router路由对象中定制进行简化 // index.js// 路由的使用步骤 52 // 1.下载 v3.6.5 // 2.引入 // 3.安装注册Vue.use(Vue插件) // 4.创建路由对象 // 5.注入到new Vue中&#xff0c;建立关联…...

【ArcGIS微课1000例】0135:自动生成标识码(长度不变,前面自动加0)

文章目录 一、加载实验数据二、BSM计算方法一、加载实验数据 加载专栏《ArcGIS微课实验1000例(附数据)》配套数据中0135.rar中的建筑物数据,如下图所示: 打开属性表,BSM为数据库中要求的字段:以TD_T 1066-2021《不动产登记数据库标准》为例: 计算出来的BSM如下图: 二、B…...

ISO45001职业健康安全管理体系认证流程

前期准备 领导决策&#xff1a;企业高层领导需认识到实施 ISO 45001 体系的重要性和必要性&#xff0c;做出认证决策&#xff0c;并承诺提供必要的资源支持。成立工作小组&#xff1a;由企业各相关部门人员组成工作小组&#xff0c;明确各成员的职责和分工&#xff0c;确保工作…...

VueRouter路由

单页应用程序:例 网易云 多页应用程序&#xff1a;例 京东 网易云导航栏点击任一网页不会跳转京东导航栏点击任一包括导航区域就会实现网页跳转 路由介绍 VueRouter Vue路由介绍 5个步骤写完之后出现 #/&#xff0c;说明当前Vue实例已经被路由所管理 2个关键步骤 新…...

性能测试攻略(一):需求分析

性能测试成为软件开发和运维过程中不可或缺的一环。性能测试不仅能够帮助我们了解系统在特定条件下的表现&#xff0c;还能帮助我们发现并解决潜在的性能问题。那么我们怎么做一次完整的性能测试呢&#xff1f;首先&#xff0c;我们需要进行需求分析&#xff0c;来明确我们的测…...

【24年新算法时间序列预测】黑翅鸢BKA优化Transformer时间序列预测(评估指标全,出图多)

本文采用黑翅鸢优化算法( BKA&#xff0c;2024年新算法)优化Transformer模型的超参数&#xff0c;形成了BKA-Transformer时间序列预测模型&#xff0c;以进一步提升其在时间序列预测中的性能&#xff0c;本文采用Matlab编写了BKA-Transformer时间序列预测模型代码&#xff0c;代…...

YOLOv8改进,YOLOv8引入CARAFE轻量级通用上采样算子,助力模型涨点

摘要 CARAFE模块的设计目的是在不增加计算复杂度的情况下,提升特征图的质量,特别是在视频超分辨率任务中,提升图像质量和细节。CARAFE结合了上下文感知机制和聚合特征的能力,通过动态的上下文注意力机制来提升细节恢复的效果。 理论介绍 传统的卷积操作通常依赖于局部区域…...

ZooKeeper节点扩容

新节点的准备工作&#xff08;这里由hadoop05节点&#xff0c;IP地址为192.168.46.131充当&#xff09; 配置新节点的主机域名映射&#xff0c;并将其通告给集群中的其他节点配置主机间免密登录关闭防火墙并将其加入到开机不启动项同步hadoop01节点的时间将所需要的文件分发给新…...

深度学习的unfold操作

unfold&#xff08;展开&#xff09;是深度学习框架中常见的数据操作。与我们熟悉的卷积类似&#xff0c;unfold也是使用一个特定大小的窗口和步长自左至右、自上至下滑动&#xff0c;不同的是&#xff0c;卷积是滑动后与核求乘积&#xff08;所以取名为卷积&#xff09;&#…...

C# 抽奖程序winform示例

C# 抽奖程序winform示例 using System; using System.Collections.Generic; using System.Linq;public class LotterySimulator {private Random random new Random();public List<string> GenerateWinners(int numberOfWinners, int totalParticipants){List<strin…...

嵌入式蓝桥杯学习9 usart串口

复制一下之前ADC的工程&#xff0c;打开cubemx cubemx配置 1.在Connectivity中点击USART1 Mode&#xff08;模式&#xff09;:Asynchronous&#xff08;异步模式&#xff09; 2.将PA9设置为USART1_TX&#xff0c;PA10设置为USART1_RX。 3.配置Parameter Settings. Baud R…...

车载ADB:让汽车更智能的桥梁

随着科技的不断进步&#xff0c;汽车行业也在迅速迈向智能化。车载Android系统&#xff08;通常称为Android Auto&#xff09;正在变得越来越流行&#xff0c;而Android Debug Bridge (ADB) 作为连接和调试这些系统的桥梁&#xff0c;也变得尤为重要。在本文中&#xff0c;我们…...

XML Group端口详解

在XML数据映射过程中&#xff0c;经常需要对数据进行分组聚合操作。例如&#xff0c;当处理包含多个物料明细的XML文件时&#xff0c;可能需要将相同物料号的明细归为一组&#xff0c;或对相同物料号的数量进行求和计算。传统实现方式通常需要编写脚本代码&#xff0c;增加了开…...

【AI学习】三、AI算法中的向量

在人工智能&#xff08;AI&#xff09;算法中&#xff0c;向量&#xff08;Vector&#xff09;是一种将现实世界中的数据&#xff08;如图像、文本、音频等&#xff09;转化为计算机可处理的数值型特征表示的工具。它是连接人类认知&#xff08;如语义、视觉特征&#xff09;与…...

以光量子为例,详解量子获取方式

光量子技术获取量子比特可在室温下进行。该方式有望通过与名为硅光子学&#xff08;silicon photonics&#xff09;的光波导&#xff08;optical waveguide&#xff09;芯片制造技术和光纤等光通信技术相结合来实现量子计算机。量子力学中&#xff0c;光既是波又是粒子。光子本…...

JS设计模式(4):观察者模式

JS设计模式(4):观察者模式 一、引入 在开发中&#xff0c;我们经常会遇到这样的场景&#xff1a;一个对象的状态变化需要自动通知其他对象&#xff0c;比如&#xff1a; 电商平台中&#xff0c;商品库存变化时需要通知所有订阅该商品的用户&#xff1b;新闻网站中&#xff0…...

云原生安全实战:API网关Kong的鉴权与限流详解

&#x1f525;「炎码工坊」技术弹药已装填&#xff01; 点击关注 → 解锁工业级干货【工具实测|项目避坑|源码燃烧指南】 一、基础概念 1. API网关&#xff08;API Gateway&#xff09; API网关是微服务架构中的核心组件&#xff0c;负责统一管理所有API的流量入口。它像一座…...

华为OD机考-机房布局

import java.util.*;public class DemoTest5 {public static void main(String[] args) {Scanner in new Scanner(System.in);// 注意 hasNext 和 hasNextLine 的区别while (in.hasNextLine()) { // 注意 while 处理多个 caseSystem.out.println(solve(in.nextLine()));}}priv…...

学习一下用鸿蒙​​DevEco Studio HarmonyOS5实现百度地图

在鸿蒙&#xff08;HarmonyOS5&#xff09;中集成百度地图&#xff0c;可以通过以下步骤和技术方案实现。结合鸿蒙的分布式能力和百度地图的API&#xff0c;可以构建跨设备的定位、导航和地图展示功能。 ​​1. 鸿蒙环境准备​​ ​​开发工具​​&#xff1a;下载安装 ​​De…...

Spring Security 认证流程——补充

一、认证流程概述 Spring Security 的认证流程基于 过滤器链&#xff08;Filter Chain&#xff09;&#xff0c;核心组件包括 UsernamePasswordAuthenticationFilter、AuthenticationManager、UserDetailsService 等。整个流程可分为以下步骤&#xff1a; 用户提交登录请求拦…...

人工智能 - 在Dify、Coze、n8n、FastGPT和RAGFlow之间做出技术选型

在Dify、Coze、n8n、FastGPT和RAGFlow之间做出技术选型。这些平台各有侧重&#xff0c;适用场景差异显著。下面我将从核心功能定位、典型应用场景、真实体验痛点、选型决策关键点进行拆解&#xff0c;并提供具体场景下的推荐方案。 一、核心功能定位速览 平台核心定位技术栈亮…...

在golang中如何将已安装的依赖降级处理,比如:将 go-ansible/v2@v2.2.0 更换为 go-ansible/@v1.1.7

在 Go 项目中降级 go-ansible 从 v2.2.0 到 v1.1.7 具体步骤&#xff1a; 第一步&#xff1a; 修改 go.mod 文件 // 原 v2 版本声明 require github.com/apenella/go-ansible/v2 v2.2.0 替换为&#xff1a; // 改为 v…...