【经验分享】openGauss容灾集群搭建

news2024/10/6 0:23:55

gs_sdr命令代码解读

背景

openGauss推出了容灾架构,相比之前的一个集群主从架构,而容灾架构是两个集群间的数据同步。为了更深入了解其原理,本文试图通过阅读gs_sdr命令相关的代码来学习下相关的各种操作。

1.容灾搭建过程可以参考:https://www.modb.pro/db/628767

2.vscode调试配置可以参考:https://www.modb.pro/db/658344

3.个人学习记录,理解不一定完全正确。如有错误,可指出一起探讨_

环境准备

安装集群

安装两套集群,每套集群含2个节点,相关信息如下:

集群1信息
omm@pghost2 ~$ cm_ctl query -Cvid
[ CMServer State ]

node node_ip instance state
---------------------------------------------------------------------
1 pghost2 192.168.56.20 1 /app/ogdata/data/cm/cm_server Primary
2 pghost3 192.168.56.30 2 /app/ogdata/data/cm/cm_server Standby

[ Cluster State ]

cluster_state : Normal
redistributing : No
balanced : Yes
current_az : AZ_ALL

[ Datanode State ]

node node_ip instance state | node node_ip instance state
------------------------------------------------------------------------------------------------------------------------------------------------
1 pghost2 192.168.56.20 6001 /app/ogdata/data/dn1 P Primary Normal | 2 pghost3 192.168.56.30 6002 /app/ogdata/data/dn1 S Standby Normal
集群2信息
omm@pghost5 ~$ cm_ctl query -Cvid
[ CMServer State ]

node node_ip instance state
---------------------------------------------------------------------
1 pghost5 192.168.56.50 1 /app/ogdata/data/cm/cm_server Primary
2 pghost6 192.168.56.60 2 /app/ogdata/data/cm/cm_server Standby

[ Cluster State ]

cluster_state : Normal
redistributing : No
balanced : Yes
current_az : AZ_ALL

[ Datanode State ]

node node_ip instance state | node node_ip instance state
------------------------------------------------------------------------------------------------------------------------------------------------
1 pghost5 192.168.56.50 6001 /app/ogdata/data/dn1 P Primary Normal | 2 pghost6 192.168.56.60 6002 /app/ogdata/data/dn1 S Standby Normal

创建容灾用户

集群1上创建容灾用户:

gsql -d postgres -p 26000 -c "create user dr_user with replication password 'oracle_4U';"

修改XML配置

修改集群1

修改后的xml配置如下:

<?xml version="1.0" encoding="UTF-8"?> > <ROOT> > <CLUSTER> > <PARAM name="clusterName" value="gauss_omm"/> > <PARAM name="gaussdbAppPath" value="/app/opengauss/app/2.0.1"/> > <PARAM name="gaussdbLogPath" value="/app/opengauss/gaussdb_log" /> > <PARAM name="tmpMppdbPath" value="/app/opengauss/tmp"/> > <PARAM name="gaussdbToolPath" value="/app/opengauss/tool"/> > <PARAM name="corePath" value="/app/opengauss/corefile"/> > <PARAM name="backIp1s" value="192.168.56.20,192.168.56.30,192.168.56.40"/> > <PARAM name="nodeNames" value="pghost2,pghost3,pghost4"/> > <PARAM name="clusterType" value="single-inst"/> > </CLUSTER> > <DEVICELIST> > <DEVICE sn="pghost2"> > <PARAM name="name" value="pghost2"/> > <PARAM name="backIp1" value="192.168.56.20"/> > <PARAM name="sshIp1" value="192.168.56.20"/> > <PARAM name="azName" value="F"/> > <PARAM name="azPriority" value="1"/> > <!-- dn --> > <PARAM name="dataNum" value="1"/> > <PARAM name="dataPortBase" value="26000"/> > <PARAM name="dataNode1" value="/app/ogdata/data/dn1,pghost3,/app/ogdata/data/dn1,pghost4,/app/ogdata/data > /dn1"/> > <!-- cm(configuration manager)--> > <PARAM name="cmDir" value="/app/ogdata/data/cm" /> > <PARAM name="cmsNum" value="1" /> > <PARAM name="cmServerPortBase" value="26500" /> > <PARAM name="cmServerlevel" value="1" /> > <PARAM name="cmServerListenIp1" value="192.168.56.20,192.168.56.30,192.168.56.40" /> > <PARAM name="cmServerRelation" value="pghost2,pghost3,pghost4" /> > **<PARAM name="localStreamIpmap1" value="(192.168.56.20,192.168.56.20),(192.168.56.30,192.168.56.30)"/>** > **<PARAM name="remoteStreamIpmap1" value="(192.168.56.50,192.168.56.50),(192.168.56.60,192.168.56.60)"/>** > <PARAM name="remotedataPortBase" value="26000"/> > </DEVICE> > <DEVICE sn="pghost3"> > <PARAM name="name" value="pghost3"/> > <PARAM name="backIp1" value="192.168.56.30"/> > <PARAM name="sshIp1" value="192.168.56.30"/> > <PARAM name="azName" value="F"/> > <PARAM name="azPriority" value="1"/> > <PARAM name="cmDir" value="/app/ogdata/data/cm" /> > </DEVICE> > <DEVICE sn="pghost4"> > <PARAM name="name" value="pghost4"/> > <PARAM name="backIp1" value="192.168.56.40"/> > <PARAM name="sshIp1" value="192.168.56.40"/> > <PARAM name="azName" value="F"/> > <PARAM name="azPriority" value="1"/> > <PARAM name="cmDir" value="/app/ogdata/data/cm" /> > </DEVICE> > </DEVICELIST> > </ROOT>
修改集群2

