以太网链路聚合实验

一、实验目的

掌握使用手动模式配置链路聚合的方法

掌握使用静态 LACP 模式配置链路聚合的方法

掌握控制静态 LACP 模式下活动链路的方法

掌握静态 LACP 的部分特性的配置

二、实验环境

安装有eNSP模拟器的PC一台,要求PC能联网。

三、实验拓扑

LSW1与LSW2均为S3700交换机。

LSW1 与 LSW2之间的多条链路无法同时处于数据转发的状态。为了充分利用这些链路的带宽,需要在 LSW1 和 LSW2之间配置以太网链路聚合。

四、实验背景

随着网络规模不断扩大,用户对骨干链路的带宽和可靠性提出越来越高的要求。在传统技术中,常用更换高速率的接口板或更换支持高速率接口板的设备的方式来增加带宽,但这种方案需要付出高额的费用,而且不够灵活。
采用链路聚合技术可以在不进行硬件升级的条件下,通过将多个物理接口捆绑为一个逻辑接口,达到增加链路带宽的目的。

在实现增大带宽目的的同时,链路聚合采用备份链路的机制,可以有效的提高设备之间链路的可靠性。链路聚合技术主要有以下三个优势:

  • 增加带宽:链路聚合接口的最大带宽可以达到各成员接口带宽之和。
  • 提高可靠性:当某条活动链路出现故障时,流量可以切换到其他可用的成员链路上,从而提高链路聚合接口的可靠性。
  • 负载分担:在一个链路聚合组内,可以实现在各成员活动链路上的负载分担。

本实验将通过手工和 LACP 的方式配置以太网链路聚合,帮助了解以太网链路聚合技术的配置及原理。

五、实验过程

实验配置思路如下:

  • 配置手工模式链路聚合
  • 配置 LACP 模式链路聚合
  • 通过修改参数控制活动链路
  • 修改负载分担方式

LSW1的初始配置

# 进入系统视图
<Huawei>system-view # 为设备命名
[Huawei]sysname LSW1# 禁用信息中心
[LSW1]undo info-center enable 

LSW2的初始配置

# 进入系统视图
<Huawei>system-view # 为设备命名
[Huawei]sysname LSW2# 禁用信息中心
[LSW2]undo info-center enable 

5.1 配置手工模式链路聚合

5.1.1 创建Eth-Trunk接口

(1)配置LSW1

# 创建Eth-Trunk接口
[LSW1]interface Eth-Trunk 1

注:interface eth-trunk命令用来进入已经存在的 Eth-Trunk接口,或创建并进入 Eth-Trunk 接口。数字“1”代表接口编号,编号范围根据设备情况有所不同。

(2)配置LSW2

# 创建Eth-Trunk接口
[LSW2]interface Eth-Trunk 1

5.1.2 配置Eth-Trunk接口为聚合模式    

# 配置Eth-Trunk接口为聚合模式	
[LSW1-Eth-Trunk1]mode manual load-balance # 退出接口配置视图
[LSW1-Eth-Trunk1]quit

mode 命令用来配置 Eth-Trunk 的工作模式,Eth-Trunk 的工作模式包括 LACP 模式和手工负载分担模式(手工模式)两种。缺省情况下,Eth-Trunk 的工作模式为手工负载分担模式。这里针对LSW1的模式配置仅为示范目的,实际操作时不需要。

5.1.3 将成员接口加入聚合组

(1)在LSW1设备中,分别对三个连接的接口进行配置,将它们分别加入到聚合组Eth-Trunk1中来。

# 进入e0/0/1接口
[LSW1]interface Eth 0/0/1# 将该接口加入到eth-trunk 1
[LSW1-Ethernet0/0/1]eth-trunk 1# 退出接口配置视图
[LSW1-Ethernet0/0/1]quit# 进入e0/0/2接口
[LSW1]interface Eth 0/0/2# 将该接口加入到eth-trunk 1
[LSW1-Ethernet0/0/2]eth-trunk 1# 退出接口配置视图
[LSW1-Ethernet0/0/2]quit# 进入e0/0/3接口
[LSW1]interface Eth 0/0/3# 将该接口加入到eth-trunk 1
[LSW1-Ethernet0/0/3]eth-trunk 1# 退出接口配置视图
[LSW1-Ethernet0/0/3]quit

