ELK-日志服务【filebeat-安装使用】

news/2024/5/9 23:14:15/文章来源:https://blog.csdn.net/L596462013/article/details/131685586

目录

【1】安装Filebeat

【2】配置-测试

【3】配置使用Filebeat 

【4】filebeat-收集系统文件日志

【5】配置filebeat,将/var/log/all.log日志采集到es集群中

【6】定制索引名称

【7】收集多个web节点的日志,输出到相同的索引中

【8】filebeat-收集nginx日志

【9】修改nginx的日志格式

【10】图形化展示

【11】filebeat-收集nginx的访问日志+错误日志

【12】filebeat收集nginx多虚拟主机日志

【13】收集tomcat日志

【14】filebeat-收集tomcat错误日志


【1】安装Filebeat

[root@filebeat ~]# rpm -ivh filebeat-7.4.0-x86_64.rpm 
warning: filebeat-7.4.0-x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID d88e42b4: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...1:filebeat-7.4.0-1                 ################################# [100%]

【2】配置-测试

  • 配置filebeat从终端读入,从终端输出
[root@filebeat ~]# vim /etc/filebeat/test.yml
filebeat.inputs:
- type: stdinenabled: true
output.console:pretty: trueenable: true## 测试
[root@filebeat ~]# filebeat -e -c test.yml

【3】配置使用Filebeat 

[root@filebeat ~]# cp /etc/filebeat/filebeat.yml /etc/filebeat/filebeat.yml_bak
[root@filebeat ~]# vim /etc/filebeat/filebeat.yml
filebeat.inputs:
- type: logenabled: truepaths:- /var/log/messagesoutput.elasticsearch:hosts: ["10.0.0.21:9200","10.0.0.22:9200","10.0.0.23:9200"]enable: true## 测试
[root@filebeat ~]# systemctl restart filebeat.service

  • 使用kibana读取filebeat索引中的数据

 

 

 

 

  • 日志中写入新的数据,刷新验证是否能被命中
[root@filebeat ~]# echo "test" >> /var/log/messages

【4】filebeat-收集系统文件日志

系统日志包含messages、secure、cron、dmesg、ssh、boot等

如果挨个配置会变得很麻烦,我们可以将这些日志进行统一几种管理,使用rsyslog将本地所有类型的日志都写入到/var/log/all.log文件中,然后使用filebeat对该文件进行收集

[root@filebeat ~]# yum -y install rsyslog
....
$ModLoad imudp
$UDPServerRun 514
....
*.* /var/log/all.log
....## 重启测试
[root@filebeat ~]# systemctl restart rsyslog.service    
[root@filebeat ~]# logger "rsyslog test from all"
[root@filebeat ~]# grep "all" /var/log/all.log 
Jul 11 05:25:47 filebeat root: rsyslog test from all

【5】配置filebeat,将/var/log/all.log日志采集到es集群中

  • 先删除es中的索引和kibana中匹配的索引,重启后生成新的索引

[root@filebeat ~]# vim /etc/filebeat/filebeat.yml
filebeat.inputs:
- type: logenabled: truepaths:- /var/log/all.loginclude_lines: ['^ERR', '^WARN', 'sshd']output.elasticsearch:hosts: ["10.0.0.21:9200","10.0.0.22:9200","10.0.0.23:9200"]enable: true[root@filebeat ~]# systemctl restart filebeat.service

【6】定制索引名称

[root@filebeat ~]# vim /etc/filebeat/filebeat.ymlfilebeat.inputs:
- type: logenabled: truepaths:- /var/log/all.loginclude_lines: ['^ERR', '^WARN', 'sshd']output.elasticsearch:hosts: ["10.0.0.21:9200","10.0.0.22:9200","10.0.0.23:9200"]enable: trueindex: "system-%{[agent.version]}-%{+yyyy.MM.dd}"
setup.ilm.enabled: false             # 索引的生命周期。默认开启,开启后索引名称只能是filebeat
setup.template.name: "system"        # 定义模板名称
setup.template.pattern: "system-*"   # 定义模板匹配索引的名称## 索引分片,方式一
setup.template.settings:index.number_of_shards: 3index.number_of_replicas: 1## 索引分片,方式二
1、修改system模板,添加分片和副本数量
2、删除模板关联的索引
3、重启filebeat
4、产生新的日志验证

  • 我们需要删除syste模板和索引,因为模板默认分片就是1,要不然分片永远不会生效

