使用docker轻量化部署snmp agent(SNMPv2访问)

news2025/1/20 6:02:49

文章目录

  • 服务器环境说明
  • 单机部署(非挂载conf文件版)
    • debian:buster-slim容器简介
    • 实现步骤
      • 创建Dockerfile
      • 创建SNMP配置文件 (snmpd.conf)
      • 构建Docker镜像
      • 运行Docker容器
    • 注意
    • 补充
      • 复制容器文件到本地
      • 容器、镜像操作
  • 单机部署(挂载conf文件版)
  • 批量部署
    • 说明
    • 创建Dockerfile
    • 创建SNMP配置文件 (snmpd.conf)
    • 构建Docker镜像
    • 编辑python脚本命令
    • 执行脚本
    • 启动所有服务
    • 批量删除命令

服务器环境说明

  • linux宿主系统为centos7
  • 提前安装docker环境,并注意配置国内镜像源
  • 推荐使用1panel管理面板进行可视化操作和容器管理
  • 记得关闭防火墙,简化操作
  • 项目源码地址

单机部署(非挂载conf文件版)

debian:buster-slim容器简介

  • Debian是一个流行的Linux发行版之一,而"Buster"是Debian的代号,用于代表其发布版本号的名称。"Slim"版本的Docker镜像是指一个精简过的、轻量级的Debian Buster镜像.
  • Debian Buster Slim镜像的主要特点包括:
    1. 精简尺寸: Slim版本的镜像相比标准版本会更小,删除一些不必要的软件包和组件。
    2. 最小化安装: 这些镜像通常只包含操作系统的核心组件和必要的软件,以最大程度地减少容器的大小和资源占用。
    3. 适合特定用途: 适合作为基础镜像用于构建应用程序或服务。由于其精简的特性,它们常用于需要高度可控和安全性的容器环境中。

实现步骤

创建Dockerfile

  • 创建一个Dockerfile,用于构建一个包含SNMP服务的Docker镜像。
# 使用Debian的slim版本作为基础镜像
FROM debian:buster-slim
# 设置清华大学TUNA镜像源
RUN sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list \
    && sed -i 's/security.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list \
    && apt-get update && apt-get install -y snmp snmpd

# 使用非自由软件包源(non-free repositories)来安装完整的MIB包
RUN sed -i 's/main/main non-free/' /etc/apt/sources.list \
    && apt-get update && apt-get install -y snmp-mibs-downloader

# 拷贝SNMPD配置文件到容器中
COPY snmpd.conf /etc/snmp/

# 开放161端口,SNMP标准端口
EXPOSE 161/udp

# 启动snmpd服务
CMD [ "snmpd", "-f", "-Lo" ]

创建SNMP配置文件 (snmpd.conf)

  • SNMP配置文件来配置snmpd服务,基于debian:buster-slim中默认snmp.conf文件修改而来,这里给出完整的内容,大家可以在此基础上进行完善和修改
###############################################################################
#
# EXAMPLE.conf:
#   An example configuration file for configuring the Net-SNMP agent ('snmpd')
#   See the 'snmpd.conf(5)' man page for details
#
#  Some entries are deliberately commented out, and will need to be explicitly activated
#
###############################################################################
#
#  AGENT BEHAVIOUR
#

#  Listen for connections from the local system only
#agentAddress  udp:127.0.0.1:161
#  Listen for connections on all interfaces (both IPv4 *and* IPv6)
#agentAddress udp:161,udp6:[::1]:161
agentAddress udp:161


###############################################################################
#
#  SNMPv3 AUTHENTICATION
#
#  Note that these particular settings don't actually belong here.
#  They should be copied to the file /var/lib/snmp/snmpd.conf
#     and the passwords changed, before being uncommented in that file *only*.
#  Then restart the agent

#  createUser authOnlyUser  MD5 "remember to change this password"
#  createUser authPrivUser  SHA "remember to change this one too"  DES
#  createUser internalUser  MD5 "this is only ever used internally, but still change the password"

