达梦8 通过日志解释数据守护系统的关闭顺序

关闭守护系统时,必须按照一定的顺序来关闭守护进程和数据库实例。特别是自动切换 模式,如果退出守护进程或主备库的顺序不正确,可能会引起主备切换,甚至造成守护进程 DM 数据守护与读写分离集群组分裂。

官方推荐通过在监视器执行stop group命令关闭守护系统:

有时监视器里操作被认为不太方便,比如要login输入SYSDBA复杂的口令,而通过disql可以通过本地认证免密登录数据库。下面官方也推荐了disql操作方式:

如上可见,为防止发生自动接管,首先需要先关停确认监视器。然后再关闭守护进程。守护进程的没有严格的关闭顺序。之所以先关闭备库的watcher,是考虑到操作方便。因为确认监视器往往部署在备机。之所以最后关闭主库的watcher,同样是为了操作方便。因为要随后停数据库是有严格顺序的,先停主,再停备。

为什么要先停主库,能不能先停备库?先停备库会导致主库由于归档发送失败导致短暂进入suspend状态,备库再次重启后需要进入一个恢复阶段。大多数情况系统会完美地处理上述问题,但不能排除极少数情况下发生异常。

下面通过日志观察备库关闭再启动,系统做了什么。

#关停备库的守护进程
[dmdba@node2 bin]$ ./DmWatcherServiceTEST2 stop
Stopping DmWatcherServiceTEST2:                            [ OK ]#关停备库。之所以先关守护进程,是防止备库自动被守护进程重新拉起
[dmdba@node2 bin]$ ./DmServiceTEST2 stop
Stopping DmServiceTEST2:                                   [ OK ]#查看备库归档日志的LSN号
[dmdba@node2 bin]$ ./dmrachk arch_path=/home/dmdba/dmarch
rachk V8
the database pmnt_magic: 1859674653
the database db_magic: 1291794688
/*******************************************************************/
archive file /home/dmdba/dmarch/STANDBY_ARCHIVE_0x25335316_EP0_2024-06-23_01-43-11.log itemize.
version        : 0x7007
status         : INACTIVE
enc_flag       : FALSE
n_rpkgs        : 22
pmnt_magic     : 1859674653
db_magic       : 1291794688
src_db_magic   : 624120598
arch_lsn       : 1724574716
arch_seq       : 1430505
clsn           : 1724574737
next_seq       : 1430526
g_next_seq     : 1430526
file len       : 15360
file free      : 15360
dsc seqno      : 0
dsc node       : 1
create time    : 2024-06-23 01:43:11.914690 time_zone:+08:00
close time     : 2024-06-23 01:43:12.061566 time_zone:+08:00
llog first time     : 1900-01-01 00:00:00.000000 time_zone:+08:00
llog last time      : 1900-01-01 00:00:00.000000 time_zone:+08:00
/*******************************************************************/
/*******************************************************************/
archive file /home/dmdba/dmarch/STANDBY_ARCHIVE_0x25335316_EP0_2024-06-23_01-43-12.log itemize.
version        : 0x7007
status         : INACTIVE
enc_flag       : FALSE
n_rpkgs        : 32
pmnt_magic     : 1859674653
db_magic       : 1291794688
src_db_magic   : 624120598
arch_lsn       : 1724574738
arch_seq       : 1430527
clsn           : 1724574775
next_seq       : 1430558
g_next_seq     : 1430558
file len       : 21504
file free      : 21504
dsc seqno      : 0
dsc node       : 1
create time    : 2024-06-23 01:43:12.562146 time_zone:+08:00
close time     : 2024-06-23 01:44:49.847657 time_zone:+08:00
llog first time     : 1900-01-01 00:00:00.000000 time_zone:+08:00
llog last time      : 1900-01-01 00:00:00.000000 time_zone:+08:00
/*******************************************************************/The SUMMARY(seqno[0]):
total files: 2
okey files: 2
fail file: 0
repeat file: 0the rachk tool running cost 0.869 ms, code:0#启动守护进程,备库自动拉起
[dmdba@node2 bin]$ ./DmWatcherServiceTEST2 start
Starting DmWatcherServiceTEST2:                            [ OK ]