修改后的xml配置如下

> <?xml version="1.0" encoding="UTF-8"?> > <ROOT> > &nbsp; <CLUSTER> > &nbsp; &nbsp; <PARAM name="clusterName" value="gauss_omm"/> > &nbsp; &nbsp; <PARAM name="gaussdbAppPath" value="/app/opengauss/app/2.0.1"/> > &nbsp; &nbsp; <PARAM name="gaussdbLogPath" value="/app/opengauss/gaussdb_log" /> > &nbsp; &nbsp; <PARAM name="tmpMppdbPath" value="/app/opengauss/tmp"/> > &nbsp; &nbsp; <PARAM name="gaussdbToolPath" value="/app/opengauss/tool"/> > &nbsp; &nbsp; <PARAM name="corePath" value="/app/opengauss/corefile"/> > &nbsp; &nbsp; <PARAM name="backIp1s" value="192.168.56.50,192.168.56.60"/> > &nbsp; &nbsp; <PARAM name="nodeNames" value="pghost5,pghost6"/> > &nbsp; &nbsp; <PARAM name="clusterType" value="single-inst"/> > &nbsp; </CLUSTER> > &nbsp; <DEVICELIST> > &nbsp; &nbsp; <DEVICE sn="pghost5"> > &nbsp; &nbsp; &nbsp; <PARAM name="name" value="pghost5"/> > &nbsp; &nbsp; &nbsp; <PARAM name="backIp1" value="192.168.56.50"/> > &nbsp; &nbsp; &nbsp; <PARAM name="sshIp1" value="192.168.56.50"/> > &nbsp; &nbsp; &nbsp; <PARAM name="azName" value="Y"/> > &nbsp; &nbsp; &nbsp; <PARAM name="azPriority" value="2"/> > &nbsp; &nbsp; &nbsp; <!-- dn --> > &nbsp; &nbsp; &nbsp; <PARAM name="dataNum" value="1"/> > &nbsp; &nbsp; &nbsp; <PARAM name="dataPortBase" value="26000"/> > &nbsp; &nbsp; &nbsp; <PARAM name="dataNode1" value="/app/ogdata/data/dn1,pghost6,/app/ogdata/data/dn1"/> > &nbsp; &nbsp; &nbsp; <!-- cm(configuration manager)--> > &nbsp; &nbsp; &nbsp; <PARAM name="cmDir" value="/app/ogdata/data/cm" /> > &nbsp; &nbsp; &nbsp; <PARAM name="cmsNum" value="1" /> > &nbsp; &nbsp; &nbsp; <PARAM name="cmServerPortBase" value="26500" /> > &nbsp; &nbsp; &nbsp; <PARAM name="cmServerlevel" value="1" /> > &nbsp; &nbsp; &nbsp; <PARAM name="cmServerListenIp1" value="192.168.56.50,192.168.56.60" /> > &nbsp; &nbsp; &nbsp; <PARAM name="cmServerRelation" value="pghost5,pghost6" /> > &nbsp; &nbsp; &nbsp; **<PARAM name="localStreamIpmap1" value="(192.168.56.50,192.168.56.50),(192.168.56.60,192.168.56.60)"/>** > &nbsp; &nbsp; &nbsp; **<PARAM name="remoteStreamIpmap1" value="(192.168.56.20,192.168.56.20),(192.168.56.30,192.168.56.30)"/>** > &nbsp; &nbsp; &nbsp; **<PARAM name="remotedataPortBase" value="26000"/>** > &nbsp; &nbsp; </DEVICE> > &nbsp; &nbsp; <DEVICE sn="pghost6"> > &nbsp; &nbsp; &nbsp; <PARAM name="name" value="pghost6"/> > &nbsp; &nbsp; &nbsp; <PARAM name="backIp1" value="192.168.56.60"/> > &nbsp; &nbsp; &nbsp; <PARAM name="sshIp1" value="192.168.56.60"/> > &nbsp; &nbsp; &nbsp; <PARAM name="azName" value="Y"/> > &nbsp; &nbsp; &nbsp; <PARAM name="azPriority" value="2"/> > &nbsp; &nbsp; &nbsp; <PARAM name="cmDir" value="/app/ogdata/data/cm" /> > &nbsp; &nbsp; </DEVICE> > &nbsp; </DEVICELIST> > </ROOT> 配置容灾