#  If you also change the usernames (which might be sensible),
#  then remember to update the other occurances in this example config file to match.



###############################################################################
#
#  ACCESS CONTROL
#

#  system + hrSystem groups only
view   systemonly  included   .1.3.6.1.2.1.1
view   systemonly  included   .1.3.6.1.2.1.25.1

#  Full access from the local host
#rocommunity public  localhost
#  Default access to basic system info
rocommunity public  default    -V systemonly
#  rocommunity6 is for IPv6
rocommunity6 public  default   -V systemonly

 #  Full access from an example network
 #     Adjust this network address to match your local
 #     settings, change the community string,
 #     and check the 'agentAddress' setting above
#rocommunity secret  10.0.0.0/16

#  Full read-only access for SNMPv3
 rouser   authOnlyUser
#  Full write access for encrypted requests
#     Remember to activate the 'createUser' lines above
#rwuser   authPrivUser   priv

#  It's no longer typically necessary to use the full 'com2sec/group/access' configuration
#  r[ow]user and r[ow]community, together with suitable views, should cover most requirements



###############################################################################
#
#  SYSTEM INFORMATION
#

#  Note that setting these values here, results in the corresponding MIB objects being 'read-only'
#  See snmpd.conf(5) for more details
sysLocation    Sitting on the Dock of the Bay
sysContact     Me <me@example.org>
                                                 # Application + End-to-End layers
sysServices    72


#
#  Process Monitoring
#
# At least one  'mountd' process
proc  mountd
# No more than 4 'ntalkd' processes - 0 is OK
proc  ntalkd    4
# At least one 'sendmail' process, but no more than 10
proc  sendmail 10 1

#  Walk the UCD-SNMP-MIB::prTable to see the resulting output
#  Note that this table will be empty if there are no "proc" entries in the snmpd.conf file


#
#  Disk Monitoring
#
# 10MBs required on root disk, 5% free on /var, 10% free on all other disks
disk       /     10000
disk       /var  5%
includeAllDisks  10%

#  Walk the UCD-SNMP-MIB::dskTable to see the resulting output
#  Note that this table will be empty if there are no "disk" entries in the snmpd.conf file


#
#  System Load
#
# Unacceptable 1-, 5-, and 15-minute load averages
load   12 10 5

#  Walk the UCD-SNMP-MIB::laTable to see the resulting output
#  Note that this table *will* be populated, even without a "load" entry in the snmpd.conf file



###############################################################################
#
#  ACTIVE MONITORING
#

#   send SNMPv1  traps
trapsink     localhost public
#   send SNMPv2c traps
#trap2sink    localhost public
#   send SNMPv2c INFORMs
#informsink   localhost public

#  Note that you typically only want *one* of these three lines
#  Uncommenting two (or all three) will result in multiple copies of each notification.


#
#  Event MIB - automatically generate alerts
#
# Remember to activate the 'createUser' lines above
iquerySecName   internalUser       
rouser          internalUser
# generate traps on UCD error conditions
defaultMonitors          no
# generate traps on linkUp/Down
linkUpDownNotifications  yes



###############################################################################
#
#  EXTENDING THE AGENT
#

#
#  Arbitrary extension commands
#
 extend    test1   /bin/echo  Hello, world!
 extend-sh test2   echo Hello, world! ; echo Hi there ; exit 35
#extend-sh test3   /bin/sh /tmp/shtest

#  Note that this last entry requires the script '/tmp/shtest' to be created first,
#    containing the same three shell commands, before the line is uncommented

#  Walk the NET-SNMP-EXTEND-MIB tables (nsExtendConfigTable, nsExtendOutput1Table
#     and nsExtendOutput2Table) to see the resulting output

#  Note that the "extend" directive supercedes the previous "exec" and "sh" directives
#  However, walking the UCD-SNMP-MIB::extTable should still returns the same output,
#     as well as the fuller results in the above tables.