下面查看主库日志

日志内容比较多,节选几个关键部分

向备库发送实时归档(lsn:1724574777)失败,节点切换为SUSPEND状态,守护进程状态修改为DW_FAILOVER状态。

2024-06-23 01:44:47.931 [ERROR] database P0000001104 T0000000000000001518  [mal recv for arch] mal receive from site(TEST2) success, but site(TEST2) apply failed, begin lsn:1724574777, end lsn:1724574777, code:-518
2024-06-23 01:44:47.931 [ERROR] database P0000001104 T0000000000000001518  send realtime archive to instance[TEST2] failed, code = -518, begin_lsn = 1724574777, end_lsn = 1724574777!
2024-06-23 01:44:47.931 [INFO] database P0000001104 T0000000000000001518  Send archive log to remote instance failed, switch all ep to SUSPEND status success!
2024-06-23 01:44:49.934 [INFO] database P0000001104 T0000000000000001554  utsk_cmd_add, cmd info: cmd=217, dseq=1719099861, name_in=, begin_lsn=-1!
2024-06-23 01:44:49.934 [INFO] database P0000001104 T0000000000000001554  utsk_set_global_dw_stat, begin, msg_dseq:1719099861
2024-06-23 01:44:49.934 [INFO] database P0000001104 T0000000000000001554  set g_dw_stat from NONE to DW_FAILOVER success, g_dw_recover_stop is 0
2024-06-23 01:44:49.934 [INFO] database P0000001104 T0000000000000001554  utsk_set_global_dw_stat, finished, msg_dseq:1719099861, set code:0

归档状态修改为INVALID状态,保证后续数据库open后不再传输实时归档。

数据库恢复为open,业务数据可以继续写入(RLOG)

守护进程状态由FAILOVER恢复为NONE

2024-06-23 01:44:50.936 [INFO] database P0000001104 T0000000000000001558  Change TEST2 arch status from VALID to INVALID
2024-06-23 01:44:50.936 [INFO] database P0000001104 T0000000000000001554  utsk_cmd_add, received sql exec cmd:1, dseq:1719099863, sql:ALTER DATABASE OPEN FORCE
2024-06-23 01:44:50.936 [INFO] database P0000001104 T0000000000000001554  utsk_cmd_add, cmd info: cmd=1, dseq=1719099863, name_in=, begin_lsn=-1!
2024-06-23 01:44:50.936 [INFO] database P0000001104 T0000000000000001554  pha_altdb_open_for_dw alter database open start...
2024-06-23 01:44:50.936 [INFO] database P0000001104 T0000000000000001554  pha_altdb_open_for_dw, altdb set changing end!
2024-06-23 01:44:50.936 [INFO] database P0000001104 T0000000000000001554  altdb open rlog_flush_notify_ex start!
2024-06-23 01:44:50.936 [INFO] database P0000001104 T0000000000000001554  altdb open rlog_flush_notify_ex end!
2024-06-23 01:44:50.936 [INFO] database P0000001104 T0000000000000001554  pha_altdb_open_for_dw alter database open success!
2024-06-23 01:44:50.936 [INFO] database P0000001104 T0000000000000001559  total 0 active crash trx, pseg_crash_trx_rollbacksys_only(0) begin ...
2024-06-23 01:44:50.937 [INFO] database P0000001104 T0000000000000001559  pseg_crash_trx_rollback end, total 0 active crash trx, include 0 empty_trxs, 0 empty_pages which only need to delete mgr recs.
2024-06-23 01:44:50.937 [INFO] database P0000001104 T0000000000000001559  pseg_crash_trx_rollback end
2024-06-23 01:44:50.937 [INFO] database P0000001104 T0000000000000001559  hpc_clear_active_trx adjust n_crash_active_trx from 0 to 0.
2024-06-23 01:44:51.938 [INFO] database P0000001104 T0000000000000001554  utsk_cmd_add, cmd info: cmd=217, dseq=1719099864, name_in=, begin_lsn=-1!
2024-06-23 01:44:51.938 [INFO] database P0000001104 T0000000000000001554  utsk_set_global_dw_stat, begin, msg_dseq:1719099864
2024-06-23 01:44:51.938 [INFO] database P0000001104 T0000000000000001554  set g_dw_stat from DW_FAILOVER to NONE success, g_dw_recover_stop is 0
2024-06-23 01:44:51.938 [INFO] database P0000001104 T0000000000000001554  utsk_set_global_dw_stat, finished, msg_dseq:1719099864, set code:0