(2)在LSW2中,可同样执行上面的命令完成将三个接口加入到Eth-Trunk1聚合组,也可以通过trunkport命令批量添加接口。两种方式,任选其一即可。

# 进入聚合组接口的配置模式
[LSW2]interface Eth-Trunk 1# 批量将Eth 0/0/1、0/0/2和0/0/3添加聚合组中
[LSW2-Eth-Trunk1]trunkport eth 0/0/1 to 0/0/3# 退出接口配置模式
[LSW2-Eth-Trunk1]quit

注:将成员接口加入 Eth-Trunk 时,需要注意以下问题:

  • 每个 Eth-Trunk 接口下最多可以包含8个成员接口。
  • Eth-Trunk接口不能嵌套,即 Eth-Trunk接口的成员接口不能是 Eth-Trunk接口。
  • 一个以太网接口只能加入到一个 Eth-Trunk 接口,如果需要加入其它 Eth-Trunk 接口,必须先退出原来的 Eth-Trunk 接口。
  • 如果本地设备使用了 Eth-Trunk,与成员接口直连的对端接口也必须捆绑为 Eth-Trunk 接口,两端才能正常通信。
  • Eth-Trunk 链路两端相连的物理接口的数量、速率、双工方式等必须一致。

5.1.4 查看 Eth-Trunk接囗状态

在LSW1或者LSW2上执行【display eth-trunk 1】命令可以查看该聚合组中成员接口的状态。

# 查看聚合组eth-trunk 1的接口状态
[LSW1]display eth-trunk 1
Eth-Trunk1's state information is:
WorkingMode: NORMAL         Hash arithmetic: According to SIP-XOR-DIP         
Least Active-linknumber: 1  Max Bandwidth-affected-linknumber: 8              
Operate status: up          Number Of Up Port In Trunk: 3                     
--------------------------------------------------------------------------------
PortName                      Status      Weight 
Ethernet0/0/1                 Up          1      
Ethernet0/0/2                 Up          1      
Ethernet0/0/3                 Up          1 

5.2 配置LACP模式的链路聚合

5.2.1 删除现有的聚合组的成员接口

在LSW1上按顺序分别执行以下命令,删除 Eth-Trunk 1聚合组的成员接口。

# 进入聚合组的接口配置模式
[LSW1]interface Eth-Trunk 1# 批量删除聚合组的成员接口
[LSW1-Eth-Trunk1]undo trunkport Eth 0/0/1 to 0/0/3# 退出接口配置模式
[LSW1-Eth-Trunk1]quit

在LSW2上,执行以上同样的命令,删除 Eth-Trunk 1聚合组的成员接口。

# 进入聚合组的接口配置模式
[LSW2]interface Eth-Trunk 1# 批量删除聚合组的成员接口
[LSW2-Eth-Trunk1]undo trunkport Eth 0/0/1 to 0/0/3# 退出接口配置模式
[LSW2-Eth-Trunk1]quit

5.2.2 修改聚合模式

(1)修改LSW1的聚合模式

# 创建并进入Eth-Trunk 1聚合接口
[LSW1]interface Eth-Trunk 1# 将聚合模式指定为lacp
[LSW1-Eth-Trunk1]mode lacp-static # 退出接口配置模式
[LSW1-Eth-Trunk1]quit

(2)修改LSW2的聚合模式

# 创建并进入Eth-Trunk 1聚合接口
[LSW2]interface Eth-Trunk 1# 将聚合模式指定为lacp
[LSW2-Eth-Trunk1]mode lacp-static # 退出接口配置模式
[LSW2-Eth-Trunk1]quit