#
#  "Pass-through" MIB extension command
#
#pass .1.3.6.1.4.1.8072.2.255  /bin/sh       PREFIX/local/passtest
#pass .1.3.6.1.4.1.8072.2.255  /usr/bin/perl PREFIX/local/passtest.pl

# Note that this requires one of the two 'passtest' scripts to be installed first,
#    before the appropriate line is uncommented.
# These scripts can be found in the 'local' directory of the source distribution,
#     and are not installed automatically.

#  Walk the NET-SNMP-PASS-MIB::netSnmpPassExamples subtree to see the resulting output


#
#  AgentX Sub-agents
#
#  Run as an AgentX master agent
 master          agentx
#  Listen for network connections (from localhost)
#    rather than the default named socket /var/agentx/master
#agentXSocket    tcp:localhost:705

构建Docker镜像

docker build -t snmp-router .

运行Docker容器

docker run -d --name=snmp-router-1 -p 1610:161/udp snmp-router

注意

  • snmpd.conf配置文件145一定要配置为no,因为容器中系统服务不完整
    # generate traps on UCD error conditions
    defaultMonitors          no
    
  • 否则会导致报错
    /etc/snmp/snmpd.conf: line 145: Error: unknown monitor OID
    

补充

复制容器文件到本地

  1. 找到容器的ID或名称:
    docker ps
    
  2. 复制文件:
    docker cp <container_id_or_name>:/path/to/snmpd.conf /path/to/destination
    
  • 例如:
    docker cp my-snmp-container:/etc/snmp/snmpd.conf ./snmpd.conf
    

容器、镜像操作

# 停止容器
docker stop s<container_name_or_id>
# 删除容器
docker rm <container_name_or_id>
# 删除镜像
docker rmi <container_name_or_id>

单机部署(挂载conf文件版)

  • 整体步骤与单机部署(非挂载conf文件版)相同,只是在Dockerfile内容和运行Docker容器不同
  1. Dockerfile
# 使用Debian的slim版本作为基础镜像
FROM debian:buster-slim
# 设置清华大学TUNA镜像源
RUN sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list \
    && sed -i 's/security.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list \
    && apt-get update && apt-get install -y snmp snmpd

# 使用非自由软件包源(non-free repositories)来安装完整的MIB包
RUN sed -i 's/main/main non-free/' /etc/apt/sources.list \
    && apt-get update && apt-get install -y snmp-mibs-downloader
# 开放161端口,SNMP标准端口
EXPOSE 161/udp

# 启动snmpd服务
CMD [ "snmpd", "-f", "-Lo" ]
  1. 运行Docker容器命令
docker run -d --name=snmp-router-1 -p 1610:161/udp -v /path/to/snmpd.conf:/etc/snmp/snmpd.conf snmp-router

批量部署

说明

  • 脚本执行需要python环境
sudo yum update
sudo yum install python3
python3 --version 

创建Dockerfile

  • 创建一个Dockerfile,用于构建一个包含SNMP服务的Docker镜像。
# 使用Debian的slim版本作为基础镜像
FROM debian:buster-slim
# 设置清华大学TUNA镜像源
RUN sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list \
    && sed -i 's/security.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list \
    && apt-get update && apt-get install -y snmp snmpd

# 使用非自由软件包源(non-free repositories)来安装完整的MIB包
RUN sed -i 's/main/main non-free/' /etc/apt/sources.list \
    && apt-get update && apt-get install -y snmp-mibs-downloader

# 拷贝SNMPD配置文件到容器中
COPY snmpd.conf /etc/snmp/

# 开放161端口,SNMP标准端口
EXPOSE 161/udp

# 启动snmpd服务
CMD [ "snmpd", "-f", "-Lo" ]

创建SNMP配置文件 (snmpd.conf)

  • SNMP配置文件来配置snmpd服务,基于debian:buster-slim中默认snmp.conf文件修改而来,这里给出完整的内容,大家可以在此基础上进行完善和修改