## 重启
[root@filebeat ~]# systemctl restart filebeat.service## 产生新的日志,验证

 

 

 第二种方式

【7】收集多个web节点的日志,输出到相同的索引中

  • web-01配置filebeat
[root@filebeat ~]# vim /etc/rsyslog.conf
.....
$ModLoad imudp
$UDPServerRun 514
.....
*.* /var/log/all.log
.....[root@filebeat ~]# vim /etc/filebeat/filebeat.yml
filebeat.inputs:
- type: logenabled: truepaths:- /var/log/all.loginclude_lines: ['^ERR', '^WARN', 'sshd']output.elasticsearch:hosts: ["10.0.0.21:9200","10.0.0.22:9200","10.0.0.23:9200"]enable: trueindex: "system-%{[agent.version]}-%{+yyyy.MM.dd}"setup.ilm.enabled: false
setup.template.name: "system"
setup.template.pattern: "system-*"
setup.template.settings:index.number_of_shards: 3index.number_of_replicas: 1[root@filebeat ~]# systemctl restart rsyslog.service
[root@filebeat ~]# systemctl restart filebeat.service
  • web-02配置filebeat
[root@filebeat ~]# vim /etc/rsyslog.conf
.....
$ModLoad imudp
$UDPServerRun 514
.....
*.* /var/log/all.log
.....[root@filebeat-02 ~]# vim /etc/filebeat/filebeat.yml
filebeat.inputs:
- type: logenabled: truepaths:- /var/log/all.loginclude_lines: ['^ERR', '^WARN', 'sshd']output.elasticsearch:hosts: ["10.0.0.21:9200","10.0.0.22:9200","10.0.0.23:9200"]enable: trueindex: "system-%{[agent.version]}-%{+yyyy.MM.dd}"setup.ilm.enabled: false
setup.template.name: "system"
setup.template.pattern: "system-*"
setup.template.settings:index.number_of_shards: 3index.number_of_replicas: 1[root@filebeat-02 ~]# systemctl restart rsyslog.service
[root@filebeat-02 ~]# systemctl restart filebeat.service

 

【8】filebeat-收集nginx日志

  • 获取用户细信息:来源IP、地域、网站PV、UV、状态码、访问时间等

lb-server

10.0.0.27

web-01

10.0.0.25

web-02

10.0.0.26

  • lb-server