备库重启后,主库守护进程状态设置为DW_RECOVERY,准备异步传输归档

...
#连接备库失败
2024-06-23 01:47:46.577 [WARNING] database P0000001104 T0000000000000001507  MAL receive site(0) lost connect to site(1), ctl_handle(0), data_handle(0), dsc_handle(0)
2024-06-23 01:47:46.577 [WARNING] database P0000001104 T0000000000000001507  site(0) ctl_link mal_site_letter_recv from site(1) failed, socket handle = 0, mal sys status is 0, try to get mal_port again
2024-06-23 01:47:46.577 [WARNING] database P0000001104 T0000000000000001506  mal_site_tsk_check site(0) connect lost to site(1), socket handle = 0, mal sys status = 0, try get port again
2024-06-23 01:47:46.578 [INFO] database P0000001104 T0000000000000001506  send  CMD_MAL_LINK_CHECK(350): (mal_id:21784098, stmt_id:71964, mppexec_id:0, pln_op_id:65535, org_site :0, src_site:0, dest_site:1, build_time:-1)
2024-06-23 01:47:46.578 [INFO] database P0000001104 T0000000000000001506  send  CMD_MAL_LINK_CHECK(350): (mal_id:21784098, stmt_id:71966, mppexec_id:0, pln_op_id:65535, org_site :0, src_site:0, dest_site:1, build_time:4467)
#重新建立到备库的连接
2024-06-23 01:47:52.515 [INFO] database P0000001104 T0000000000000001514  mal_site_ctl_link_create startup from mal_site(0) to mal_site(1)!
2024-06-23 01:47:52.515 [INFO] database P0000001104 T0000000000000001514  mal_site_magic_gen site_magic[39959], src_site:0, dst_site:1
2024-06-23 01:47:52.515 [INFO] database P0000001104 T0000000000000001514  site[0] mal_site_ctl_port_set to site[1, IP: 192.168.100.101, port_num: 5800], socket handle = 52, site_magic = 39959
2024-06-23 01:47:52.515 [INFO] database P0000001104 T0000000000000001507  mal_site_port_get site_magic:39959, src_site:0, dst_site:1
2024-06-23 01:47:52.516 [INFO] database P0000001104 T0000000000000001506  mal_site_port_get site_magic:39959, src_site:0, dst_site:1
2024-06-23 01:47:52.523 [INFO] database P0000001104 T0000000000000001513  site[0] mal_site_data_port_set from site[1, IP: 192.168.100.101, port_num: 5800], socket handle = 53, site_magic = 39959
2024-06-23 01:47:52.523 [INFO] database P0000001104 T0000000000000001505  mal_site_port_get site_magic:39959, src_site:0, dst_site:1
2024-06-23 01:47:52.523 [INFO] database P0000001104 T0000000000000001508  mal_site_port_get site_magic:39959, src_site:0, dst_site:1
2024-06-23 01:47:53.293 [INFO] database P0000001104 T0000000000000001554  utsk_cmd_add, cmd info: cmd=217, dseq=1719099865, name_in=, begin_lsn=-1!
2024-06-23 01:47:53.293 [INFO] database P0000001104 T0000000000000001554  utsk_set_global_dw_stat, begin, msg_dseq:1719099865
#守护进程状态设置为DW_RECOVERY
2024-06-23 01:47:53.293 [INFO] database P0000001104 T0000000000000001554  set g_dw_stat from NONE to DW_RECOVERY success, g_dw_recover_stop is 0
#准备异步发送归档
2024-06-23 01:47:53.293 [INFO] database P0000001104 T0000000000000001554  rarch_set_async_send_info, reset total_rpkg and total_time_used.
2024-06-23 01:47:53.293 [INFO] database P0000001104 T0000000000000001554  utsk_set_global_dw_stat, reset all async send info success.
2024-06-23 01:47:53.293 [INFO] database P0000001104 T0000000000000001554  utsk_set_global_dw_stat, finished, msg_dseq:1719099865, set code:0
2024-06-23 01:47:54.347 [INFO] database P0000001104 T0000000000000001554  utsk_cmd_add, cmd info: cmd=210, dseq=1719099866, name_in=TEST2, begin_lsn=0!
2024-06-23 01:47:54.347 [INFO] database P0000001104 T0000000000000001557  utsk_cmd_exec, cmd:210, sys_status:OPEN, dseq:1719099866