###############################################################################
#
# EXAMPLE.conf:
#   An example configuration file for configuring the Net-SNMP agent ('snmpd')
#   See the 'snmpd.conf(5)' man page for details
#
#  Some entries are deliberately commented out, and will need to be explicitly activated
#
###############################################################################
#
#  AGENT BEHAVIOUR
#

#  Listen for connections from the local system only
#agentAddress  udp:127.0.0.1:161
#  Listen for connections on all interfaces (both IPv4 *and* IPv6)
#agentAddress udp:161,udp6:[::1]:161
agentAddress udp:161


###############################################################################
#
#  SNMPv3 AUTHENTICATION
#
#  Note that these particular settings don't actually belong here.
#  They should be copied to the file /var/lib/snmp/snmpd.conf
#     and the passwords changed, before being uncommented in that file *only*.
#  Then restart the agent

#  createUser authOnlyUser  MD5 "remember to change this password"
#  createUser authPrivUser  SHA "remember to change this one too"  DES
#  createUser internalUser  MD5 "this is only ever used internally, but still change the password"

#  If you also change the usernames (which might be sensible),
#  then remember to update the other occurances in this example config file to match.



###############################################################################
#
#  ACCESS CONTROL
#

#  system + hrSystem groups only
view   systemonly  included   .1.3.6.1.2.1.1
view   systemonly  included   .1.3.6.1.2.1.25.1

#  Full access from the local host
#rocommunity public  localhost
#  Default access to basic system info
rocommunity public  default    -V systemonly
#  rocommunity6 is for IPv6
rocommunity6 public  default   -V systemonly

 #  Full access from an example network
 #     Adjust this network address to match your local
 #     settings, change the community string,
 #     and check the 'agentAddress' setting above
#rocommunity secret  10.0.0.0/16

#  Full read-only access for SNMPv3
 rouser   authOnlyUser
#  Full write access for encrypted requests
#     Remember to activate the 'createUser' lines above
#rwuser   authPrivUser   priv

#  It's no longer typically necessary to use the full 'com2sec/group/access' configuration
#  r[ow]user and r[ow]community, together with suitable views, should cover most requirements



###############################################################################
#
#  SYSTEM INFORMATION
#

#  Note that setting these values here, results in the corresponding MIB objects being 'read-only'
#  See snmpd.conf(5) for more details
sysLocation    Sitting on the Dock of the Bay
sysContact     Me <me@example.org>
                                                 # Application + End-to-End layers
sysServices    72


#
#  Process Monitoring
#
# At least one  'mountd' process
proc  mountd
# No more than 4 'ntalkd' processes - 0 is OK
proc  ntalkd    4
# At least one 'sendmail' process, but no more than 10
proc  sendmail 10 1

#  Walk the UCD-SNMP-MIB::prTable to see the resulting output
#  Note that this table will be empty if there are no "proc" entries in the snmpd.conf file


#
#  Disk Monitoring
#
# 10MBs required on root disk, 5% free on /var, 10% free on all other disks
disk       /     10000
disk       /var  5%
includeAllDisks  10%

#  Walk the UCD-SNMP-MIB::dskTable to see the resulting output
#  Note that this table will be empty if there are no "disk" entries in the snmpd.conf file


#
#  System Load
#
# Unacceptable 1-, 5-, and 15-minute load averages
load   12 10 5

#  Walk the UCD-SNMP-MIB::laTable to see the resulting output
#  Note that this table *will* be populated, even without a "load" entry in the snmpd.conf file



###############################################################################
#
#  ACTIVE MONITORING
#

#   send SNMPv1  traps
trapsink     localhost public
#   send SNMPv2c traps
#trap2sink    localhost public
#   send SNMPv2c INFORMs
#informsink   localhost public

#  Note that you typically only want *one* of these three lines
#  Uncommenting two (or all three) will result in multiple copies of each notification.