[root@lb-server-01 ~]# vim /etc/nginx/conf.d/filebeat-test.conf
upstream file {server 10.0.0.25;server 10.0.0.26;
}
server {listen 80;server_name www.filebeat-test.org;location / {proxy_pass http://file;include proxy_params;}
}[root@lb-server-01 ~]# vim /etc/nginx/proxy_params
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_connect_timeout 60s;      # nginx连接后端的超时时间
proxy_read_timeout 60s;         # 响应头部超时时间
proxy_send_timeout 60s;         # 响应数据主体的超时时间
proxy_buffering on;             # 开启缓冲区
proxy_buffer_size 8k;           # 缓冲区Header大小
proxy_buffers 4 64k;            # 缓冲区数量 * 大小 = 最大接收[root@lb-server-01 ~]# systemctl reload nginx
  • web-01和web-02配置相同
[root@filebeat conf.d]# vim /etc/nginx/conf.d/filebeat-test.conf
server {listen 80;server_name www.filebeat-test.org;root /code/filebeat;location / {index index.html;}
}[root@filebeat conf.d]# mkdir -p /code/filebeat
[root@filebeat conf.d]# echo "filebeat-test-web-01" >> /code/filebeat/index.html
[root@filebeat-02 conf.d]# echo "filebeat-test-web-02" >> /code/filebeat/index.html
[root@filebeat conf.d]# systemctl reload nginx.service

  • web-01、web-02 配置filebeat
[root@filebeat conf.d]# vim /etc/filebeat/nginx-filebeat-access.yml
filebeat.inputs:
- type: logenabled: truepaths:- /var/log/nginx/access.logoutput.elasticsearch:hosts: ["10.0.0.21:9200","10.0.0.22:9200","10.0.0.23:9200"]enable: trueindex: "nginx-access-%{[agent.version]}-%{+yyyy.MM.dd}"setup.ilm.enabled: false
setup.template.name: "nginx"
setup.template.pattern: "nginx-*"[root@filebeat conf.d]# filebeat -e -c /etc/filebeat/nginx-filebeat-access.yml &>/dev/null &
[1] 13738
  • 验证

 

 

  • 我们看到在message字段中,记录的信息非常的多,不适合我们之后的统计,那么怎么做呢

方式一、修改nginx的日志格式 json 方式二、filebeat —> logstash

【9】修改nginx的日志格式

[root@filebeat ~]# vim /etc/nginx/nginx.conf
............
............log_format json '{ "time_local": "$time_local", ''"remote_addr": "$remote_addr", ''"referer": "$http_referer", ''"request": "$request", ''"status": $status, ''"bytes": $body_bytes_sent, ''"agent": "$http_user_agent", ''"x_forwarded": "$http_x_forwarded_for", ''"up_addr": "$upstream_addr", ''"up_host": "$upstream_http_host", ''"upstream_time": "$upstream_response_time", ''"request_time": "$request_time"''}'
...........access_log  /var/log/nginx/access-json.log  json;[root@filebeat ~]# systemctl reload nginx.service
[root@filebeat ~]# tailf /var/log/nginx/access-json.log 
{ "time_local": "11/Jul/2023:08:44:55 -0400", "remote_addr": "10.0.0.27", "referer": "-", "request": "GET / HTTP/1.1", "status": 200, "bytes": 21, "agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36", "x_forwarded": "10.0.0.1", "up_addr": "-", "up_host": "-", "upstream_time": "-", "request_time": "0.000"}access_log/var/log/nginx/access.logmain## 收集日志改为access-json.log
[root@filebeat ~]# vim /etc/filebeat/nginx-filebeat-access.yml 
filebeat.inputs:
- type: logenabled: truepaths:- /var/log/nginx/access-json.logjson_keys_under_root: true    # false表示将json解析的内容存储在message字段,true表示不存储在message字段中json.overwrite_keys: true     # 覆盖message字段,使用自定义json的keyoutput.elasticsearch:hosts: ["10.0.0.21:9200","10.0.0.22:9200","10.0.0.23:9200"]enable: trueindex: "nginx-access-%{[agent.version]}-%{+yyyy.MM.dd}"setup.ilm.enabled: false
setup.template.name: "nginx"
setup.template.pattern: "nginx-*"[root@filebeat ~]# kill 13738
[root@filebeat ~]# filebeat -e -c /etc/filebeat/nginx-filebeat-access.yml &>/dev/null &

 

【10】图形化展示

 

【11】filebeat-收集nginx的访问日志+错误日志

[root@filebeat ~]# vim /etc/filebeat/nginx-filebeat-access-error.yml
filebeat.inputs:
- type: logenabled: truepaths:- /var/log/nginx/access-json.logjson_keys_under_root: truejson.overwrite_keys: truetags: ["nginx-access"]- type: logenabled: truepaths:- /var/log/nginx/error.logtags: ["nginx-error"]output.elasticsearch:hosts: ["10.0.0.21:9200","10.0.0.22:9200","10.0.0.23:9200"]enable: trueindices:- index: "nginx-access-%{[agent.version]}-%{+yyyy.MM.dd}"when.contains:tags: "nginx-access"- index: "nginx-error-%{[agent.version]}-%{+yyyy.MM.dd}"when.contains:tags: "nginx-error"setup.ilm.enabled: false
setup.template.name: "nginx"
setup.template.pattern: "nginx-*"[root@filebeat ~]# filebeat -e -c /etc/filebeat/nginx-filebeat-access-error.yml &>/dev/null &

 

【12】filebeat收集nginx多虚拟主机日志

[root@filebeat filebeat]# vim /etc/nginx/conf.d/filebeat-test-01.conf 
server {listen 80;server_name www.filebeat-test-01.org;root /code/filebeat-01;access_log /var/log/nginx/access-test-01.log json;location / {index index.html;}
}[root@filebeat ~]# vim /etc/nginx/conf.d/filebeat-test-02.conf
server {listen 80;server_name www.filebeat-test-02.org;root /code/filebeat-02;access_log /var/log/nginx/access-test-02.log json;location / {index index.html;}
}[root@filebeat filebeat]# mkdir /code/filebeat-01
[root@filebeat filebeat]# echo "www.filebeat-01-web01" >> /code/filebeat-01/index.html[root@filebeat ~]# mkdir /code/filebeat-02
[root@filebeat ~]# echo "www.filebeat-02-web01" >> /code/filebeat-02/index.html
[root@filebeat ~]# systemctl reload nginx.service
  • 配置filebeat
[root@filebeat ~]# cat /etc/filebeat/filebeat.yml 
filebeat.inputs:
- type: logenabled: truepaths:- /var/log/nginx/access-test-01.logjson_keys_under_root: truejson.overwrite_keys: truetags: ["nginx-web01"]- type: logenabled: truepaths:- /var/log/nginx/access-test-02.logjson_keys_under_root: truejson.overwrite_keys: truetags: ["nginx-web02"]- type: logenabled: truepaths:- /var/log/nginx/error.logtags: ["nginx-error"]output.elasticsearch:hosts: ["10.0.0.21:9200","10.0.0.22:9200","10.0.0.23:9200"]enable: trueindices:- index: "nginx-web01-%{[agent.version]}-%{+yyyy.MM.dd}"when.contains:tags: "nginx-web01"- index: "nginx-web02-%{[agent.version]}-%{+yyyy.MM.dd}"when.contains:tags: "nginx-web02"- index: "nginx-error-%{[agent.version]}-%{+yyyy.MM.dd}"when.contains:tags: "nginx-error"setup.ilm.enabled: false
setup.template.name: "nginx"
setup.template.pattern: "nginx-*"[root@filebeat filebeat]# systemctl restart filebeat.service

 

【13】收集tomcat日志

  • 修改tomcat的日志格式
  <Host name="www.file-tomcat.org"  appBase="webapps"unpackWARs="true" autoDeploy="true"><Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"prefix="file-tomcat_access_log." suffix=".txt"pattern="{&quot;clientip&quot;:&quot;%h&quot;,ClientUser&quot;:&quot;%l&quot;,&quot;authenticated&quot;:&quot;%u&quot;,&quot;AccessTime&quot;:&quot;%t&quot;,&quot;method&quot;:&quot;%r&quot;,&quot;status&quot;:&quot;%s&quot;,&quot;SendBytes&quot;:&quot;%b&quot;,&quot;Query?string&quot;:&quot;%q&quot;,&quot;parner&quot;:&quot;%{Referer}i&quot;,&quot;AgentVersion&quot;:&quot;%{User-Agent}i&quot;}" /></Host>
  • 启动tomcat,验证日志格式
[root@filebeat soft]# systemctl restart tomcat.service
[root@filebeat soft]# tailf /soft/tomcat/logs/file-tomcat_access_log..2023-07-12.txt
{"clientip":"10.0.0.1",ClientUser":"-","authenticated":"-","AccessTime":"[12/Jul/2023:03:26:54 -0400]","method":"GET / HTTP/1.1","status":"200","SendBytes":"11156","Query?string":"","parner":"-","AgentVersion":"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36"}
  • 配置filebeat
[root@filebeat filebeat]# vim filebeat.yml
filebeat.inputs:
- type: logenabled: truepaths:- /soft/tomcat/logs/file-tomcat_access_log.*.txtjson_keys_under_root: truejson.overwrite_keys: truetags: ["tomcat-access"]output.elasticsearch:hosts: ["10.0.0.21:9200","10.0.0.22:9200","10.0.0.23:9200"]enable: trueindices:- index: "tomcat-access-%{[agent.version]}-%{+yyyy.MM.dd}"when.contains:tags: "tomcat-access"setup.ilm.enabled: false
setup.template.name: "tomcat"
setup.template.pattern: "tomcat-*"[root@filebeat filebeat]# systemctl restart filebeat.service
  •  验证

【14】filebeat-收集tomcat错误日志

[root@filebeat filebeat]# vim filebeat.yml
filebeat.inputs:
- type: logenabled: truepaths:- /soft/tomcat/logs/file-tomcat_access_log.*.txtjson_keys_under_root: truejson.overwrite_keys: truetags: ["tomcat-access"]- type: logenabled: truepaths:- /soft/tomcat/logs/catalina.outmultiline.pattern: '^\d{2}'multiline.negate: truemultiline.match: aftermultiline.max_lines: 1000tags: ["tomcat-error"]output.elasticsearch:hosts: ["10.0.0.21:9200","10.0.0.22:9200","10.0.0.23:9200"]enable: trueindices:- index: "tomcat-access-%{[agent.version]}-%{+yyyy.MM.dd}"when.contains:tags: "tomcat-access"- index: "tomcat-error-%{[agent.version]}-%{+yyyy.MM.dd}"when.contains:tags: "tomcat-error"setup.ilm.enabled: false
setup.template.name: "tomcat"
setup.template.pattern: "tomcat-*"[root@filebeat filebeat]# systemctl restart filebeat.service
  • 验证

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

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

相关文章

数据结构--栈

一、栈 数组是一种连续存储、随机访问的线性表&#xff0c;链表属于分散存储、连续访问的线性表。它们每个数据都有其相对位置&#xff0c;有至多一个直接前驱和之多一个直接后继。栈&#xff08;Stack&#xff09;和队列&#xff08;Queue&#xff09;也属于线性表&#xff0c…

twaver——树中选择子网,拓扑中显示子网里面的拓扑

twaver.network.Network.setCurrentSubNetwork ( currentSubNetwork [animate] [finishFunction] ) 将当前子网设置为指定子网&#xff0c;并且可以设置是否有动画效果&#xff0c;而且能指定设置当前子网结束后执行的动作 Parameters: currentSubNetwork twaver.SubNetwork 子…

【UT学习记录】

系列文章目录 提示&#xff1a;这里可以添加系列文章的所有文章的目录&#xff0c;目录需要自己手动添加 Part1&#xff1a;Mock Part2&#xff1a;PowerMock Part3:Junit 提示&#xff1a;写完文章后&#xff0c;目录可以自动生成&#xff0c;如何生成可参考右边的帮助文档 文…

即插即用篇 | YOLOv8 引入具备跨空间学习的高效多尺度注意力 Efficient Multi-Scale Attention | 《ICASSP 2023 最新论文》

论文地址:https://arxiv.org/vc/arxiv/papers/2305/2305.13563v1.pdf 该论文展示了通道或空间注意机制在各种计算机视觉任务中产生更明显的特征表示的显著效果。然而,通过通道维度缩减来建模跨通道关系可能会在提取深度视觉表示方面带来副作用。本文提出了一种新颖高效的多尺…

ES6——Promise

promise 含义&#xff1a;异步编程解决方案 特点&#xff1a;1、状态不受外界影响&#xff0c;状态有三种&#xff1a;pending、fulfilled、rejected 2、状态不可逆&#xff0c;只能pending -> fulfilled、pending -> rejected 缺点&#xff1a;无法取消、不设置回调函…

C语言联合体

一、联合体的概念 联合 (union) 是一个能在同一个存储空间里 ( 但不同时) 存储不同类型数据的复合数据类型。 大致结构如下&#xff1a; n union foo /* 定义一个联合类型foo */ n { q int digit; q double bigfl[10]; q char letter; n }baz; /* 定义一个example类型的联合变量…

JVM (simple Version)

简介 JVM 其实就是一个Java进程 , 从操作系统申请一大块内存区域, 供 java 代码使用 . 申请出的内存 , 进一步划分 , 给出不同的用途 . JVM 内存区域划分 : 堆中存放就是 new 出来的对象. (成员变量) 栈 是用来维护方法之间的调用关系 (局部变量) 元数据区(或者叫方法区) 存放的…

计算机毕设 大数据房价数据分析及可视化 - python 房价分析

文章目录 1 课题背景2 数据爬取2.1 爬虫简介2.2 房价爬取 3 数据可视化分析3.1 ECharts3.2 相关可视化图表 4 最后 1 课题背景 房地产是促进我国经济持续增长的基础性、主导性产业。如何了解一个城市的房价的区域分布&#xff0c;或者不同的城市房价的区域差异。如何获取一个城…

自动驾驶与智能网联场地测试一体化装备应用

自动化驾驶层级与结构 L1:能够辅助驾驶员玩车某些驾驶任务制动防抱死系统 (ABS),车身电子稳定系统 (ESP)等,这些配置就是L1级别的运用。 L2:部分自动化,在L2的级别里,必须要具备的是自适应巡航系统,主动车道保持系统自动刹车辅助系统以及自动泊车系统等系统。 L3:有条件…

Qt + QR-Code-generator 生成二维码

0.前言 之前使用 libgrencode 生成二维码&#xff0c;LGPL 协议实在不方便&#xff0c;所以需要找一个 github 星星多的&#xff0c;代码简单最好 header-only&#xff0c;协议最好是 MIT 或者兼容协议而不是 GPL 或者 LPGL。 QR-Code-generator 正好符合这个要求&#xff0c…

Linux和Shell笔记-1相关概念理解

Unix和Linux关系 UNIX是最早的商业操作系统之一&#xff0c;由贝尔实验室&#xff08;AT&T Bell Laboratories&#xff09;于 1970 年代开发。UNIX 是一个多用户、多任务的操作系统&#xff0c;具有强大的命令行界面和可扩展性。 Linux 是一个开放源代码的类 UNIX 操作系统…

​LeetCode解法汇总931. 下降路径最小和

目录链接&#xff1a; 力扣编程题-解法汇总_分享记录-CSDN博客 GitHub同步刷题项目&#xff1a; https://github.com/September26/java-algorithms 原题链接&#xff1a;力扣 描述&#xff1a; 给你一个 n x n 的 方形 整数数组 matrix &#xff0c;请你找出并返回通过 matr…

小白到运维工程师自学之路 第五十一集 (三剑客之sed)

一、概述 sed是一个流式文本编辑器&#xff0c;可以对文本进行搜索、替换、删除等操作。它是一个非交 互式的命令行工具&#xff0c;通常用于处理大量的文本数据。sed的工作方式是逐行读取输入文 本&#xff0c;按照预定义的命令对每一行进行处理&#xff0c;并输出结果。它…

使用STM32 再实现电动车防盗钥匙扣

实现目标 1. 点击遥控器 A 按键&#xff0c;系统进入警戒模式&#xff0c;一旦检测到震动&#xff08;小偷偷车&#xff09;&#xff0c;则喇叭发出声响报警 2. 点击遥控器 B 按键&#xff0c;系统退出警戒模式&#xff0c;再怎么摇晃系统都不会报警 硬件介绍 1. 震动传感器…

解决uniapp运行手机基座出现的问题

常见的问题&#xff1a;&#xff08;往往在更新编辑器版本后会出现以下问题&#xff09; 问题1.明明已经连接到手机&#xff0c;就是检测不到设备 问题2.同步资源失败&#xff0c;未得到同步资源的授权 解决办法汇总 问题1解决办法&#xff1a; 方法一&#xff1a;进入HBuild…

【socket编程】TCP服务器、UDP服务器、本地套接字【C语言代码实现】

目录 0. 准备知识 0.1 大小端概念 0.2 网络字节序和主机字节序的转换 0.3 点分十进制串转换&#xff08;IP地址转换函数&#xff09; 0.4 IPV4结构体&#xff1a;&#xff08;man 7 ip&#xff09; 0.5 IPV6套接字结构体&#xff1a;&#xff08;man 7 ipv6&#xff09; …

实现跨语言互动:如何在Python中调用Java的JavaParser库解析Java源代码

1、背景 在多语言开发环境中&#xff0c;我们经常需要进行跨语言的操作。有时&#xff0c;我们可能会在Python环境下需要使用Java的库或者功能。这个博客将展示如何在Python中调用Java的JavaParser库来解析Java源代码。 2、需求 在许多软件开发场景中&#xff0c;我们可能需…

【算法与数据结构】239、LeetCode滑动窗口最大值

文章目录 一、题目二、解法三、完整代码 所有的LeetCode题解索引&#xff0c;可以看这篇文章——【算法和数据结构】LeetCode题解。 一、题目 二、解法 思路分析&#xff1a;这道题我们如果用暴力破解法需要 O ( n ∗ k ) O(n*k) O(n∗k)的复杂度。思索再三&#xff0c;我们需要…

【新版系统架构】第十九章-大数据架构设计理论与实践

大数据处理系统架构 大数据处理系统面临挑战 如何利用信息技术等手段处理非结构化和半结构化数据如何探索大数据复杂性、不确定性特征描述的刻画方法及大数据的系统建模数据异构性与决策异构性的关系对大数据知识发现与管理决策的影响 大数据处理系统架构特征 鲁棒性和容错…

【基于FPGA的芯片设计】RISC-V的20条指令CPU设计

实验板卡&#xff1a;xc7a100tlc sg324-2L&#xff0c;共20个开关 实验要求&#xff1a;