5.2.3 将成员接口加入聚合组

(1)为LSW1设备添加聚合组成员接口

# 进入Eth-Trunk 1聚合组的配置模式
[LSW1]interface Eth-Trunk 1# 批量添加聚合组的成员接口
[LSW1-Eth-Trunk1]trunkport Eth 0/0/1 to 0/0/3# 退出聚合组的配置模式
[LSW1-Eth-Trunk1]quit

(2)为LSW2设备添加聚合组成员接口

# 进入Eth-Trunk 1聚合组的配置模式
[LSW2]interface Eth-Trunk 1# 批量添加聚合组的成员接口
[LSW2-Eth-Trunk1]trunkport Eth 0/0/1 to 0/0/3# 退出聚合组的接口配置模式
[LSW2-Eth-Trunk1]quit

5.2.4 查看Eth-Trunk的接口状态

[LSW1]display eth-trunk 1
Eth-Trunk1's state information is:
Local:
LAG ID: 1                   WorkingMode: STATIC                               
Preempt Delay: Disabled     Hash arithmetic: According to SIP-XOR-DIP         
System Priority: 32768      System ID: 4c1f-cc2b-1fe8                         
Least Active-linknumber: 1  Max Active-linknumber: 8                          
Operate status: up          Number Of Up Port In Trunk: 3                     
--------------------------------------------------------------------------------
ActorPortName          Status   PortType PortPri PortNo PortKey PortState Weight
Ethernet0/0/1          Selected 100M     32768   2      289     10111100  1     
Ethernet0/0/2          Selected 100M     32768   3      289     10111100  1     
Ethernet0/0/3          Selected 100M     32768   4      289     10111100  1     Partner:
--------------------------------------------------------------------------------
ActorPortName          SysPri   SystemID        PortPri PortNo PortKey PortState
Ethernet0/0/1          32768    4c1f-cc8b-6bdb  32768   2      289     10111100
Ethernet0/0/2          32768    4c1f-cc8b-6bdb  32768   3      289     10111100
Ethernet0/0/3          32768    4c1f-cc8b-6bdb  32768   4      289     10111100

5.2.5 配置转发接口与备份接口

考虑到网络流量情况,当网络正常时,假定需求如下:

  • 只需要 Eth0/0/1 和Eth0/0/2接口处于转发状态,Eth0/0/3接口作为备份。
  • 但当活动接口数量少于2时,直接关闭整个Eth-Trunk接口。

为满足上述需求,可做如下配置:

(1)配置LSW1的LACP优先级,使其成为主动端设备

[LSW1]lacp priority 100

使能了 LACP 模式链路聚合的两端设备均会收发的 LACPDU 报文。

首先选举主动端设备:

  • 比较系统优先级字段,如果对端的系统优先级高于本端的系统优先级(默认为 32768,越小越优),则确定对端为 LACP 主动端。
  • 如果系统优先级相同,比较两端设备的 MAC地址,MAC地址小的一端为 LACP 主动端。

选出主动端后,两端都会以主动端的接口优先级来选择活动接口,接口优先级越小越优,默认为 32768。

(2)配置Eth-Trunk活动接口数下限阈值

[LSW1]interface Eth-Trunk 1# 指定聚合组活动接口数的最小值
[LSW1-Eth-Trunk1]least active-linknumber 2# 退出聚合组接口的配置模式
[LSW1-Eth-Trunk1]quit

在一个 Eth-Trunk 接口内,活动接口数可以影响到 Eth-Trunk接口的状态和带宽。Eth-Trunk接口的带宽是所有处于 Up 状态的成员接口带宽之和。