集群1启动为主集群

使用的命令为:

# gs_sdr -t start -m primary -X XMLFILE [-U DR_USERNAME [-W DR_PASSWORD]] [--time-out=SECS]
gs_sdr -t start -m primary -X /home/omm/single.xml -U dr_user -W oracle_4U --time-out=86400

vscode调试配置

{
"version": "0.2.0",
"configurations": [
{
"name": "Python: 当前文件",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": true,
"args": ["-t","start","-m","primary","-X","/home/omm/single.xml","-U","dr_user","-W","oracle_4U","--time-out=86400"]
}
]
}

gs_sdr脚本main函数中打上断点

代码阅读

判断是否使用root权限操作
if os.getuid() == 0:
GaussLog.exitWithError(ErrorCode.GAUSS_501["GAUSS_50105"])
# 是root权限就直接报错退出
初始化StreamingDisasterRecoveryBase
base = StreamingDisasterRecoveryBase() # 从集群xml配置文件中加载相 关的信息

base中保存的信息可以参考下图:

86ccfc766e49c4ae277aa1df484da647.jpeg

判断做何种操作
handler = HANDLER_MAPPING[base.params.task](base.params, base.user, base.logger, base.trace_id, base.log_file)
# 这里的 HANDLER_MAPPING 主要包括4种操作。具体如下:
HANDLER_MAPPING = {
"start": StreamingStartHandler, # 这块应该是对应上图中的 moduleName 中的值
"stop": StreamingStopHandler,
"switchover": StreamingSwitchoverHandler,
"failover": StreamingFailoverHandler,
"query": StreamingQueryHandler
}
# 此处的 base.params.task 值为 start ,映射到类 StreamingStartHandler ,该类在文件 streaming_diaster_recovery_start.py 中
创建锁定文件

由于容灾搭建过程涉及到数据同步耗时较长,这里应是为避免多次重复操作。

handler.handle_lock_file(handler.trace_id, 'create') # 该方法在streaming_base.py中定义
# 会生成一个文件:'/app/opengauss/tmp/streaming_lock_cd7eef1a2c1f11ee92b208002716c96f'
判断是否有其他gs_sdr操作
if base.params.task in StreamingConstants.TASK_EXIST_CHECK:
handler.check_streaming_process_is_running() # 有的话,就终止本次操作。
# 'source /home/omm/.bashrc && pssh -t 10 -H pghost2 -H pghost3 "ls /app/opengauss/tmp/streaming_lock_*"' 主要使用该命令
执行操作
进度记录相关操作
handler.run()
self.logger.log("Start create streaming disaster relationship.")
# 创建进度记录文件夹:/app/opengauss/tmp/streaming_cabin(所有节点均创建)
# 进度记录文件:'.streaming_switchover_primary.step'
## 所有的进度记录文件名字如下:
STREAMING_STEP_FILES = {
"start_primary": ".streaming_start_primary.step",
"start_standby": ".streaming_start_standby.step",
"stop": ".streaming_stop.step",
"switchover_primary": ".streaming_switchover_primary.step",
"switchover_standby": ".streaming_switchover_standby.step",
"failover": ".streaming_failover.step",
"query": ".streaming_query.step",
}
检查集群状态
# 检查集群状态
'source /home/omm/.bashrc ; gs_om -t status --all > /app/opengauss/tmp/streaming_cabin/cluster_state_tmp'
判断执行节点是否为主节点