开始异步归档

#备库(mal_site(1))1724574775最末重演日志序列号1430558,lsn1724574775
#注意:与dmrachk分析备库最后一个归档的next_seq和clsn相同
2024-06-23 01:47:54.356 [INFO] database P0000001104 T0000000000000001557  rarch_sync_process from mal_site(1): n_apply_ep=1, apply_seq_arr[0]=1430558, apply_lsn_arr[0]=1724574775
2024-06-23 01:47:54.357 [INFO] database P0000001104 T0000000000000001557  rarch_ep_init begin, dsc_seqno:0, begin_pkg_seqno:1430558, rfil:/u01/dm/dmarch/test/ARCHIVE_LOCAL1_0x25335316_EP0_2024-06-23_00-43-33.log!
2024-06-23 01:47:54.373 [INFO] database P0000001104 T0000000000000001557  rarch_ep_init, ep->prev_term_id change from 0 to 0.
2024-06-23 01:47:54.373 [INFO] database P0000001104 T0000000000000001557  rarch_ep_init, code:0, dsc_seqno:0, begin_pkg_seqno:1430558, load ep pkg info[db_magic:0x25335316, dsc_seqno:0, pkg_seqno:1430558, min_lsn:1724574775, max_lsn:1724574775], prev_term_id:0!
2024-06-23 01:47:54.373 [INFO] database P0000001104 T0000000000000001557  rarch_sync_process, begin to send arch, db_magic:0x25335316.                      2024-06-23 01:47:54.376 [INFO] database P0000001104 T0000000000000001557  Local arch send type to TEST2 change from 0 to 1, clear recent arch send info!
2024-06-23 01:47:54.533 [INFO] database P0000001104 T0000000000000001557  rarch_sync_process, ep_seqno[0]'s rlog_pkg send over!                             2024-06-23 01:47:54.533 [INFO] database P0000001104 T0000000000000001557  rarch_sync_process, all rlog_pkg send over, rarch_apply_wait!
2024-06-23 01:47:54.547 [INFO] database P0000001104 T0000000000000001557  rarch_sync_process, all rlog_pkg send over, rarch_apply_wait success, site_seq:1, reach_until_time:0!
2024-06-23 01:47:54.547 [INFO] database P0000001104 T0000000000000001557  rarch_local_arch_send to TEST2 finished, code=0, dseq=1719099866, max_arch_lsn=1724574841!
...

为保证可以追齐,传输一段归档后设置主库SUSPEND,禁止RLOG写入。

