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

文章目录

  • 服务器环境说明
  • 单机部署(非挂载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 SNMPv3rouser   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 agentmaster          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 SNMPv3rouser   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 agentmaster          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 yamldef 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.mzph.cn/news/587572.shtml

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

相关文章

12.30序列检测(重叠、不重叠、连续、不连续、含无关项)——移位寄存器,状态机;状态机(二段式,三段式)

状态机-重叠序列检测 timescale 1ns/1nsmodule sequence_test2(input wire clk ,input wire rst ,input wire data ,output reg flag ); //*************code***********//parameter S00, S11, S22, S33, S44;reg [2:0] state, nstate;always(posedge clk or negedge rst) b…

CLion Nova:全新的C/C++ IDE

CLion Nova是一款备受期待的集成开发环境&#xff08;IDE&#xff09;&#xff0c;由JetBrains专门为C/C开发者设计。这款IDE提供了许多新的功能和改进&#xff0c;使用 ReSharper C/Rider C 语言引擎而不是 CLion “传统” 引擎&#xff0c;以满足C/C开发者的需求。目前预览版…

网络层解读

基本介绍 概述 当两台主机之间的距离较远(如相隔几十或几百公里&#xff0c;甚至几千公里)时&#xff0c;就需要另一种结构的网络&#xff0c;即广域网。广域网尚无严格的定义。通常是指覆盖范围很广(远超过一个城市的范围)的长距离的单个网络。它由一些结点交换机以及连接这些…

多输入多输出 | MATLAB实现SSA-CNN麻雀算法优化卷积神经网络多输入多输出预测

多输入多输出 | MATLAB实现SSA-CNN麻雀算法优化卷积神经网络多输入多输出预测 目录 多输入多输出 | MATLAB实现SSA-CNN麻雀算法优化卷积神经网络多输入多输出预测预测效果基本介绍模型背景程序设计参考资料 预测效果 基本介绍 MATLAB实现SSA-CNN麻雀算法优化卷积神经网络多输入…

Mastercam各版本安装指南

Mastercam下载链接 https://pan.baidu.com/s/1OldNR0ERqJFrEN24uu3j0Q?pwd0531 1.鼠标右击【Mastercam2024(64bit)】压缩包&#xff08;win11及以上系统需先点击“显示更多选项”&#xff09;【解压到 Mastercam2024(64bit)】。 2.打开解压后的文件夹&#xff0c;鼠标右击【…

5G阅信助力互联网行业:XX出行-出票通知,案例分析

XX出行日常有大量业务通知短信下发&#xff0c;用户触达频次和用户打开率都比较高&#xff0c;但原短信无法带来附加营销增值&#xff0c;通过阅信增值服务消息将两者结合起来&#xff0c;可实现业务的多渠道引流&#xff0c;开拓了新的渠道和方式。 项目概述&#xff1a; 1. 项…

Github项目推荐-vocal-separate

项目地址 vocal-separate: 项目简述 这是一个音乐和人声分离的项目&#xff0c;基于python开发。有图形化操作界面&#xff0c;看起来还不错。 项目截图

C练习——判断三角形并求面积

题目&#xff1a;从健盘任意输入三角形的三边长为a,b,c,编程判断a,b,c的值能否构成一个三角形&#xff0c;若能构成三角形&#xff0c;则计算并输出三角形的面积&#xff0c;否则提示不能构成三角形。 已知构成三角形的条件是&#xff1a;任意两边之和大于第三边。 解析&#…

再见2023,你好2024

再见2023&#xff0c;你好2024 生活1月 悲伤与治愈2~4月 运动与偏爱5月 体验与美食6月 婚礼与热爱7~8月 就医与别离9~11月 陪伴与暖房12月 体验&新生 运动追剧读书总结 生活 生活是一个修罗场&#xff0c;来世间一场&#xff0c;要经历丰腴有趣的人生。去体验各种滋味&…

Android : 使用GestureDetector 进行手势识别—简单应用

示例图&#xff1a; GestureDetector 介绍&#xff1a; GestureDetector 是 Android 开发中用于识别和处理手势的一个类。它允许开发者检测用户在触摸屏上的各种手势&#xff0c;如滑动、长按、双击等。通过使用 GestureDetector&#xff0c;您可以轻松地为应用程序添加手势识…

【Web API系列】使用异步剪贴板API(async clipboard)的图像的编程复制和粘贴

文章目录 前言一、将数据写入剪切板1. WriteText()2. Write()3. 监听复制事件 二、从剪切板读取数据1.readText()2.read()3. 处理粘贴的文件4. 监听读剪切板事件 三、申请权限政策集成 四、功能检测五、处理多个 MIME 类型 前言 访问系统剪贴板的传统方法是通过 document.exec…

考研后SpringBoot复习1

考研后SpringBoot复习 Hello World入门 复习的版本为SpringBoot2的版本 创建maven项目 在pom文件中导入SpringBoot的依赖同时引入web开发的启动器 <!--声明springboot父项目--><parent><groupId>org.springframework.boot</groupId><artifactId>…

【大模型的前世今生】从自然语言处理说起

自然语言处理&#xff08;Natural Language Processing&#xff0c;简称NLP&#xff09;被誉为人工智能皇冠上的明珠&#xff0c;是计算机科学和人工智能领域的一个重要方向。它主要研究人与计算机之间&#xff0c;使用自然语言进行有效通信的各种理论和方法。简单来说&#xf…

AcWing算法提高课-2.3.1矩阵距离

算法提高课整理 CSDN个人主页&#xff1a;更好的阅读体验 本文同步发表于 CSDN | 洛谷 | AcWing | 个人博客 原题链接 题目描述 给定一个 01 矩阵&#xff0c;求矩阵中每个元素离 1 的最短曼哈顿距离。 输入格式 第一行两个整数 n , m n,m n,m。 接下来一个 n n n 行 …

hadoop hive spark flink 安装

下载地址 Index of /dist ubuntu安装hadoop集群 准备 IP地址主机名称192.168.1.21node1192.168.1.22node2192.168.1.23node3 上传 hadoop-3.3.5.tar.gz、jdk-8u391-linux-x64.tar.gz JDK环境 node1、node2、node3三个节点 解压 tar -zxvf jdk-8u391-linux-x64.tar.gz…

分布式文件系统的介绍

什么是分布式文件系统 跨越多个服务器或者多个位置的文件系统。其中涉及的技术包括数据的复制、数据的分片和路由,由于用户可能存储大文件、图片或者其他类似的需求性文件,因此需要设计不同的系统方便用户访问的存取。 任何设备通过任何网络位置访问文件,就像访问到自己的文…

华清远见作业第十六天

思维导图&#xff1a; 双向循环链表头插入&#xff1a; 代码&#xff1a; Doublelist insert_head(Doublelist head,datatype element) {//创建新节点sDoublelist screate_node();if(NULLs){return head;}s->dataelement;//数据存储//判断链表是否为空if(NULLhead){heads;…

性能测试-jmeter:安装 / 基础使用

一、理解jmeter 官网-Apache JMeter-Apache JMeter™ JMeter是一款开源的性能测试工具&#xff0c;主要用于模拟大量用户并发访问目标服务器&#xff0c;以评估服务器的性能和稳定性。 JMeter可以执行以下任务序号用途描述1性能测试通过模拟多个用户在同一时间对服务器进行请…

limit查询报错问题

分页时候 limit 后面的公式是 (pageNum-1)*pageSize,pageSize 但是在数据库查询时候 当然在.XML中也不能像下面这么写,如果要计算 在业务层或者控制层计算好再传值进来

RAID的介绍和选择

RAID 类型&#xff1a;什么是 RAID 以及哪种 RAID 级别适合您&#xff1f; 一、RAID 简介 在2021年6月11日&#xff0c;亚瑟迪特纳进行了一场关于RAID技术的技术讲座。RAID&#xff0c;即独立磁盘冗余阵列&#xff0c;是将多个硬盘驱动器协同工作的技术。不同的RAID类型各有优…