#
#  Event MIB - automatically generate alerts
#
# Remember to activate the 'createUser' lines above
iquerySecName   internalUser       
rouser          internalUser
# generate traps on UCD error conditions
defaultMonitors          no
# generate traps on linkUp/Down
linkUpDownNotifications  yes



###############################################################################
#
#  EXTENDING THE AGENT
#

#
#  Arbitrary extension commands
#
 extend    test1   /bin/echo  Hello, world!
 extend-sh test2   echo Hello, world! ; echo Hi there ; exit 35
#extend-sh test3   /bin/sh /tmp/shtest

#  Note that this last entry requires the script '/tmp/shtest' to be created first,
#    containing the same three shell commands, before the line is uncommented

#  Walk the NET-SNMP-EXTEND-MIB tables (nsExtendConfigTable, nsExtendOutput1Table
#     and nsExtendOutput2Table) to see the resulting output

#  Note that the "extend" directive supercedes the previous "exec" and "sh" directives
#  However, walking the UCD-SNMP-MIB::extTable should still returns the same output,
#     as well as the fuller results in the above tables.


#
#  "Pass-through" MIB extension command
#
#pass .1.3.6.1.4.1.8072.2.255  /bin/sh       PREFIX/local/passtest
#pass .1.3.6.1.4.1.8072.2.255  /usr/bin/perl PREFIX/local/passtest.pl

# Note that this requires one of the two 'passtest' scripts to be installed first,
#    before the appropriate line is uncommented.
# These scripts can be found in the 'local' directory of the source distribution,
#     and are not installed automatically.

#  Walk the NET-SNMP-PASS-MIB::netSnmpPassExamples subtree to see the resulting output


#
#  AgentX Sub-agents
#
#  Run as an AgentX master agent
 master          agentx
#  Listen for network connections (from localhost)
#    rather than the default named socket /var/agentx/master
#agentXSocket    tcp:localhost:705

构建Docker镜像

docker build -t snmp-router .

编辑python脚本命令

  • 生成的docker-compose.yml文件格式,不太正确但是不影响正常执行
  • num_instances定义实例个数,可自定义
import yaml

def generate_compose(num_instances, base_port, config_template):
    services = {}
    for i in range(1, num_instances + 1):  # 从1开始到num_instances(包括)
        service_name = f"snmp{i}"
        services[service_name] = {
            'image': 'snmp-router',
            'build': '.',
            'ports': [f"{base_port + i}:161/udp"],  # base_port从16201开始
            'volumes': [f"{config_template}:/etc/snmp/snmpd.conf"]
        }

    compose_dict = {
        'version': '3.8',
        'services': services
    }

    # 使用 safe_dump 来避免包含 Python 具体的对象标签
    with open('docker-compose.yml', 'w') as f:
        yaml.safe_dump(compose_dict, f, default_flow_style=False)

num_instances = 50  # 实例数量
base_port = 16200   # 第一个服务的基础端口号
config_template = "./snmpd.conf"  # 配置文件路径模板

generate_compose(num_instances, base_port, config_template)

执行脚本

python3 generate_compose.py

启动所有服务

docker-compose up -d

在这里插入图片描述
在这里插入图片描述

批量删除命令

docker ps -a | awk '$NF ~ /^more-snmp/ {print $1}' | xargs -r docker rm -f
  1. docker ps -a:列出所有容器,包括停止的容器。
  2. awk ‘$NF ~ /^more-snmp/ {print $1}’:使用 awk 过滤出容器名以 “more-snmp” 开头的行,并打印出这些行中的第一个字段,即容器的 ID 或名称。
  3. xargs -r docker rm -f:将上一步得到的容器 ID 或名称传递给 docker rm -f 命令,强制删除这些容器。

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

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

相关文章

Golang不可不知的7个并发概念

并发性支持是Golang最重要的原生特性之一&#xff0c;本文介绍了Golang中和并发性相关的7个概念。原文: Golang: 7 must-know concurrency related concepts 并发是Go编程语言的基本特性&#xff0c;意味着程序可以同时执行多个任务。Golang的并发独特而强大&#xff0c;其内置…