2024-06-23 01:47:54.927 [INFO] database P0000001104 T0000000000000001566  rarch_local_arch_send to TEST2 finished, code=0, dseq=1719099871, max_arch_lsn=1724574842!
2024-06-23 01:47:54.927 [INFO] database P0000001104 T0000000000000001554  utsk_cmd_add, received sql exec cmd:1, dseq:1719099872, sql:ALTER DATABASE SUSPEND
2024-06-23 01:47:54.927 [INFO] database P0000001104 T0000000000000001554  utsk_cmd_add, cmd info: cmd=1, dseq=1719099872, name_in=, begin_lsn=-1!
2024-06-23 01:47:54.927 [INFO] database P0000001104 T0000000000000001554  utsk_dw_sql, before enqueue, len:0, tsks:0
2024-06-23 01:47:54.927 [INFO] database P0000001104 T0000000000000001554  utsk_dw_sql, after enqueue, len:1, tsks:1
2024-06-23 01:47:54.927 [INFO] database P0000001104 T0000000000000001554  utsk_dw_sql:ALTER DATABASE SUSPEND put to task sys, sys_status:OPEN
2024-06-23 01:47:54.927 [INFO] database P0000001104 T0000000000000001568  utsk_cmd_exec, cmd:1, sys_status:OPEN, dseq:1719099872
2024-06-23 01:47:55.028 [INFO] database P0000001104 T0000000000000001568  alter database suspend success!
2024-06-23 01:47:55.028 [INFO] database P0000001104 T0000000000000001568  utsk_process_dw_sql_exec, prepare sql:ALTER DATABASE SUSPEND, code:0, dseq:1719099872

继续传输归档直至追齐

2024-06-23 01:47:55.029 [INFO] database P0000001104 T0000000000000001554  utsk_cmd_add, cmd info: cmd=210, dseq=1719099873, name_in=TEST2, begin_lsn=0!
2024-06-23 01:47:55.029 [INFO] database P0000001104 T0000000000000001569  utsk_cmd_exec, cmd:210, sys_status:SUSPEND, dseq:1719099873
2024-06-23 01:47:55.036 [INFO] database P0000001104 T0000000000000001569  rarch_sync_process from mal_site(1): n_apply_ep=1, apply_seq_arr[0]=1430623, apply_lsn_arr[0]=1724574842
2024-06-23 01:47:55.037 [INFO] database P0000001104 T0000000000000001569  rarch_ep_init begin, dsc_seqno:0, begin_pkg_seqno:1430623, rfil:/u01/dm/dmarch/test/ARCHIVE_LOCAL1_0x25335316_EP0_2024-06-23_00-43-33.log!
2024-06-23 01:47:55.054 [INFO] database P0000001104 T0000000000000001569  rarch_ep_init, ep->prev_term_id change from 0 to 0.
2024-06-23 01:47:55.054 [INFO] database P0000001104 T0000000000000001569  rarch_ep_init, code:0, dsc_seqno:0, begin_pkg_seqno:1430623, load ep pkg info[db_magic:0x25335316, dsc_seqno:0, pkg_seqno:1430623, min_lsn:1724574842, max_lsn:1724574842], prev_term_id:0!
2024-06-23 01:47:55.054 [INFO] database P0000001104 T0000000000000001569  rarch_sync_process, begin to send arch, db_magic:0x25335316.
2024-06-23 01:47:55.056 [INFO] database P0000001104 T0000000000000001569  rarch_sync_process, ep_seqno[0]'s rlog_pkg send over!
2024-06-23 01:47:55.056 [INFO] database P0000001104 T0000000000000001569  rarch_sync_process, all rlog_pkg send over, rarch_apply_wait!
2024-06-23 01:47:55.060 [INFO] database P0000001104 T0000000000000001569  rarch_sync_process, all rlog_pkg send over, rarch_apply_wait success, site_seq:1, reach_until_time:0!
2024-06-23 01:47:55.060 [INFO] database P0000001104 T0000000000000001569  rarch_local_arch_send to TEST2 finished, code=0, dseq=1719099873, max_arch_lsn=1724574842!
...

日志追齐后将路径状态恢复为VALID,保证后续开库后正常发送实时归档

主库准备open