为保证 Eth-Trunk接口的状态和带宽,可以设置以下两个阈值,以减小成员链路状态的变化带来的影响。

  • 活动接口数下限阈值:当活动接口数小于配置的下限阈值时,Eth-Trunk 接口的状态转为Down。设置活动接口数下限阈值的目的是为了保证最小带宽。least active-linknumber 命令用来配置链路聚合组活动接口数目的下限阈值。
  • 活动接口数上限阈值:当活动接口数达到上限阈值后,之后再发生成员链路状态变为 Up都不会使 Eth-Trunk接口的带宽增加。设置活动接口数上限阈值的目的是在保证了带宽的情况下提高网络的可靠性。max active-linknumber 命令用来配置链路聚合组活动接口数目的上限阈值。模拟器当前版本不支持配置活动接口数上限阈值。

(3)查看当前Eth-Trunk接口状态

[LSW1]display eth-trunk 1
Eth-Trunk1's state information is:
Local:
LAG ID: 1                   WorkingMode: STATIC                               
Preempt Delay: Disabled     Hash arithmetic: According to SIP-XOR-DIP         
System Priority: 100        System ID: 4c1f-cc2b-1fe8                         
Least Active-linknumber: 2  Max Active-linknumber: 8                          
Operate status: up          Number Of Up Port In Trunk: 3                     
--------------------------------------------------------------------------------
ActorPortName          Status   PortType PortPri PortNo PortKey PortState Weight
Ethernet0/0/1          Selected 100M     32768   2      289     10111100  1     
Ethernet0/0/2          Selected 100M     32768   3      289     10111100  1     
Ethernet0/0/3          Selected 100M     32768   4      289     10111100  1     Partner:
--------------------------------------------------------------------------------
ActorPortName          SysPri   SystemID        PortPri PortNo PortKey PortState
Ethernet0/0/1          32768    4c1f-cc8b-6bdb  32768   2      289     10111100
Ethernet0/0/2          32768    4c1f-cc8b-6bdb  32768   3      289     10111100
Ethernet0/0/3          32768    4c1f-cc8b-6bdb  32768   4      289     10111100

从上面的接口状态可以看到,Eth-Trunk 1聚合组状态(Operate status)为up,最小活动接口数为2。

(4)手工关闭LSW1设备上的Eth 0/0/1和Eth 0/0/2,模拟链路故障

[LSW1]interface Eth0/0/1# 关闭接口
[LSW1-Ethernet0/0/1]shutdown# 退出接口配置模式
[LSW1-Ethernet0/0/1]quit[LSW1]interface Eth0/0/2# 关闭接口
[LSW1-Ethernet0/0/2]shutdown# 退出接口配置模式
[LSW1-Ethernet0/0/2]quit

(5)再次查看Eth-Trunk接口状态

[LSW1]display eth-trunk 1
Eth-Trunk1's state information is:
Local:
LAG ID: 1                   WorkingMode: STATIC                               
Preempt Delay: Disabled     Hash arithmetic: According to SIP-XOR-DIP         
System Priority: 100        System ID: 4c1f-cc2b-1fe8                         
Least Active-linknumber: 2  Max Active-linknumber: 8                          
Operate status: down        Number Of Up Port In Trunk: 0                     
--------------------------------------------------------------------------------
ActorPortName          Status   PortType PortPri PortNo PortKey PortState Weight
Ethernet0/0/1          Unselect 100M     32768   2      289     10100010  1     
Ethernet0/0/2          Unselect 100M     32768   3      289     10100010  1     
Ethernet0/0/3          Unselect 100M     32768   4      289     10100000  1     Partner:
--------------------------------------------------------------------------------
ActorPortName          SysPri   SystemID        PortPri PortNo PortKey PortState
Ethernet0/0/1          0        0000-0000-0000  0       0      0       10100011
Ethernet0/0/2          0        0000-0000-0000  0       0      0       10100011
Ethernet0/0/3          32768    4c1f-cc8b-6bdb  32768   4      289     10110000