word中MathType公式编号

直接上效果图&#xff1a; 步骤如下&#xff1a; 安装MathTypeword中安装MathType选项卡。设置MathType选项卡添加分隔符插入公式&#xff0c;自动生成右编码 接下来介绍每一步。 文章目录 1. 安装MathType2. Word中安装MathType选项卡3. 配置MathType选项4. 添加分隔符5. 插…

33--反射

1、反射(Reflection)的概念 1.1 反射的出现背景 Java程序中&#xff0c;所有的对象都有两种类型&#xff1a;编译时类型和运行时类型&#xff0c;而很多时候对象的编译时类型和运行时类型不一致。 Object obj new String("hello"); obj.getClass(); 例如&#xf…

Rust使用gRPC

需要先安装protoc&#xff08;Protocol Buffers Compiler&#xff09;&#xff0c;可据此Protobuf Compiler Installation下载 第一步&#xff1a;创建项目 创建两个新的Rust项目&#xff0c;分别作为服务端与客户端&#xff1a; cargo new rust_grpc_servercargo new rust_grp…

探秘HyperLogLog:Redis中的基数统计黑科技

欢迎来到我的博客&#xff0c;代码的世界里&#xff0c;每一行都是一个故事 探秘HyperLogLog&#xff1a;Redis中的基数统计黑科技 前言HyperLogLog简介基数和基数统计的重要性HyperLogLog的历史和革命性 HyperLogLog的工作原理哈希函数线性计数与对数计数HyperLogLog的核心算法…

快速上手:探索Spring MVC的学习秘籍!

SpringMVC概述 1&#xff0c;SpringMVC入门案例1.2 案例制作步骤1:创建Maven项目步骤2:补全目录结构步骤3:导入jar包步骤4:创建配置类步骤5:创建Controller类步骤6:使用配置类替换web.xml步骤7:配置Tomcat环境步骤8:启动运行项目步骤9:浏览器访问步骤10:修改Controller返回值解…

一个有趣的MOSFET电路-触摸调光电路

来源 刷B站视频&#xff0c;看到一个很新奇的“触摸调光电路”&#xff0c;电路图如下&#xff1a; 视频在这里&#xff0c;只使用了3个元件。 刚好最近在学模拟电路的 MOSFET&#xff0c;我之前的理解是 MOSFET 的控制电压应该加在 Gate 和 Source 之间&#xff0c;也就是 栅…

【数据库原理】(1)数据库技术的发展

数据与信息 数据&#xff1a;数据并非只是数字&#xff0c;像文字、符号、图像、影音等都属于数据的范畴。但一般会用数字来表述客观事物的数量、质量、关系等&#xff0c;便于更加直观的看待问题。 语义&#xff1a;数据还需要结合关联的语义解释才能够清晰的描述事物&#…

设计模式——适配器模式(Adapter Pattern)

概述 适配器模式可以将一个类的接口和另一个类的接口匹配起来&#xff0c;而无须修改原来的适配者接口和抽象目标类接口。适配器模式(Adapter Pattern)&#xff1a;将一个接口转换成客户希望的另一个接口&#xff0c;使接口不兼容的那些类可以一起工作&#xff0c;其别名为包装…

安全加固指南:如何更改 SSH 服务器的默认端口号

在 Linux 系统中修改 SSH 服务的默认端口号是一项重要的安全措施&#xff0c;它可以帮助增强系统的安全性。这个过程相对简单&#xff0c;但必须由具有管理员权限的用户来执行。下面&#xff0c;我将向大家介绍如何安全地更改 SSH 端口的具体步骤。 1 备份 SSH 配置文件 在修改…

2023年年度总结,一个小白的CSDN涨粉历程

前言 滚滚长江东逝水&#xff0c;一去不复返。 转眼间已到2024年节点&#xff0c;时间如滚滚长江水向东奔流不息&#xff0c;在长江消失之前&#xff0c;都不会停歇&#xff0c;也不会回头。人亦如此&#xff0c;不管是生活还是学习&#xff0c;都是不断往前走的过程&#xff…