操作需要在主节点上执行。

生成 key_name.key.cipher & key_name.key.rand 文件
export LD_LIBRARY_PATH=/app/opengauss/tool/script/gspylib/clib && source /home/omm/.bashrc && gs_guc generate -S default -o hadr -D '/app/opengauss/app/2.0.1_46134f73/bin' && /bin/chmod 600 /app/opengauss/app/2.0.1_46134f73/bin/hadr.key.cipher && /bin/chmod 600 /app/opengauss/app/2.0.1_46134f73/bin/hadr.key.rand
# 随后会将生成的文件分发到集群中其他节点上。
保存hadr信息到数据库
ALTER GLOBAL CONFIGURATION with(hadr_user_info ='O1hnmUERtm2hfiXGjKjgaCfKq89IgdSzUqCoMGw/yzdaYki1LYTfhHlILmz10IvDTX9fqGNZrcmdX5NmkK+6bw==');
检查是否已经有首备节点

判断是否已经是容灾环境。

检查是否有cm

容灾环境必须要有cm组件。

检查是否在升级中
# 判断/app/opengauss/tmp/binary_upgrade是否存在
写进度文件
$ more /app/opengauss/tmp/streaming_cabin/.streaming_start_primary.step
2_check_cluster_step
common_step_for_streaming_start
# 生成容灾关系json文件 并分发到集群中的其它节点上。
more /app/opengauss/tmp/streaming_cabin/cluster_conf_record
{"remoteClusterConf": {"port": 26500, "shards": [[{"ip": "192.168.56.50", "dataIp": "192.168.56.50"}, {"ip": "1
92.168.56.60", "dataIp": "192.168.56.60"}]]}, "localClusterConf": {"port": 26000, "shards": [[{"ip": "192.168.5
6.20", "dataIp": "192.168.56.20"}, {"ip": "192.168.56.30", "dataIp": "192.168.56.30"}]]}}
修改pg_hba配置
# 拷贝/home/omm/single.xml为/app/opengauss/tmp/streaming_cabin/streaming_config.xml
source /home/omm/.bashrc; python3 '/app/opengauss/tool/script/local/ConfigHba.py' -U omm -X '/app/opengauss/tmp/streaming_cabin/streaming_config.xml' --try-reload
# 会在pg_hba.conf文件中加入:
host all omm 192.168.56.50/32 trust
host all omm 192.168.56.60/32 trust
host replication all 192.168.0.0/16 sha256
复制参数replconninfo相关设置
'source /home/omm/.bashrc; pssh -H pghost3 \'source /home/omm/.bashrc; gs_guc check -Z datanode -D /app/ogdata/data/dn1 -c "replconninfo1"\''

'source /home/omm/.bashrc; pssh -H pghost3 \'source /home/omm/.bashrc; gs_guc check -Z datanode -D /app/ogdata/data/dn1 -c "replconninfo2"\''

'source /home/omm/.bashrc; pssh -H pghost3 "source /home/omm/.bashrc ; gs_guc reload -Z datanode -D /app/ogdata/data/dn1 -c \\"replconninfo1 = \'localhost=192.168.56.30 localport=26001 localheartbeatport=26005 localservice=26004 remotehost=192.168.56.20 remoteport=26001 remoteheartbeatport=26005 remoteservice=26004 iscascade=true iscrossregion=false\'\\""'
等待首备连接

Waiting for the main standby connection.

这里需要在备集群执行下面的命令:

gs_sdr -t start -m disaster_standby -U dr_user -W oracle_4U -X /home/omm/single.xml --time-out=86400 # 此处为方便,直接在终端上执行该命令,没有进行调试。

集群2启动为备集群

gs_sdr -t start -m disaster_standby -U dr_user -W oracle_4U -X /home/omm/single.xml --time-out=86400

vscode调试配置

{
"version": "0.2.0",
"configurations": [
{
"name": "gs_sdr",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": true,
"args": ["-t","start","-m","disaster_standby","-X","/home/omm/single.xml","-U","dr_user","-W","oracle_4U","--time-out=86400"]
}
]
}

执行的类: streaming_diaster_recovery_start

代码阅读

Start build key files from remote cluster

备集群会进行build,速度比较慢(与网络环境和数据库大小关系较大)。

source /home/omm/.bashrc; /app/opengauss/app/2.0.1/bin/gs_ctl build -D /app/ogdata/data/dn1 -M standby -b copy_secure_files -U dr_user -P *** -C "localhost=192.168.56.50 localport=26001 remotehost=192.168.56.20 remoteport=26501"

source /home/omm/.bashrc; /app/opengauss/app/2.0.1/bin/gs_ctl build -D /app/ogdata/data/dn1 -M standby -b copy_secure_files -U dr_user -P *** -C "localhost=192.168.56.50 localport=26001 remotehost=192.168.56.30 remoteport=26501"

echo *** /home/omm/.bashrc; /app/opengauss/app/2.0.1/bin/gs_ctl build -D /app/ogdata/data/dn1 -M standby -b copy_secure_files -U dr_user -P *** -C 'localhost=192.168.56.60 localport=26001 remotehost=192.168.56.20 remoteport=26501'" | pssh -s -H pghost6'
copy file from data dir to streaming dir
# 第1个节点
echo "if [ -d \'/app/ogdata/data/dn1/gs_secure_files\' ];then source /home/omm/.bashrc && pscp --trace-id 9f2c898e2c5a11ee850c080027fd3332 -H pghost5 \'/app/ogdata/data/dn1/gs_secure_files\' \'/app/opengauss/tmp/streaming_cabin\' && rm -rf \'/app/ogdata/data/dn1/gs_secure_files\';fi" | pssh -s -H pghost5
# 第2个节点
echo "if [ -d \'/app/ogdata/data/dn1/gs_secure_files\' ];then source /home/omm/.bashrc && pscp --trace-id 9f2c898e2c5a11ee850c080027fd3332 -H pghost5 \'/app/ogdata/data/dn1/gs_secure_files\' \'/app/opengauss/tmp/streaming_cabin\' && rm -rf \'/app/ogdata/data/dn1/gs_secure_files\';fi" | pssh -s -H pghost6
check cluster user consistency

主要检查版本和版本提交号是否一致。

检查安装用户是否一致

设置集群运行模式stream_cluster_run_mode
source /home/omm/.bashrc && gs_guc set -Z datanode -N all -I all -c "stream_cluster_run_mode = \'cluster_standby\'"

source /home/omm/.bashrc && gs_guc set -Z coordinator -N all -I all -c "stream_cluster_run_mode = \'cluster_standby\'"
停止备集群
'/app/opengauss/app/2.0.1_46134f73/bin/cluster_static_config'
再次build集群
source /home/omm/.bashrc; /app/opengauss/app/2.0.1_46134f73/bin/gs_ctl start -D /app/ogdata/data/dn1 -M hadr_main_standby

echo *** /home/omm/.bashrc; /app/opengauss/app/2.0.1_46134f73/bin/gs_ctl build -D /app/ogdata/data/dn1 -M cascade_standby -b standby_full -r 7200 -t 1209600" | pssh -s -t 1209610 -H pghost6
启动集群
source /home/omm/.bashrc ; cm_ctl start -t 604800 # 此时的集群已经是首备和级联备状态了。

查询容灾状态

gs_sdr -t query

主集群

$ gs_sdr -t query
--------------------------------------------------------------------------------
Streaming disaster recovery query 9f658f3a2d0511eebbb208002716c96f
--------------------------------------------------------------------------------
Start streaming disaster query.
Start check archive.
Start check recovery.
Start check RPO & RTO.
Successfully executed streaming disaster recovery query, result:
{'hadr_cluster_stat': 'archive', 'hadr_failover_stat': '', 'hadr_switchover_stat': '', 'RPO': '0', 'RTO': '0'}

备集群

$ gs_sdr -t query
--------------------------------------------------------------------------------
Streaming disaster recovery query ad8afd5c2d0511ee88cf080027fd3332
--------------------------------------------------------------------------------
Start streaming disaster query.
Start check archive.
Start check recovery.
Start check RPO & RTO.
Successfully executed streaming disaster recovery query, result:
{'hadr_cluster_stat': 'restore', 'hadr_failover_stat': '', 'hadr_switchover_stat': '', 'RPO': '', 'RTO': ''}


本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1136708.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Ragnar-lothbrok 靶机

Ragnar-lothbrok 信息搜集 存活检测 详细扫描 后台网页扫描 网站信息搜集 secret “秘密”网页 将密文保存到 password.txt 此页面使用了 wordpress CMS 疑似用户 ragnar wpscan 也爆破出了用户 ragnar wpscan --url http://10.4.7.155/wordpress/ --enumerate u 密码获…

Node.js中的单线程服务器

为了解决多线程服务器在高并发的I/O密集型应用中的不足&#xff0c;同时避免早期简单单线程服务器的性能障碍&#xff0c;Node.js采用了基于"事件循环"的非阻塞式单线程模型&#xff0c;实现了如下两个目标&#xff1a; &#xff08;1&#xff09;保证每个请求都可以…

外汇天眼:获利数倍、财务自由不是梦? 小心网络投资诈骗4阶段!

近年来网络投资愈来愈热络&#xff0c;我们经常看到有人因做加密货币、外汇交易而致富的报道&#xff0c;并开始寻找可以获利的投资机会与渠道。 然而&#xff0c;诈骗集团也注意到这个趋势&#xff0c;因此透过假冒经纪商或开设黑平台等方式&#xff0c;伺机获取不法所得。 有…

Github.io个人主页模板(进阶版)

网上很多博客感觉是有点Outdate了&#xff0c;而且通用性不强&#xff0c;希望这篇博客能给你帮助。 【保姆级教程】手把手教你用github制作学术个人主页&#xff08;学者必备&#xff09;_github个人主页模板-CSDN博客 【GitHub】用Jekyll模板快速制作github.io学术主页 - 知…

JVS低代码表单引擎之文本框的强大作用,建议收藏!

表单是低代码最基础的数据输入的方式&#xff0c;其中文本框是配置话表单的最基础的业务能力组件之一&#xff0c;主要用于收集和展示用户录入的文本类的信息&#xff0c;例如名称、地址、描述说明等等。 那么我们接下来分几个方面分别对文本框的使用进行讲解。 基础功能 拥有…

初识Java 16-1 字符串

目录 字符串的常量和变量 不变的String常量 String变量 重载的和更快的StringBuilder 容易忽略的递归现象 对字符串的操作 格式化输出 System.out.format() Formatter类 格式说明符 Formatter转换 String.format() 新特性&#xff1a;文本块 本笔记参考自&#xff…

Creaform形创HandySCAN MAX l Elite三维扫描仪便携式3D测量解决方案

CASAIM中科院广州电子智能制造事业部连续多年荣获形创Creaform战略级代理商证书。战略级代理商是形创Creaform最高级别的合作伙伴。 2023年CASAIM中科院广州电子智能制造事业部的形创Creaform战略级代理商证书&#xff1a; Creaform 形创是便携式三维测量解决方案和工程服务领…

使用mac自带VNC公网远程控制macOS

公网远程控制macOS【使用mac自带VNC】 文章目录 公网远程控制macOS【使用mac自带VNC】前言1. 测试局域网内远程控制1.1 macOS打开屏幕共享1.2 测试局域网内VNC远程控制 2. 测试公网远程控制2.1 macOS安装配置cpolar内网穿透2.2 创建tcp隧道&#xff0c;指向5900端口 3. 测试公网…

人工智能的发展方向:探索智能未来的无限可能

原创 | 文 BFT机器人 人工智能&#xff0c;简称AI&#xff0c;是一门专注于研究计算机如何能像人类一样思考、学习和解决问题的科学。它的创造初衷是构建一个智能系统&#xff0c;能模仿、模拟甚至实现人工智能的各种功能和行为&#xff0c;随着科技的持续进步&#xff0c;人工…

TSINGSEE青犀智能分析网关裸土覆盖算法如何做到防范山体滑坡?

在雨水季节&#xff0c;特别是山区&#xff0c;十分容易发生山体滑坡现象&#xff0c;会导致山村、铁路、公路、房屋、甚至城镇被冲毁&#xff0c;造成严重的人员伤亡和财产损失。而TSINGSEE青犀智能分析网关裸土覆盖算法是一种利用图像处理技术来评估裸露土壤面积和裸露程度的…

VMware打开共享虚拟机后找不到/mnt/hgfs/文件夹,以及不能拖拽/复制粘贴等操作,ubuntu不能安装VMware tools

问题原因 我的问题出现原因是&#xff0c;安装ubuntn虚拟机的时候VMware tools没有安装好&#xff0c;需要重新安装&#xff0c;但安装选项是暗的&#xff0c;不能操作。 类似这种情况&#xff0c;虚拟机开启时也是&#xff0c;因为我虚拟机已经装好了&#xff0c;开启时是亮…

【JAVA】:万字长篇带你了解JAVA并发编程【二】

目录 【JAVA】&#xff1a;万字长篇带你了解JAVA并发编程【二】3. 线程池池化技术线程池的概念与作用什么是线程池&#xff1f;优点 Executor框架Executor框架组成部分工作任务抽象接口和类 线程池的生命周期非核心线程和核心线程ThreadPoolExecutor线程池的工作流常见的线程池…

快速解决msvcp140.dll丢失问题的5个方法,轻松修复dll问题

在计算机使用过程中&#xff0c;我们经常会遇到一些错误提示&#xff0c;其中之一就是“msvcp140.dll丢失”。那么&#xff0c;msvcp140.dll究竟是什么&#xff1f;它丢失需要怎么修复呢&#xff1f;本文将从多个角度对这一问题进行详细解析。 一、msvcp140.dll是什么 msvcp14…

C/C++输出整数 2020年9月电子学会青少年软件编程(C/C++)等级考试一级真题答案解析

目录 C/C输出整数 一、题目要求 1、编程实现 2、输入输出 二、算法分析 三、程序编写 四、程序说明 五、运行结果 六、考点分析 C/C输出整数 2020年9月 C/C编程等级考试一级编程题 一、题目要求 1、编程实现 输入四个整数&#xff0c;把输入的第三、第四个整数输出…

Jmeter(十四):跨线程组传递jmeter变量及cookie的处理详解

setUp线程组 setUp thread group 一种特殊类型的线程组&#xff0c;用于在执行常规线程组之前执行一些必要的操作。 在 setup线程组下提到的线程行为与普通线程组完全相同。不同的是执行顺序--- 它会在普通线程组执行之前被触发&#xff1b; 应用场景举例&#xff1a; A、测…

21.7 Python 使用Request库

Request库可以用来发送各种HTTP请求&#xff0c;该框架的特点是简单易用&#xff0c;同时支持同步和异步请求&#xff0c;支持HTTP协议的各种方法和重定向。它还支持Cookie、HTTPS和认证等特性。 Request库的使用非常广泛&#xff0c;可以用于网络爬虫、API调用、网站测试等场景…

vue3 echarts实现k线

文章目录 echarts实现k线核心代码完整代码 echarts实现k线 安装 npm install echarts实现效果 没有添加成交量和均线 核心代码 引入echarts echartsData表示echarts数据 这样写是为了方便点击时间切换k线数据 window.addEventListener(“resize”, () > { chart.resi…

实习日常的点点滴滴记录(threadlocal知识概括和相关应用场景)------慢慢积累,厚积薄发(要学的东西还好多,加油!))(知识和实践的结合)

在通常的业务开发中&#xff0c;ThreadLocal 有两种典型的使用场景&#xff1a; 场景1&#xff1a; ThreadLocal 用作保存每个线程独享的对象&#xff0c;为每个线程都创建一个副本&#xff0c;这样每个线程都可以修改自己所拥有的副本, 而不会影响其他线程的副本&#xff0c…

tinymce输入框怎么限制只输入空格或者回车时不能提交

项目场景: 项目相关背景: tinymce输入框只输入空格或者回车时提交的空数据毫无意义,所以需要限制一下 无意义的输入: 解决方案: 因为tinymce输入框传到后端的数据是代码形式,所以不能直接.trem,需要一步步的进行去除空格(空格分:‘ ’与‘ ’)与回车。 注意:空…

xFlight开源飞控之AT32F435计划

xFlight开源飞控之AT32F435计划 1. 源由2. 材料清单2.1 结构件2.2 动力件2.2 电子件2.3 天线2.4 附件 3. 固件准备4. 整机外观5. 问题汇总5.1 【已解决】iNav固件无法找到Baro芯片5.2 【已解决】正反电机问题5.3 【已解决】摄像头图像模糊5.4 【已解决】ESC 电机 bdshot异常5.5…