从上面的接口状态可以看到,Eth-Trunk 1聚合组状态(Operate status)为down。这是由于设置了 Eth-Trunk 的活动链路下限阈值为 2,关闭两个接口后,聚合组中可用活动接口数量少于2 导致整个聚合组对应的接口将会被关闭。尽管此时 GE1/0/3 处于 UP 状态,但是仍处于 Unselect状态。

5.2.6 修改负载分担模式

(1)开启上一步中关闭的LSW1设备接口

[LSW1]interface eth 0/0/1[LSW1-Ethernet0/0/1]undo shutdown [LSW1-Ethernet0/0/1]quit[LSW1]interface eth 0/0/2[LSW1-Ethernet0/0/2]undo shutdown[LSW1-Ethernet0/0/2]quit

(2)修改Eth-Trunk接口的负载分担模式为基于目的IP地址

# 进入聚合组接口配置模式
[LSW1]interface Eth-Trunk 1# 指定负载分担模式为基于目的IP
[LSW1-Eth-Trunk1]load-balance dst-ip# 退出聚合组接口配置模式
[LSW1-Eth-Trunk1]quit

当需要将 Eth-Trunk 接口的流量分散到不同的链路上,最后能到达统一目的地时,使用 load-balance 命令配置 Eth-Trunk 接口负载分担模式,以确保出方向的流量在各物理链路间进行合理的负载分担,避免链路阻塞。

(3)查看LSW1的Eth-Trunk接口状态

[LSW1]display eth-trunk 1
Eth-Trunk1's state information is:
Local:
LAG ID: 1                   WorkingMode: STATIC                               
Preempt Delay: Disabled     Hash arithmetic: According to DIP                 
System Priority: 100        System ID: 4c1f-cc2b-1fe8                         
Least Active-linknumber: 2  Max Active-linknumber: 8                          
Operate status: up          Number Of Up Port In Trunk: 3                     
--------------------------------------------------------------------------------
ActorPortName          Status   PortType PortPri PortNo PortKey PortState Weight
Ethernet0/0/1          Selected 100M     32768   2      289     10111100  1     
Ethernet0/0/2          Selected 100M     32768   3      289     10111100  1     
Ethernet0/0/3          Selected 100M     32768   4      289     10111100  1     Partner:
--------------------------------------------------------------------------------
ActorPortName          SysPri   SystemID        PortPri PortNo PortKey PortState
Ethernet0/0/1          32768    4c1f-cc8b-6bdb  32768   2      289     10111100
Ethernet0/0/2          32768    4c1f-cc8b-6bdb  32768   3      289     10111100
Ethernet0/0/3          32768    4c1f-cc8b-6bdb  32768   4      289     10111100

从接口状态中的Hash arithmetic可知,此时LSW1的Eth-Trunk 1基于目的 IP 地址进行负载分担。

(4)查看LSW2的Eth-Trunk接口状态

[LSW2]display eth-trunk 1
Eth-Trunk1's state information is:
Local:
LAG ID: 1                   WorkingMode: STATIC                               
Preempt Delay: Disabled     Hash arithmetic: According to SIP-XOR-DIP         
System Priority: 32768      System ID: 4c1f-cc8b-6bdb                         
Least Active-linknumber: 1  Max Active-linknumber: 8                          
Operate status: up          Number Of Up Port In Trunk: 3                     
--------------------------------------------------------------------------------
ActorPortName          Status   PortType PortPri PortNo PortKey PortState Weight
Ethernet0/0/1          Selected 100M     32768   2      289     10111100  1     
Ethernet0/0/2          Selected 100M     32768   3      289     10111100  1     
Ethernet0/0/3          Selected 100M     32768   4      289     10111100  1     Partner:
--------------------------------------------------------------------------------
ActorPortName          SysPri   SystemID        PortPri PortNo PortKey PortState
Ethernet0/0/1          100      4c1f-cc2b-1fe8  32768   2      289     10111100
Ethernet0/0/2          100      4c1f-cc2b-1fe8  32768   3      289     10111100
Ethernet0/0/3          100      4c1f-cc2b-1fe8  32768   4      289     10111100