2024-06-23 01:47:55.061 [INFO] database P0000001104 T0000000000000001554  utsk_cmd_add, cmd info: cmd=100, dseq=1719099874, name_in=, begin_lsn=-1!
2024-06-23 01:47:55.061 [INFO] database P0000001104 T0000000000000001567  utsk_cmd_exec, cmd:100, sys_status:SUSPEND, dseq:1719099874
2024-06-23 01:47:55.061 [INFO] database P0000001104 T0000000000000001567  Change TEST2 arch status from INVALID to VALID
2024-06-23 01:47:55.064 [INFO] database P0000001104 T0000000000000001567  Notify dest ep(1) set dw_stat_flag from DW_RECOVERY to NONE success.
2024-06-23 01:47:55.064 [INFO] database P0000001104 T0000000000000001567  utsk_process_mdw_chg_march, dseq:1719099874, code:0, op_flag:0, n_name:1, arch_status:VALID!
2024-06-23 01:47:55.064 [INFO] database P0000001104 T0000000000000001567  utsk_cmd_exec, utsk_process_mdw_chg_march success, sys_status:SUSPEND!
2024-06-23 01:47:55.064 [INFO] database P0000001104 T0000000000000001554  utsk_cmd_add, received sql exec cmd:1, dseq:1719099875, sql:ALTER DATABASE OPEN FORCE

数据库open完毕,守护进程状态由DW_RECOVERY切换为NONE

2024-06-23 01:47:55.064 [INFO] database P0000001104 T0000000000000001554  pha_altdb_open_for_dw alter database open start...                                2024-06-23 01:47:55.065 [INFO] database P0000001104 T0000000000000001554  pha_altdb_open_for_dw, altdb set changing end!                                    2024-06-23 01:47:55.065 [INFO] database P0000001104 T0000000000000001554  altdb open rlog_flush_notify_ex start!                                            2024-06-23 01:47:55.065 [INFO] database P0000001104 T0000000000000001554  altdb open rlog_flush_notify_ex end!                                              2024-06-23 01:47:55.065 [INFO] database P0000001104 T0000000000000001554  pha_altdb_open_for_dw alter database open success!                                2024-06-23 01:47:55.065 [INFO] database P0000001104 T0000000000000001570  total 0 active crash trx, pseg_crash_trx_rollbacksys_only(0) begin ...            2024-06-23 01:47:55.065 [INFO] database P0000001104 T0000000000000001570  pseg_crash_trx_rollback end, total 0 active crash trx, include 0 empty_trxs, 0 empty_pages which only need to delete mgr recs.                                                                                                                2024-06-23 01:47:55.065 [INFO] database P0000001104 T0000000000000001570  pseg_crash_trx_rollback end                                                       2024-06-23 01:47:55.065 [INFO] database P0000001104 T0000000000000001570  hpc_clear_active_trx adjust n_crash_active_trx from 0 to 0.                       2024-06-23 01:47:56.067 [INFO] database P0000001104 T0000000000000001554  utsk_cmd_add, cmd info: cmd=217, dseq=1719099876, name_in=, begin_lsn=-1!         2024-06-23 01:47:56.067 [INFO] database P0000001104 T0000000000000001554  utsk_set_global_dw_stat, begin, msg_dseq:1719099876                               2024-06-23 01:47:56.067 [INFO] database P0000001104 T0000000000000001554  set g_dw_stat from DW_RECOVERY to NONE success, g_dw_recover_stop is 0            2024-06-23 01:47:56.070 [INFO] database P0000001104 T0000000000000001554  Notify dest ep(TEST2) set dw_stat_flag from DW_RECOVERY to NONE success.          2024-06-23 01:47:56.070 [INFO] database P0000001104 T0000000000000001554  utsk_set_global_dw_stat, finished, msg_dseq:1719099876, set code:0                2024-06-23 01:47:57.588 [INFO] database P0000001104 T0000000000000001518  Local arch send type to TEST2 change from 1 to 0, clear recent arch send info!

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

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

相关文章

macbook配置adb环境和用adb操作安卓手机

(参考:ADB工具包的安装与使用_adb工具箱-CSDN博客) 第一步:从Android开发者网站下载Android SDK(软件开发工具包)。下载地址为: 第二步:解压下载的SDK压缩文件到某个目录中。 进入解…

