Deprecated: imwpcache\f884414bce24ee67f\f73723ec7b1919fa5::__construct(): Implicitly marking parameter $YECBGYFECGEAFWHA as nullable is deprecated, the explicit nullable type must be used instead in /www/wwwroot/www.chuangxiangniao.com/wp-content/plugins/imwpcache-dist/build/f884414bce24ee67ff73723ec7b1919fa5.php on line 2

Deprecated: imwpcache\f884414bce24ee67f\f73723ec7b1919fa5::__construct(): Implicitly marking parameter $BBWFDDBHHYHDXXAB as nullable is deprecated, the explicit nullable type must be used instead in /www/wwwroot/www.chuangxiangniao.com/wp-content/plugins/imwpcache-dist/build/f884414bce24ee67ff73723ec7b1919fa5.php on line 2
MySQL MGR集群单主模式的自动搭建和自动化故障修复_创想鸟

MySQL MGR集群单主模式的自动搭建和自动化故障修复

随着mysql mgr版本的升级和技术的成熟,mgr在取代mha成为mysql高可用首选方案后,其搭建过程虽然不算复杂,但仍涉及一系列手动操作。为了简化mgr的搭建和故障诊断,开发了一个自动化脚本,用于实现mgr的自动化搭建、自动化故障诊断及修复。

为了简化起见,MGR的自动化搭建测试采用单机多实例模式,预先安装了三个MySQL实例,端口号分别为7001、7002和7003,其中7001作为写入节点,其余两个节点作为读取节点,8000节点为作者的另一个测试节点,可忽略。在指定主从节点的情况下,以下是mgr_tool.py一键搭建MGR集群的测试demo。

MySQL MGR集群单主模式的自动搭建和自动化故障修复MGR故障模拟1

MGR节点故障的自动监测和自愈实现如下图所示,搭建完成后的MGR集群目前处于完全正常的状态。

MySQL MGR集群单主模式的自动搭建和自动化故障修复主观造成主从节点间binlog的丢失

MySQL MGR集群单主模式的自动搭建和自动化故障修复在主节点上对从节点丢失的数据进行操作,GTID无法找到对应的数据,组复制立即停止。

MySQL MGR集群单主模式的自动搭建和自动化故障修复非写入节点出现错误

MySQL MGR集群单主模式的自动搭建和自动化故障修复查看errorlog

MySQL MGR集群单主模式的自动搭建和自动化故障修复如果手动解决,仍需使用GTID跳过错误事务的常规方法,获取master上的GTID信息。

MySQL MGR集群单主模式的自动搭建和自动化故障修复尝试跳过最新的一个事务ID,然后重新连接到组,可以正常连接到组,另一个节点仍处于错误状态。

stop group_replication;

SET GTID_NEXT=’6c81c118-e67c-4416-9cb0-2d573d178c1d:13′;

BEGIN; COMMIT;

set gtid_next=’automatic’;

东盟商机最新AC版As2007  SP1 东盟商机最新AC版As2007 SP1