从接口状态中的Hash arithmetic可知,此时LSW2的Eth-Trunk 1负载分担模式为根据‌源IP地址(SIP)‌和目的IP地址(DIP)‌进行异或运算。

由于负载分担只对出方向的流量有效,因此链路两端接口的负载分担模式可以不一致,两端互不影响。

5.3 参考配置

完成上述配置后,LSW1和LSW2的配置详情如下。

5.3.1 LSW1的配置

[LSW1]display current-configuration 
#
sysname LSW1
#
undo info-center enable
#
lacp priority 100
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
diffserv domain default
#
drop-profile default
#
aaaauthentication-scheme defaultauthorization-scheme defaultaccounting-scheme defaultdomain defaultdomain default_adminlocal-user admin password simple adminlocal-user admin service-type http
#
interface Vlanif1
#
interface MEth0/0/1
#
interface Eth-Trunk1mode lacp-staticleast active-linknumber 2load-balance dst-ip
#
interface Ethernet0/0/1eth-trunk 1
#
interface Ethernet0/0/2eth-trunk 1
#
interface Ethernet0/0/3eth-trunk 1
#
interface Ethernet0/0/4
#
interface Ethernet0/0/5
#
interface Ethernet0/0/6
#
interface Ethernet0/0/7
#
interface Ethernet0/0/8
#
interface Ethernet0/0/9
#
interface Ethernet0/0/10
#
interface Ethernet0/0/11
#
interface Ethernet0/0/12
#
interface Ethernet0/0/13
#
interface Ethernet0/0/14
#
interface Ethernet0/0/15
#
interface Ethernet0/0/16
#
interface Ethernet0/0/17
#
interface Ethernet0/0/18
#
interface Ethernet0/0/19
#
interface Ethernet0/0/20
#
interface Ethernet0/0/21
#
interface Ethernet0/0/22
#
interface GigabitEthernet0/0/1
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
user-interface con 0
user-interface vty 0 4
#
return

5.3.2 LSW2的配置

[LSW2]display current-configuration 
#
sysname LSW2
#
undo info-center enable
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
diffserv domain default
#
drop-profile default
#
aaaauthentication-scheme defaultauthorization-scheme defaultaccounting-scheme defaultdomain defaultdomain default_adminlocal-user admin password simple adminlocal-user admin service-type http
#
interface Vlanif1
#
interface MEth0/0/1
#
interface Eth-Trunk1mode lacp-static
#
interface Ethernet0/0/1eth-trunk 1
#
interface Ethernet0/0/2eth-trunk 1
#
interface Ethernet0/0/3eth-trunk 1
#
interface Ethernet0/0/4
#
interface Ethernet0/0/5
#
interface Ethernet0/0/6
#
interface Ethernet0/0/7
#
interface Ethernet0/0/8
#
interface Ethernet0/0/9
#
interface Ethernet0/0/10
#
interface Ethernet0/0/11
#
interface Ethernet0/0/12
#
interface Ethernet0/0/13
#
interface Ethernet0/0/14
#
interface Ethernet0/0/15
#
interface Ethernet0/0/16
#
interface Ethernet0/0/17
#
interface Ethernet0/0/18
#
interface Ethernet0/0/19
#
interface Ethernet0/0/20
#
interface Ethernet0/0/21
#
interface Ethernet0/0/22
#
interface GigabitEthernet0/0/1
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
user-interface con 0
user-interface vty 0 4
#
return

思考题

配置 least active-linknumber 和 max active-linknumber 时,对两个参数大小有什么要求?

答案:Least active-linknumber 需要小于或等于 max active-linknumber。

参考文献

华为HCIA-Datacom V1.0 实验手册 (eNSP Pro)

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

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

相关文章

autMan安装教程