现在的Android程序员为什么会感到焦虑?焦虑的源头在哪里?该怎么去缓解焦虑呢?——没有无中生有的贩卖焦虑,只有你的挣扎和不甘。

二、知识为何产生焦虑 先说两个世界,知识的世界和现实的世界。 知识的世界,由承载知识的那些载体组成,比如图书、音视频、报刊、自媒体等。 现实的世界,就是我们每天生活的、做出各种行为的世界。 学习的目的是什么呢&#xff1…

[spring] Spring MVC Thymeleaf(下)

[spring] Spring MVC & Thymeleaf(下) 上篇笔记讲了一下怎么使用 thymeleaf 作为 HTML 模板,与 Spring MVC 进行沟通,这里主要说一下验证的部分 常用表单验证 一些 Spring MVC 内置的常用验证注解如下: Annota…

[面试题]MongoDB

[面试题]Java【基础】[面试题]Java【虚拟机】[面试题]Java【并发】[面试题]Java【集合】[面试题]MySQL[面试题]Maven[面试题]Spring Boot[面试题]Spring Cloud[面试题]Spring MVC[面试题]Spring[面试题]MyBatis[面试题]Nginx[面试题]缓存[面试题]Redis[面试题]消息队列[面试题]…

uniapp运行到模拟器(联想模拟器)

记录一下uniapp项目运行到联想模拟器的流程 先配置一下模拟器端口 填写对应的adb路径,也就是模拟器安装路径下的adb.exe的路径 然后打开模拟器的设置,搜索版本找到版本号,多次点击打开开发者模式 进入开发者选项,打开USB调试 …

Android实战之app版本更新升级全文章(二)