AS系统本次的主要更新和新开发的功能如下(暂不详述): 1、修复了普及版的一些大大小小的BUG 2、重新规划整个后台,使后台更加个性化、智能化、更加易用 3、重写了广告部分模块,使其更加专业化 4、重写了文章采集模块,添加了定时自动采集功能 5、添加了供求信息采集功能 6、重写了友情连接功能(原来的太简单了) 8、重写了生成HTML模块。(几个主要模块首页不用原来的生成方式,不再会被卡巴斯机杀毒软

东盟商机最新AC版As2007  SP1 0 查看详情 东盟商机最新AC版As2007  SP1

MySQL MGR集群单主模式的自动搭建和自动化故障修复另一个节点类似,依次解决。

MGR故障模拟2

从节点脱离Group

MySQL MGR集群单主模式的自动搭建和自动化故障修复这种情况相对简单,重新启动组复制即可,执行start group_replication。

MGR故障自动检测和修复

对于上述两种情况,1,如果是从节点丢失主节点的事务,尝试在从节点上跳过GTID,重新开始复制即可;2,如果是从节点非丢失主节点事务,尝试在从节点重新开始组复制即可。

实现代码如下:

def auto_fix_mgr_error(conn_master_dict,conn_slave_dict):    group_replication_status = get_group_replication_status(conn_slave_dict)    if(group_replication_status[0]["MEMBER_STATE"]=="ERROR" or group_replication_status[0]["MEMBER_STATE"] == "OFFLINE"):        print(conn_slave_dict["host"]+str(conn_slave_dict["port"])+'------>'+group_replication_status[0]["MEMBER_STATE"])        print("auto fixing......")        while 1 > 0:            master_gtid_list = get_gtid(conn_master_dict)            slave_gtid_list = get_gtid(conn_slave_dict)            master_executed_gtid_value = int((master_gtid_list[-1]["Executed_Gtid_Set"]).split("-")[-1])            slave_executed_gtid_value = int(slave_gtid_list[-1]["Executed_Gtid_Set"].split("-")[-1])            slave_executed_gtid_prefix = slave_gtid_list[-1]["Executed_Gtid_Set"].split(":")[0]            slave_executed_skiped_gtid = slave_executed_gtid_value + 1            if (master_executed_gtid_value > slave_executed_gtid_value):                print("skip gtid and restart group replication,skiped gtid is "                      + slave_gtid_list[-1]["Executed_Gtid_Set"].split(":")[-1].split("-")[0]                      + ":"+str(slave_executed_skiped_gtid))                slave_executed_skiped_gtid = slave_executed_gtid_prefix+":"+str(slave_executed_skiped_gtid)                skip_gtid_on_slave(conn_slave_dict,slave_executed_skiped_gtid)                time.sleep(10)                start_group_replication(conn_slave_dict)                if(get_group_replication_status(conn_slave_dict)[0]["MEMBER_STATE"]=="ONLINE"):                    print("mgr cluster fixed,back to normal")                    break            else:                start_group_replication(conn_slave_dict)                if(get_group_replication_status(conn_slave_dict)[0]["MEMBER_STATE"]=="ONLINE"):                    print("mgr cluster fixed,back to normal")                break    elif (group_replication_status[0]['MEMBER_STATE'] == 'ONLINE'):        print("mgr cluster is normal,nothing to do")        check_replication_group_members(conn_slave_dict)

对于故障类型1,GTID事务不一致的自动化修复

MySQL MGR集群单主模式的自动搭建和自动化故障修复 对于故障类型2从节点offline的自动化修复

MySQL MGR集群单主模式的自动搭建和自动化故障修复完整的实现代码

该过程要求MySQL实例必须满足MGR的基本条件,如果环境本身无法满足MGR,一切都无从谈起,因此要非常清楚MGR环境的最基本要求。

完成的实现代码如下,花了一个下午编写,目前存在以下不足:1,创建复制用户时,未指定具体的slave机器,目前直接指定为%:create user repl@’%’ identified by repl2;2,对于slave的修复,目前无法整体修复,只能一台一台修复,实际上是缺少了一个循环slave机器判断的过程;3,目前搭建之前都会reset master(不管主从,主要是清理可能的残留GTID),因此只适合新环境的搭建;4,目前只支持offline和gtid事务冲突的错误类型修复,无法支持其他MGR错误类型的修复;5,开发环境是单机多实例模式测试,没有在多机单实例模式下充分测试。这些问题将逐步改善和加强。

# -*- coding: utf-8 -*-

import pymysqlimport loggingimport timeimport decimal

def execute_query(conn_dict,sql):conn = pymysql.connect(host=conn_dict['host'], port=conn_dict['port'], user=conn_dict['user'], passwd=conn_dict['password'], db=conn_dict['db'])cursor = conn.cursor(pymysql.cursors.DictCursor)cursor.execute(sql)list = cursor.fetchall()cursor.close()conn.close()return list

def execute_noquery(conn_dict,sql):conn = pymysql.connect(host=conn_dict['host'], port=conn_dict['port'], user=conn_dict['user'], passwd=conn_dict['password'], db=conn_dict['db'])cursor = conn.cursor()cursor.execute(sql)conn.commit()cursor.close()conn.close()return list

def get_gtid(conn_dict):sql = "show master status;"list = execute_query(conn_dict,sql)return list

def skip_gtid_on_slave(conn_dict,gtid):sql_1 = 'stop group_replication;'sql_2 = '''set gtid_next='{0}';'''.format(gtid)sql_3 = 'begin;'sql_4 = 'commit;'sql_5 = '''set gtid_next='automatic';'''

try:    execute_noquery(conn_dict, sql_1)    execute_noquery(conn_dict, sql_2)    execute_noquery(conn_dict, sql_3)    execute_noquery(conn_dict, sql_4)    execute_noquery(conn_dict, sql_5)except:    raise

def get_group_replication_status(conn_dict):sql = '''select MEMBER_STATE from performance_schema.replication_group_members where (MEMBER_HOST = '{0}' or ifnull(MEMBER_HOST,'') = '') AND (MEMBER_PORT={1} or ifnull(MEMBER_PORT,'') ='') ; '''.format(conn_dict["host"], conn_dict["port"])result = execute_query(conn_dict,sql)if result:return resultelse:return None

def check_replication_group_members(conn_dict):print('-------------------------------------------------------')result = execute_query(conn_dict, " select * from performance_schema.replication_group_members; ")if result:column = result[0].keys()current_row = ''for key in column:current_row += str(key) + " "print(current_row)

    for row in result:        current_row = ''        for key in row.values():            current_row += str(key) + " "        print(current_row)print('-------------------------------------------------------')

def auto_fix_mgr_error(conn_master_dict,conn_slave_dict):group_replication_status = get_group_replication_status(conn_slave_dict)if(group_replication_status[0]["MEMBER_STATE"]=="ERROR" or group_replication_status[0]["MEMBER_STATE"] == "OFFLINE"):print(conn_slave_dict["host"]+str(conn_slave_dict["port"])+'------>'+group_replication_status[0]["MEMBER_STATE"])print("auto fixing......")while 1 > 0:master_gtid_list = get_gtid(conn_master_dict)slave_gtid_list = get_gtid(conn_slave_dict)master_executed_gtid_value = int((master_gtid_list[-1]["Executed_Gtid_Set"]).split("-")[-1])slave_executed_gtid_value = int(slave_gtid_list[-1]["Executed_Gtid_Set"].split("-")[-1])slave_executed_gtid_prefix = slave_gtid_list[-1]["Executed_Gtid_Set"].split(":")[0]slave_executed_skiped_gtid = slave_executed_gtid_value + 1if (master_executed_gtid_value > slave_executed_gtid_value):print("skip gtid and restart group replication,skiped gtid is "

slave_gtid_list[-1]["Executed_Gtid_Set"].split(":")[-1].split("-")[0]":"+str(slave_executed_skiped_gtid))slave_executed_skiped_gtid = slave_executed_gtid_prefix+":"+str(slave_executed_skiped_gtid)skip_gtid_on_slave(conn_slave_dict,slave_executed_skiped_gtid)time.sleep(10)start_group_replication(conn_slave_dict)if(get_group_replication_status(conn_slave_dict)[0]["MEMBER_STATE"]=="ONLINE"):print("mgr cluster fixed,back to normal")breakelse:start_group_replication(conn_slave_dict)if(get_group_replication_status(conn_slave_dict)[0]["MEMBER_STATE"]=="ONLINE"):print("mgr cluster fixed,back to normal")breakelif (group_replication_status[0]['MEMBER_STATE'] == 'ONLINE'):print("mgr cluster is normal,nothing to do")check_replication_group_members(conn_slave_dict)

'''reset master'''def reset_master(conn_dict):try:execute_noquery(conn_dict, "reset master;")except:raise

def install_group_replication_plugin(conn_dict):get_plugin_sql = "SELECT name,dl FROM mysql.plugin WHERE name = 'group_replication';"install_plugin_sql = '''install plugin group_replication soname 'group_replication.so'; '''try:result = execute_query(conn_dict, get_plugin_sql)if not result:execute_noquery(conn_dict, install_plugin_sql)except:raise

def create_mgr_repl_user(conn_master_dict,user,password):try:reset_master(conn_master_dict)sql_exists_user = '''select user from mysql.user where user = '{0}'; '''.format(user)user_list = execute_query(conn_master_dict,sql_exists_user)if not user_list:create_user_sql = '''create user {0}@'%' identified by '{1}'; '''.format(user,password)grant_privilege_sql = '''grant replication slave on . to {0}@'%';'''.format(user)execute_noquery(conn_master_dict,create_user_sql)execute_noquery(conn_master_dict, grant_privilege_sql)execute_noquery(conn_master_dict, "flush privileges;")except:raise

def set_super_read_only_off(conn_dict):super_read_only_off = '''set global super_read_only = 0;'''execute_noquery(conn_dict, super_read_only_off)

def open_group_replication_bootstrap_group(conn_dict):sql = '''select variable_name,variable_value from performance_schema.global_variables where variable_name = 'group_replication_bootstrap_group';'''result = execute_query(conn_dict, sql)open_bootstrap_group_sql = '''set @@global.group_replication_bootstrap_group=on;'''if result and result[0]['variable_value']=="OFF":execute_noquery(conn_dict, open_bootstrap_group_sql)

def close_group_replication_bootstrap_group(conn_dict):sql = '''select variable_name,variable_value from performance_schema.global_variables where variable_name = 'group_replication_bootstrap_group';'''result = execute_query(conn_dict, sql)close_bootstrap_group_sql = '''set @@global.group_replication_bootstrap_group=off;'''if result and result[0]['variable_value'] == "ON":execute_noquery(conn_dict, close_bootstrap_group_sql)

def start_group_replication(conn_dict):start_group_replication = '''start group_replication;'''group_replication_status = get_group_replication_status(conn_dict)if not (group_replication_status[0]['MEMBER_STATE'] == 'ONLINE'):execute_noquery(conn_dict, start_group_replication)

def connect_to_group(conn_dict,repl_user,repl_password):connect_to_group_sql = '''change master to master_user='{0}', master_password='{1}' for channel 'group_replication_recovery'; '''.format(repl_user,repl_password)try:execute_noquery(conn_dict, connect_to_group_sql)except:raise

def start_mgr_on_master(conn_master_dict,repl_user,repl_password):try:set_super_read_only_off(conn_master_dict)reset_master(conn_master_dict)create_mgr_repl_user(conn_master_dict,repl_user,repl_password)connect_to_group(conn_master_dict,repl_user,repl_password)

    open_group_replication_bootstrap_group(conn_master_dict)    start_group_replication(conn_master_dict)    close_group_replication_bootstrap_group(conn_master_dict)    group_replication_status = get_group_replication_status(conn_master_dict)    if (group_replication_status[0]['MEMBER_STATE'] == 'ONLINE'):        print("master added in mgr and run successfully")        return Trueexcept:    raiseprint("############start master mgr error################")exit(1)

def start_mgr_on_slave(conn_slave_dict,repl_user,repl_password):try:set_super_read_only_off(conn_slave_dict)reset_master(conn_slave_dict)connect_to_group(conn_slave_dict,repl_user,repl_password)start_group_replication(conn_slave_dict)

wait for 10

    time.sleep(10)    # then check mgr status    group_replication_status = get_group_replication_status(conn_slave_dict)    if (group_replication_status[0]['MEMBER_STATE'] == 'ONLINE'):        print("slave added in mgr and run successfully")    if (group_replication_status[0]['MEMBER_STATE'] == 'RECOVERING'):        print("slave is recovering")except:    print("############start slave mgr error################")    exit(1)

def auto_mgr(conn_master,conn_slave_1,conn_slave_2,repl_user,repl_password):install_group_replication_plugin(conn_master)master_replication_status = get_group_replication_status(conn_master)

if not (master_replication_status[0]['MEMBER_STATE'] == 'ONLINE'):    start_mgr_on_master(conn_master,repl_user,repl_password)slave1_replication_status = get_group_replication_status(conn_slave_1)if not (slave1_replication_status[0]['MEMBER_STATE'] == 'ONLINE'):    install_group_replication_plugin(conn_slave_1)    start_mgr_on_slave(conn_slave_1, repl_user, repl_user)slave2_replication_status = get_group_replication_status(conn_slave_2)if not (slave2_replication_status[0]['MEMBER_STATE'] == 'ONLINE'):    install_group_replication_plugin(conn_slave_2)    start_mgr_on_slave(conn_slave_2, repl_user, repl_user)check_replication_group_members(conn_master)

if name == 'main':conn_master = {'host': '127.0.0.1', 'port': 7001, 'user': 'root', 'password': 'root', 'db': 'mysql', 'charset': 'utf8mb4'}conn_slave_1 = {'host': '127.0.0.1', 'port': 7002, 'user': 'root', 'password': 'root', 'db': 'mysql', 'charset': 'utf8mb4'}conn_slave_2 = {'host': '127.0.0.1', 'port': 7003, 'user': 'root', 'password': 'root', 'db': 'mysql', 'charset': 'utf8mb4'}repl_user = "repl"repl_password = "repl"

auto_mgr(conn_master,conn_slave_1,conn_slave_2,repl_user,repl_password)

auto_fix_mgr_error(conn_master,conn_slave_1)check_replication_group_members(conn_master)

以上就是MySQL MGR集群单主模式的自动搭建和自动化故障修复的详细内容,更多请关注创想鸟其它相关文章!

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 chuangxiangniao@163.com 举报,一经查实,本站将立刻删除。
发布者:程序猿,转转请注明出处:https://www.chuangxiangniao.com/p/814295.html

赞 (0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
Linux strings命令的时间复杂度
上一篇 2025年11月27日 00:19:43
开发一个金融CRM系统难不难?
下一篇 2025年11月27日 00:19:53

相关推荐

  • 国内AI工具权威排名 十大国产人工智能应用解析

    国内AI工具权威排名 十大国产人工智能应用解析国内AI工具权威排名 十大国产人工智能应用解析国内AI工具权威排名 十大国产人工智能应用解析国内AI工具权威排名 十大国产人工智能应用解析

    要选择适合自己的国产ai工具,首先需明确需求,再根据易用性、功能性、性价比、社区支持和数据安全等五个方面进行评估。图像处理方面,推荐“稿定设计”和百度ai开放平台api;自然语言处理方面,有“秘塔写作猫”、百度翻译和有道翻译等;代码生成方面,阿里云的“通义灵码”具有较大潜力。国内ai工具发展迅速,应…

    2026年9月27日 • 用户投稿
    400
  • linux shell命令if怎么写

    linux shell命令if怎么写linux shell命令if怎么写linux shell命令if怎么写linux shell命令if怎么写

    Linux Shell 中的 if 命令通过检查条件来执行特定命令。条件可以是文件存在、字符串比较或布尔表达式。如果条件为真,则执行 then 后面的命令;否则,执行 fi 后面的命令。 Linux Shell 命令 if 的用法 if 语句的语法 `if [ 条件 ]; then 命令 fi` 其…

    2026年9月27日 • 用户投稿
    000
  • sublime许可证密钥是什么_sublime正版激活密钥获取方式

    sublime许可证密钥是什么_sublime正版激活密钥获取方式sublime许可证密钥是什么_sublime正版激活密钥获取方式sublime许可证密钥是什么_sublime正版激活密钥获取方式sublime许可证密钥是什么_sublime正版激活密钥获取方式

    Sublime Text可免费试用但官方建议购买授权。需通过官网支付99美元获取正版密钥,激活后去除提醒且支持多设备。网络流传密钥有封禁与安全风险,不推荐使用。购买的许可证永久有效,适用于当前大版本,新版本可能需额外付费。 Sublime Text 是一款广受欢迎的代码编辑器,以其轻量、快速和强大的…

    2026年9月27日 • 用户投稿
    200
  • linux集群ddos怎么使用

    linux集群ddos怎么使用linux集群ddos怎么使用linux集群ddos怎么使用linux集群ddos怎么使用

    使用 Linux 集群进行 DDoS 攻击需要五个步骤:准备集群、选择攻击工具、设置攻击目标、分布式攻击和监控攻击。这些攻击通过向目标发送大量流量使其不堪重负,可能导致法律后果和损害目标的声誉。防御 DDoS 攻击需要多层防御措施。 如何使用 Linux 集群进行 DDoS 攻击 DDoS(分布式拒…

    2026年9月27日 • 用户投稿
    100
  • mysql中的asc是什么意思 mysql排序asc用法解析

    在mysql中,asc是指升序排序。1. asc代表”ascending”,用于将查询结果按指定列从小到大排序。2. 适用于数字、字符串和日期,字符串按字典顺序,日期按时间顺序。3. 使用索引可以优化排序性能。使用asc可以有效组织和展示数据,但需注意优化和调试。 在MySQ…

    2026年9月27日
    100
  • linux怎么查看进程状态

    linux怎么查看进程状态linux怎么查看进程状态linux怎么查看进程状态linux怎么查看进程状态

    答案: 通过使用 ps、top、pstree、cat /proc/[PID]/status 等命令,可以在 Linux 中查看进程状态。ps 命令可显示进程的基本信息,包括 PID 和 CPU 使用率。top 命令提供一个交互式界面,持续更新进程信息,如 CPU 使用率和内存使用率。pstree 命…

    2026年9月27日 • 用户投稿
    000
  • Perplexity AI如何进行学术不端检测 Perplexity AI论文抄袭分析

    Perplexity AI如何进行学术不端检测 Perplexity AI论文抄袭分析Perplexity AI如何进行学术不端检测 Perplexity AI论文抄袭分析Perplexity AI如何进行学术不端检测 Perplexity AI论文抄袭分析Perplexity AI如何进行学术不端检测 Perplexity AI论文抄袭分析

    Perplexity AI 可以作为一种辅助工具,帮助用户对文本进行初步的学术不端分析,尤其是查找与特定文本片段相关的已知来源。 本文将指导您如何利用 Perplexity AI 的搜索和信息整合能力,来帮助您分析论文或文本的潜在抄袭风险。我们将通过分步骤的方式,详细讲解如何输入待分析的文本、如何提…

    2026年9月27日 • 用户投稿
    000
  • 双系统电脑中,其中一个系统感染病毒,会传染给另一个吗?

    双系统电脑中,其中一个系统感染病毒,会传染给另一个吗?双系统电脑中,其中一个系统感染病毒,会传染给另一个吗?双系统电脑中,其中一个系统感染病毒,会传染给另一个吗?双系统电脑中,其中一个系统感染病毒,会传染给另一个吗?

    双系统中病毒通常不会直接传染另一系统,因运行时隔离使病毒难以跨平台执行。1. 病毒无法在非目标系统运行,如Windows病毒不能在Linux执行;2. 共享分区可能成为传播桥梁,若被感染文件存于共享区,切换系统后可能被触发;3. UEFI/BIOS或启动加载器遭攻击可影响双系统,但极为罕见;4. 防…

    2026年9月27日 • 用户投稿
    100
  • Claude 接管人类电脑 12 小时:学会摸鱼,敲着敲着代码看风景去了

    Claude 接管人类电脑 12 小时:学会摸鱼,敲着敲着代码看风景去了Claude 接管人类电脑 12 小时:学会摸鱼,敲着敲着代码看风景去了Claude 接管人类电脑 12 小时:学会摸鱼,敲着敲着代码看风景去了Claude 接管人类电脑 12 小时:学会摸鱼,敲着敲着代码看风景去了

    新版 claude 3.5 可以像人一样使用计算机,可把咱人类给兴奋坏了! 毕竟,这意味着新竞赛的开始:AI 不再只盯着对话和生成能力,更强调执行和操作。 不到 12 小时,激动的网友们已经纷纷贡献出自己是怎么看着 Claude 玩电脑的。 在 Anthropic 的发布公告中,还有这样一段引起了大…

    2026年9月27日 • 用户投稿
    100
  • Maestro函数确定性修改技巧

    Maestro函数确定性修改技巧Maestro函数确定性修改技巧Maestro函数确定性修改技巧Maestro函数确定性修改技巧

    首先打开SQL Maestro程序,并建立与MySQL数据库的连接。 在主界面中找到并点击“数据库浏览器”菜单项,即可展开数据库对象树形结构。 从数据库列表中选择目标数据库,确保已成功连接到正确的数据源。 在数据库浏览器中定位到函数对象,准备进行后续操作。 图改改 在线修改图片文字 455 查看详情…

    2026年9月27日 • 用户投稿
    100
  • sublime怎么设置git为默认的core.editor_sublime设置Git默认编辑器方法

    sublime怎么设置git为默认的core.editor_sublime设置Git默认编辑器方法sublime怎么设置git为默认的core.editor_sublime设置Git默认编辑器方法sublime怎么设置git为默认的core.editor_sublime设置Git默认编辑器方法sublime怎么设置git为默认的core.editor_sublime设置Git默认编辑器方法

    首先确认Sublime Text已添加到系统路径并可通过subl命令启动,然后运行git config –global core.editor “subl -n -w”将其设为默认编辑器,最后通过git config –get core.editor验…

    2026年9月27日 • 用户投稿
    100
  • 控制 JScrollPane 滚动条自动更新行为详解

    控制 JScrollPane 滚动条自动更新行为详解控制 JScrollPane 滚动条自动更新行为详解控制 JScrollPane 滚动条自动更新行为详解控制 JScrollPane 滚动条自动更新行为详解

    本教程将深入探讨如何有效控制 JScrollPane 的滚动条自动更新行为,特别是在内容动态变化时保持滚动条位置不变。通过设置滚动条策略为 NEVER,开发者可以阻止 JScrollPane 自动调整其水平或垂直滚动条的值,从而实现对滚动行为的精确控制,避免不必要的UI跳动,提升用户体验。 JScr…

    2026年9月27日 • 用户投稿
    100
  • 多模态AI如何处理工业CT扫描 多模态AI三维重建技术

    多模态AI如何处理工业CT扫描 多模态AI三维重建技术多模态AI如何处理工业CT扫描 多模态AI三维重建技术多模态AI如何处理工业CT扫描 多模态AI三维重建技术多模态AI如何处理工业CT扫描 多模态AI三维重建技术

    工业CT扫描能够提供物体内部结构的详细二维切片图像,但这些二维数据难以直观理解复杂的内部三维结构。传统的处理方法可能效率低下或难以应对数据中的噪声和伪影。多模态AI技术提供了一种强大的解决方案,它能够整合并分析来自CT扫描的丰富信息,从而实现高精度、高效率的三维重建。本文将介绍多模态AI如何处理工业…

    2026年9月27日 • 用户投稿
    100
  • linux查看进程是哪个程序

    linux查看进程是哪个程序linux查看进程是哪个程序linux查看进程是哪个程序linux查看进程是哪个程序

    使用 Linux 命令查看进程对应的程序:使用 “ps” 命令:ps -e -o comm=,显示所有进程的命令名称。使用 “/proc” 文件系统:cat /proc/PID/cmdline,其中 “PID” 是进程 ID,显…

    2026年9月27日 • 用户投稿
    100
  • 拼多多眼药水为啥那么便宜?这类商品有质量保证吗?拼多多眼药水便宜50%的秘密!是套路还是真划算?医生教你3招验真伪!

    拼多多眼药水为啥那么便宜?这类商品有质量保证吗?拼多多眼药水便宜50%的秘密!是套路还是真划算?医生教你3招验真伪!拼多多眼药水为啥那么便宜?这类商品有质量保证吗?拼多多眼药水便宜50%的秘密!是套路还是真划算?医生教你3招验真伪!拼多多眼药水为啥那么便宜?这类商品有质量保证吗?拼多多眼药水便宜50%的秘密!是套路还是真划算?医生教你3招验真伪!拼多多眼药水为啥那么便宜?这类商品有质量保证吗?拼多多眼药水便宜50%的秘密!是套路还是真划算?医生教你3招验真伪!

    一、拼多多眼药水价格低廉的三大核心原因 1. 供应链扁平化降低流通成本 拼多多实行“厂家直供+平台直营”模式,直接与药品生产商合作。相比传统销售链路中多层经销商不断加价,这种精简中间环节的供应方式可减少15%至30%的流通费用。 2. 平台补贴政策持续发力 依托百亿补贴专项支持,平台对医疗健康品类进…

    2026年9月27日 • 用户投稿
    200
  • Java Stream API处理嵌套对象字段求和:以购物车条目为例

    Java Stream API处理嵌套对象字段求和:以购物车条目为例Java Stream API处理嵌套对象字段求和:以购物车条目为例Java Stream API处理嵌套对象字段求和:以购物车条目为例Java Stream API处理嵌套对象字段求和:以购物车条目为例

    本文深入探讨如何利用Java Stream API高效地对复杂嵌套对象中的数值字段进行聚合求和。通过一个购物车条目的具体案例,演示了如何从多层级对象中提取并累加BigDecimal类型的费用数据,强调了mapToDouble、BigDecimal的精确计算以及在处理可能为空的字段时,结合注解进行nu…

    2026年9月27日 • 用户投稿
    100
  • Stripe Webhook签名验证错误解析与中间件顺序优化

    Stripe Webhook签名验证错误解析与中间件顺序优化Stripe Webhook签名验证错误解析与中间件顺序优化Stripe Webhook签名验证错误解析与中间件顺序优化Stripe Webhook签名验证错误解析与中间件顺序优化

    Stripe Webhook签名验证时出现”Payload must be provided as a string or a Buffer”错误,通常是由于Express应用中全局express.json()中间件过早解析了原始请求体。本文将深入解析此问题,并提供通过调整中…

    2026年9月27日 • 用户投稿
    100
  • OpenAI 推出全新 AI 功能 ChatGPT Pulse

    OpenAI 推出全新 AI 功能 ChatGPT PulseOpenAI 推出全新 AI 功能 ChatGPT PulseOpenAI 推出全新 AI 功能 ChatGPT PulseOpenAI 推出全新 AI 功能 ChatGPT Pulse

    openai 宣布上线全新功能 chatgpt pulse,标志着 chatgpt 正式从被动响应式对话工具进化为具备主动服务能力的个性化助手。该功能目前以预览版本的形式率先登陆移动端,仅对 pro 订阅用户(每月 200 美元)开放使用权限。 据官方介绍,Pulse 是 ChatGPT 全新打造的…

    2026年9月27日 • 用户投稿
    200
  • windows怎么查看电脑支持的内存大小 windows查看电脑最大支持内存方法

    windows怎么查看电脑支持的内存大小 windows查看电脑最大支持内存方法windows怎么查看电脑支持的内存大小 windows查看电脑最大支持内存方法windows怎么查看电脑支持的内存大小 windows查看电脑最大支持内存方法windows怎么查看电脑支持的内存大小 windows查看电脑最大支持内存方法

    首先通过命令提示符输入wmic memphysical get maxcapacity获取主板最大支持内存,再结合CPU-Z等工具或官网规格确认具体参数,最后用任务管理器查看插槽使用情况以规划升级方案。 如果您计划升级电脑内存,但不确定主板或系统最大支持多大的内存容量,则需要准确查询硬件的限制。以下…

    2026年9月27日 • 用户投稿
    200
  • sublime怎么设置在按下回车时自动缩进_sublime按回车自动缩进设置

    sublime怎么设置在按下回车时自动缩进_sublime按回车自动缩进设置sublime怎么设置在按下回车时自动缩进_sublime按回车自动缩进设置sublime怎么设置在按下回车时自动缩进_sublime按回车自动缩进设置sublime怎么设置在按下回车时自动缩进_sublime按回车自动缩进设置

    确保”auto_indent”: true已启用,使新行继承上一行缩进;2. 检查并正确设置文件语法类型,确保语言识别无误;3. 推荐配置”translate_tabs_to_spaces”: true和”tab_size”: …

    2026年9月27日 • 用户投稿
    300

发表回复

登录后才能评论
关注微信