一、安装命令 如果你系统没安装docker&#xff0c;请看往期教程 以下为通用命令 docker run -d --name autman --restart always -p 8080:8080 -p 8081:8081 -v /root/autman:/autMan --log-opt max-size10m --log-opt max-file3 hdbjlizhe/autman:latest解释一下以上命令&…

【无人机】自检arming参数调整选项

检查项目 (英文名)中文含义检查内容四旋翼建议 (新手 → 老手)理由说明All所有检查启用下面所有的检查项目。✅ 强烈建议勾选这是最安全的设置&#xff0c;确保所有关键系统正常。Barometer气压计检查气压计是否健康、数据是否稳定。✅ 必须勾选用于定高模式&#xff0c;数据异…

数字图像处理(1)OpenCV C++ Opencv Python显示图像和视频

Open CV C显示图像#include <iostream> #include <opencv2/opencv.hpp> using namespace cv;//包含cv命名空间 int main() {//imread(path)&#xff1a;从给定路径读取一张图片&#xff0c;储存为Mat变量对象Mat img imread("images/love.jpg");//named…

【芯片设计-信号完整性 SI 学习 1.2.2 -- 时序裕量(Margin)】

文章目录1. 什么是时序裕量&#xff08;Margin&#xff09;1. 背景&#xff1a;为什么需要数字接口时序分析2. 时钟周期方程3. Setup 裕量 (tMARGIN_SETUP)4. Hold 裕量 (tMARGIN_HOLD)5. 设计注意事项6. 实际应用场景2. 时序裕量的来源3. 测试方法(1) 眼图测试 (Eye Diagram)(…

AOP 切面日志详细