BaseAndroid.checkUpdate(MainActivity.this, 2, “http://f5.market.mi-img.com/download/AppStore/0f4a347f5ce5a7e01315dda1ec35944fa56431d44/luo.footprint.apk”, “更新了XXX\n修复OOO”, false); 看看效果图 界面有点丑,自己修改下吧 当然啦&#xff0c…

Golang | Leetcode Golang题解之第167题两数之和II-输入有序数组

题目&#xff1a; 题解&#xff1a; func twoSum(numbers []int, target int) []int {low, high : 0, len(numbers) - 1for low < high {sum : numbers[low] numbers[high]if sum target {return []int{low 1, high 1}} else if sum < target {low} else {high--}}r…

Ubuntu系统通过GRUB引导菜单进入恢复模式修改账户密码

当在Ubuntu系统中忘记了账户密码时&#xff0c;有几种方法可以破解或重置密码。 本指引文档方法&#xff1a;通过GRUB引导菜单进入恢复模式 实践环境为&#xff1a;20.04.6 LTS (Focal Fossa) 1. 重启Ubuntu系统&#xff1a;首先&#xff0c;你需要重启你的Ubuntu系统。 2. …

Redis 7.x 系列【3】多种连接方式

有道无术&#xff0c;术尚可求&#xff0c;有术无道&#xff0c;止于术。 本系列Redis 版本 7.2.5 源码地址&#xff1a;https://gitee.com/pearl-organization/study-redis-demo 文章目录 1. 概述2. Redis Cli3. 可视化管理工具3.1 Redis Insight3.2 RedisDesktopManager 4. …

Windows环境利用 OpenCV 中 CascadeClassifier 分类器识别人眼 c++

Windows环境中配置OpenCV 关于在Windows环境中配置opencv的说明&#xff0c;具体可以参考&#xff1a;VS2022 配置OpenCV开发环境详细教程。 CascadeClassifier 分类器 CascadeClassifier 是 OpenCV 库中的一个类&#xff0c;它用于实现一种快速的物体检测算法&#xff0c;称…

day41--Redis(三)高级篇之最佳实践

Redis高级篇之最佳实践 今日内容 Redis键值设计批处理优化服务端优化集群最佳实践 1、Redis键值设计 1.1、优雅的key结构 Redis的Key虽然可以自定义&#xff0c;但最好遵循下面的几个最佳实践约定&#xff1a; 遵循基本格式&#xff1a;[业务名称]:[数据名]:[id]长度不超过…

腾讯Hardcoder-Android通讯框架简介

APP 的功能和业务特性不依赖于该框架。 总而言之&#xff0c;由于Hardcoder是腾讯主导的&#xff0c;所以我们不用太担心兼容性问题&#xff0c;腾讯会和手机厂商进行洽谈并提供解决方案&#xff0c;并且目前已经支持Hardcoder框架的手机厂商有OPPO、vivo、华为、小米、三星、…

【C++】————类和对象(中)

作者主页&#xff1a; 作者主页 本篇博客专栏&#xff1a;C 创作时间 &#xff1a;2024年6月22日 一、类的6个默认成员函数 如果一个类中什么成员都没有&#xff0c;简称为空类。空类中什么都没有吗&#xff1f;并不是的&#xff0c;任何一个类在我们不写的情 况下&#x…

链接脚本文件入门介绍

本文框架 1. Why<为什么需要链接文件>2.What<是什么及组成>2.1 MEMORY介绍2.2 SECTIONS介绍 3.How<链接文件应用>3.1 定义特定字段3.2 将变量定义在指定段3.3 将变量定义在不同的段3.4 将变量定义在指定地址3.5 将函数定义在指定段3.6 将函数定义在指定地址 …

【PyQt5】python可视化开发:PyQt5介绍,开发环境搭建快速入门

✨✨ 欢迎大家来到景天科技苑✨✨ &#x1f388;&#x1f388; 养成好习惯&#xff0c;先赞后看哦~&#x1f388;&#x1f388; &#x1f3c6; 作者简介&#xff1a;景天科技苑 &#x1f3c6;《头衔》&#xff1a;大厂架构师&#xff0c;华为云开发者社区专家博主&#xff0c;…

IDEA 中 Maven 报错 Cannot resolve xxx(全网试完,亲测有效的方法汇总)

问题&#xff1a; pom中已经添加相关依赖&#xff0c;maven刷新也没有用&#xff0c;依旧是疯狂报错。 可能原因&#xff1a; 在IDEA中的pom文件中添加了依赖&#xff0c;并且正确加载了相应依赖&#xff0c;pom文件没有报红&#xff0c;看起来像是把所有依赖库全部加载进来了&…

csp 2023 入门级题解(上)

csp 2023 入门级题解 上 第一题第二题第三题结构体联合体 第四题第五题第六题第7题第八题 第一题 unsigned是指无符号,用于int类型,是指自然数. const是定义常量,定义后的值不可修改. static是将系统栈中的变量放入内存,可以让其他程序调用 答案是c 第二题 答案d 第三题 s…

基于YOLOv5的PCB板缺陷检测系统的设计与实现

简介 随着电子设备的广泛应用,PCB(印刷电路板)作为其核心部件,其质量和可靠性至关重要。然而,PCB生产过程中常常会出现各种缺陷,如鼠咬伤、开路、短路、杂散、伪铜等。这些缺陷可能导致设备故障,甚至引发严重的安全问题。为了提高PCB检测的效率和准确性,我们基于YOLOv…

数组移除元素算法(以JS为例)

题目&#xff1a;LeeCode第27题 答案&#xff1a; 算法思想&#xff1a;双指针 这段代码实际上使用了一种简化版的双指针技术来实现元素的移除。这里的双指针技术并不是传统意义上的两个指针&#xff0c;而是一个索引k作为辅助指针&#xff0c;用来记录新数组&#xff08;或原…

Android 开发必备知识点及面试题汇总(Android+Java+算法+性能优化+四大组件……

**虚引用&#xff1a;**顾名思义&#xff0c;就是形同虚设&#xff0c;如果一个对象仅持有虚引用&#xff0c;那么它相当于没有引用&#xff0c;在任何时候都可能被垃圾回收器回收。 7.介绍垃圾回收机制 **标记回收法&#xff1a;**遍历对象图并且记录可到达的对象&#xff0c…