Java基础语法(cmd,jdk的安装,配置环境变量,jre和jdk)

文章目录 注意&#xff1a;day01 - Java基础语法1. 人机交互1.1 什么是cmd&#xff1f;1.2 如何打开CMD窗口&#xff1f;1.3 常用CMD命令1.4 CMD练习1.5 环境变量 2. Java概述1.1 Java是什么&#xff1f;1.2下载和安装1.2.1 下载1.2.2 安装1.2.3 JDK的安装目录介绍 1.3 HelloWo…

初始SpringBoot:详解特性和结构

&#x1f3e1;浩泽学编程&#xff1a;个人主页 &#x1f525; 推荐专栏&#xff1a;《深入浅出SpringBoot》《java项目分享》 《RabbitMQ》《Spring》《SpringMVC》 &#x1f6f8;学无止境&#xff0c;不骄不躁&#xff0c;知行合一 文章目录 前言一、SpringBoot…

人大金仓数据库与mysql比较

简介 人大金仓数据库是基于 PostgreSQL 开发的。 SQL语言 语法 关键字 KES&#xff1a; MYSQL&#xff1a; 语句 *特性MYSQLKES字符串字面量单引号()或 双引号(")十六进制字面量0x5461626c65&#xff0c;X5461626c65/BIT字面量b1000001,0b1000001/Boolean字面量常…

异常检测 | Matlab基于GNN图神经网络的异常数据检测

异常检测 | Matlab基于GNN图神经网络的异常数据检测 目录 异常检测 | Matlab基于GNN图神经网络的异常数据检测效果一览基本介绍模型描述程序设计参考资料 效果一览 基本介绍 Matlab基于GNN图神经网络的异常数据检测。其核心思想是学习一个函数映射。本次使用人类活动数据&#…

04 HAL库下使用定时器产生一个中断

目录 一、定时器的相关知识点 1.定时器的定义 2. 查看时钟配置 3. 定时器的分类 二、实验开始 1. 配置一个定时器 2.打开定时器的中断配置 引言 在本文的开头我想给大家分享一下单片机工作的两种工作模式轮询和中断&#xff08;异步&#xff09;&#xff0c; 中断也叫做…

元旦小礼品:想去面试的时候如何快速打造自己的面试亮点

新年快乐&#xff01; 对于毕业生&#xff0c;或者工作时间不太长的同学来说&#xff0c;面试实习之前写简历是一件很痛苦的事情&#xff0c;特别是简历上没什么亮点&#xff0c;总感觉很心虚。这时候就会发现很多人凡是知道的&#xff0c;叫得上名字的统统写上去。可惜即使通…

Pix2Pix如何工作?

一、说明 在本指南中&#xff0c;我们将重点介绍 Pix2Pix [1]&#xff0c;它是用于配对图像翻译的著名且成功的深度学习模型之一。在地理空间科学中&#xff0c;这种方法可以帮助传统上不可能的广泛应用&#xff0c;在这些应用中&#xff0c;我们可能希望从一个图像域转到另一个…

【转载】最强搜索工具Everything的搜索技巧,你可能根本不会用!

转载自B站视频 https://www.bilibili.com/video/BV1Hw411W7vK/?spm_id_from333.880.my_history.page.click&vd_source5d2fad4f7faecf136254f663320a80a7 指定在某个文件夹下搜索 可以缩小搜索范围 排除某个目录 前面加! 运算符&#xff0c;与的关系 &#xff08;空…

webrtc中的接口代理框架

文章目录 接口代理框架Proxy体系类结构导出接口 webrtc的实际运用PeerConnectionFactoyPeerConnection使用 接口代理框架 webrtc体系庞大&#xff0c;模块化极好&#xff0c;大多数模块都可以独立使用。模块提供接口&#xff0c;外部代码通过接口来使用模块功能。 在webrtc中通…