在业务方法上打注解package com.lib.service;Service public class BookService {LogExecution(description "查询图书")public Book query(int id) {return repo.findById(id);}LogExecution(description "借阅图书")public void borrow(int id) {// 模…

使用paddlepaddle-Gpu库时的一个小bug!

起初安装的是 paddlepaddle 2.6.1版本。 用的是Taskflow的快速分词以及ner快速识别&#xff1a;​​​​​​​seg_accurate Taskflow("word_segmentation", mode"fast") ner Taskflow("ner", mode"fast")但是使用不了Gpu。想使用Gp…

量子能量泵:一种基于并联电池与电容阵的动态直接升压架构

量子能量泵&#xff1a;一种基于并联电池与电容阵的动态直接升压架构 摘要 本文提出了一种革命性的高效电源解决方案&#xff0c;通过创新性地采用并联电池组与串联高压电容阵相结合的架构&#xff0c;彻底解决了低电压、大功率应用中的升压效率瓶颈与电池一致性难题。该方案摒…

【Linux网络】网络基础概念——带你打开网络的大门

1. 计算机网络背景 文章目录1. 计算机网络背景网络发展2. 初识协议2.1 协议分层软件分层的好处2.2 OSI七层模型2.3 TCP/IP五层(或四层)模型网络发展 独立模式 独立模式是计算机网络发展的最初阶段&#xff0c;主要特点如下&#xff1a; 单机工作环境&#xff1a; 每台计算机完…

简单介绍一下Clickhouse及其引擎

一、ClickHouse 的优缺点一、ClickHouse 的优点 ✅ 1. 极致的查询性能 列式存储&#xff1a;只读取查询涉及的列&#xff0c;大幅减少 IO。数据压缩&#xff1a;常见压缩率 5~10 倍&#xff0c;减少存储和带宽消耗。向量化执行&#xff1a;按批次&#xff08;block&#xff09;…

【卷积神经网络详解与实例】8——经典CNN之VGG

1 开发背景 VGGNet是牛津大学视觉几何组(Visual Geometry Group)提出的模型&#xff0c;该模型在2014ImageNet图像分类与定位挑战赛 ILSVRC-2014中取得在分类任务第二&#xff0c;定位任务第一的优异成绩。其核心贡献在于系统性地探索了网络深度对性能的影响&#xff0c;并证明…

【分享】中小学教材课本 PDF 资源获取指南

很多人都不知道&#xff0c;其实官方提供的中小学教材课本 PDF 文档是完全免费且正版的&#xff0c;无需使用扫描版&#xff0c;清晰度和质量都非常高。 这些资源就藏在国家中小学智慧教育平台&#xff08;basic.smartedu.cn&#xff09;上。这个平台涵盖了从小学到高中的各个…

js趣味游戏 贪吃蛇

以下是关于JavaScript趣味游戏的系统性整理&#xff0c;涵盖经典案例、开发工具、教程资源及创意方向&#xff0c;助您快速掌握JS游戏开发的核心逻辑&#xff1a;一、经典JS趣味游戏案例贪吃蛇&#xff08;Snake Game&#xff09;核心机制&#xff1a;键盘控制蛇的移动方向&…

【Redis#11】Redis 在 C++ 客户端下的安装使用流程(一条龙服务)

一、安装使用 --Ubuntu 下启用 1. 前置依赖 - hiredis hiredis 是一个用 C 语言实现的 Redis 客户端库&#xff0c;redis-plus-plus 库基于 hiredis 实现。在开始之前&#xff0c;请确保已安装 libhiredis-dev&#xff0c;可以通过以下命令安装&#xff1a; sudo apt install l…

kibana+elasticsearch console查询示例

kibana console查询入口如下 http://localhost:5601/app/dev_tools#/console/shell 1 整体查询 获取index为newbook的所有数据 GET newbook/_search 2 通用查询 获取index为newbook的数据中&#xff0c;bookname包含“西游”的所有数据。 GET newbook/_search { "query&q…

软考系统架构设计师之软件风格篇

一、软件架构风格-数据流风格 数据-》第1步处理-》数据-》第2步处理-》数据-》第N步处理 【分步处理】 优点&#xff1a; 1、松耦合【高内聚-低耦合】 2、良好的重用性/可维护性; 3、可扩展性【标准接口适配】 4、良好的隐蔽性; 5、支持并行。 缺点 1、交互性较差; 2、复杂性较…

初始QML

由于项目原因&#xff0c;最近要进行qml相关开发&#xff0c;我之前也没有搞过qml&#xff0c;因此开一个qml系列的专栏&#xff0c;记录自己关于qml的相关学习新建第一个qml工程按如下图所示方法新建一个最简单的qml工程&#xff1a;编译运行可以看到是一个标题为“hello word…

Coze源码分析-资源库-创建知识库-基础设施/存储/安全

6. 基础设施层 基础设施层为知识库创建功能提供底层技术支撑&#xff0c;包括数据存储、缓存、消息队列、文档处理、向量化等核心服务。 6.1 数据存储服务 6.1.1 MySQL数据库 文件位置: backend/infra/rdb/mysql.go // MySQLConfig MySQL配置 type MySQLConfig struct {Host …

【iOS】设计模式复习

目录 观察者模式 通知机制 基本使用 注册观察者 创建一个通知 发送通知 通知与多线程 使用异步发送通知 NSNotificationQueue通知队列 在子线程中运行观察者函数 实现原理 named表 nameless表 wildcard表 添加观察者 发送通知 移除通知​ KVO机制 基本使用 …

RK3568 NPU :RKNN-ToolKit2环境搭建

1. 安装Miniconda3 下载 Linux 64 位 Miniconda 最新版安装脚本 wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh安装 Miniconda bash Miniconda3-latest-Linux-x86_64.sh -u安装完成后会自动设置环境变量。打开新的终端&#xff0c;发现用户名前…

Ubuntu 24.04 Server 版系统安装及配置

Ubuntu 24.04 Server 版安装及配置 文章目录Ubuntu 24.04 Server 版安装及配置一、获取安装文件二、虚拟机配置三、安装界面四、配置网络五、扩容根分区 一、获取安装文件二、虚拟机配置三、安装界面 选择English&#xff08;US&#xff09;问是否升级内核配置键盘手动配置ipv4…