ELFK日志分析系统之搭建ELF+Filebeaat+Zookeeper+Kafka

引言

结合前面所学

http://ELK日志分析系统

一、为什么要做日志分析平台

随着业务量的增长,每天业务服务器将会产生上亿条的日志,单个日志文件达几个GB,这时我们发现用Linux自带工具,cat grep awk 分析越来越力不从心了,而且除了服务器日志,还有程序报错日志,分布在不同的服务器,查阅繁琐。

待解决的痛点:

  1. 大量不同种类的日志成为了运维人员的负担,不方便管理;
  2. 单个日志文件巨大,无法使用常用的文本工具分析,检索困难;
  3. 日志分布在多台不同的服务器上,业务一旦出现故障,需要一台台查看日志。

二、ELK+Filebeat+Zookeeper+Kafka架构

整体的架构如上图所示

这个架构图从左到右,总共分为5层,每层实现的功能和含义分别介绍如下:

第一层、数据采集层

  • 数据采集层位于最左边的业务服务器集群上,在每个业务服务器上面安装了filebeat做日志收集,然后把采集到的原始日志发送到Kafka+zookeeper集群上。

第二层、消息队列层

  • 原始日志发送到Kafka+zookeeper集群上后,会进行集中存储,此时,filbeat是消息的生产者,存储的消息可以随时被消费。

第三层、数据分析层

  • Logstash作为消费者,会去Kafka+zookeeper集群节点实时拉取原始日志,然后将获取到的原始日志根据规则进行分析、清洗、过滤,最后将清洗好的日志转发至Elasticsearch集群。

第四层、数据持久化存储

  • Elasticsearch集群在接收到logstash发送过来的数据后,执行写磁盘,建索引库等操作,最后将结构化的数据存储到Elasticsearch集群上。

第五层、数据查询、展示层

  • Kibana是一个可视化的数据展示平台,当有数据检索请求时,它从Elasticsearch集群上读取数据,然后进行可视化出图和多维度分析。

三、搭建ELK+Filebeat+Zookeeper+Kafka

1、环境准备

服务器ip地址节点名称安装组件
192.168.10.100node1 Elasticsearch 、Kibana
192.168.10.101node2Elasticsearch
192.168.10.102logstashlogstash、Apache
192.168.10.103filebeatfilebeat
192.168.10.104zk+kfk1zookeeper、Kafka
192.168.10.105zk+kfk2zookeeper、Kafka

 所有服务器关闭防火墙以及核心防护

systemctl stop firewalld
setenforce 0

修改主机名

##第一台
[root@localhost ~]#hostnamectl set-hostname node1
[root@localhost ~]#bash##第二台
[root@localhost ~]#hostnamectl set-hostname node2
[root@localhost ~]#bash##第三台
[root@localhost ~]#hostnamectl set-hostname logstash
[root@localhost ~]#bash##第四台
[root@localhost ~]#hostnamectl set-hostname filebeat
[root@localhost ~]#bash##第五台
[root@localhost ~]#hostnamectl set-hostname zk-kfk1
[root@localhost ~]#bash##第六台
[root@localhost ~]#hostnamectl set-hostname zk-kfk2
[root@localhost ~]#bash

配置域名解析

echo "192.168.10.100 node1" > /etc/hosts
echo "192.168.10.101 node2" > /etc/hosts
echo "192.168.10.102 logstash" > /etc/hosts
echo "192.168.10.103 filebeat" > /etc/hosts
echo "192.168.10.104 zk-kfk1" > /etc/hosts
echo "192.168.10.105 zk-kfk2" > /etc/hosts

查看java环境

##java -version
openjdk version "1.8.0_131"
OpenJDK Runtime Environment (build 1.8.0_131-b12)
OpenJDK 64-Bit Server VM (build 25.131-b12, mixed mode)

2、部署ElasticSearch(在node1、node2节点上)

两台同时操作

1.安装ElasticSearch的rpm包,并解压

#上传elasticsearch-5.5.0.rpm到/opt目录下
cd /opt
rz -E
rpm -ivh elasticsearch-5.5.0.rpm  ##解压

2.加载服务系统并开启开机自启

systemctl daemon-reload                   ##加载服务
systemctl enable elasticsearch.service    ##设置开机自启服务

3.修改ElasticSearch主配置文件

[root@node1 opt]#cp /etc/elasticsearch/elasticsearch.yml /etc/elasticsearch/elasticsearch.yml.bak              ##先进性备份
[root@node1 opt]#vim /etc/elasticsearch/elasticsearch.yml   ###修改elasticsearch主配置文件cluster.name: my-elk-cluster             ##第17行, 取消注释,指定集群名字
node.name: node1                         ##第23行, 取消注释,指定节点名字:Node1节点为node1,Node2节点为node2
path.data: /data/elk_data                ##第33行, 取消注释,指定数据存放路径
path.logs: /var/log/elasticsearch/       ##第37行, 取消注释,指定日志存放路径
bootstrap.memory_lock: false             ##第43行, 取消注释,改为在启动的时候不锁定内存
network.host: 0.0.0.0                    ##第55行, 取消注释,设置监听地址,0.0.0.0代表所有地址
http.port: 9200                          ##第59行, 取消注释,ES 服务的默认监听端口为9200
discovery.zen.ping.unicast.hosts: ["node1", "node2"]       ##第68行, 集群发现通过单播实现,指定要发现的节点 node1、node2[root@node1 opt]#grep -v "^#" /etc/elasticsearch/elasticsearch.yml
cluster.name: my-elk-cluster
node.name: node1
path.data: /data/elk_data
path.logs: /var/log/elasticsearch/
bootstrap.memory_lock: false
network.host: 0.0.0.0
http.port: 9200
discovery.zen.ping.unicast.hosts: ["node1", "node2"]

4.创建数据存放路径并授权,启动服务并查看端口是否开启

mkdir -p /data/elk_data                                ##创建数据存放路径
chown elasticsearch:elasticsearch  /data/elk_data/     ##给数据存放路径赋予权限
systemctl start elasticsearch.service                  ##启动比较慢,需要等待
netstat -natp | grep 9200                              ##过滤端口
tcp6       0      0 :::9200                 :::*                    LISTEN      37606/java

5.查看节点信息

浏览器访问  http://192.168.10.100:9200  、 http://192.168.10.101:9200 查看节点 Node1、Node2 的信息。浏览器访问 http://192.168.10.100:9200/_cluster/health?pretty  、 http://192.168.10.101:9200/_cluster/health?pretty查看群集的健康情况,可以看到 status 值为 green(绿色), 表示节点健康运行。#使用上述方式查看群集的状态对用户并不友好,可以通过安装 Elasticsearch-head 插件,可以更方便地管理群集。绿色:健康  数据和副本 全都没有问题
红色:数据都不完整
黄色:数据完整,但副本有问题

3、安装ElasticSearch-head插件(在node1节点上操作)

1.编译安装node1

#上传软件包 node-v8.2.1.tar.gz 到/opt
yum install gcc gcc-c++ make -y
cd /opt
rz -E
tar zxvf node-v8.2.1.tar.gz
cd node-v8.2.1/
./configure
make -j4 && make install

2.安装phantomjs(前端框架)

[root@node1 opt]#ls
elasticsearch-5.5.0.rpm    kibana-5.5.1-x86_64.rpm  node-v8.2.1.tar.gz                    rh
elasticsearch-head.tar.gz  node-v8.2.1              phantomjs-2.1.1-linux-x86_64.tar.bz2
[root@node1 opt]#tar  jxf phantomjs-2.1.1-linux-x86_64.tar.bz2 -C /usr/local/src/
[root@node1 opt]#cd /usr/local/src/phantomjs-2.1.1-linux-x86_64/bin/
[root@node1 bin]#ls
phantomjs
[root@node1 bin]#cp phantomjs  /usr/local/bin/

3.安装ElasticSearch-head数据可视化工具

[root@node1 opt]#ls
elasticsearch-5.5.0.rpm    kibana-5.5.1-x86_64.rpm  node-v8.2.1.tar.gz                    rh
elasticsearch-head.tar.gz  node-v8.2.1              phantomjs-2.1.1-linux-x86_64.tar.bz2
[root@node1 opt]#tar xf elasticsearch-head.tar.gz -C /usr/local/src/
[root@node1 opt]#cd /usr/local/src/elasticsearch-head/
[root@node1 elasticsearch-head]#ls
Dockerfile                          Gruntfile.js       LICENCE       package-lock.json             README.textile  test
Dockerfile-alpine                   grunt_fileSets.js  node_modules  plugin-descriptor.properties  _site
elasticsearch-head.sublime-project  index.html         package.json  proxy                         src
[root@node1 elasticsearch-head]#npm install
npm WARN deprecated fsevents@1.2.13: The v1 package contains DANGEROUS / INSECURE binaries. Upgrade to safe fsevents v2
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/karma/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN elasticsearch-head@0.0.0 license should be a valid SPDX license expressionup to date in 5.63s

4.修改ElasticSearch主配置文件

[root@node1 opt]#vim /etc/elasticsearch/elasticsearch.yml      ##修改 Elasticsearch 主配置文件--末尾添加以下内容--
http.cors.enabled: true				#开启跨域访问支持,默认为 false
http.cors.allow-origin: "*"			#指定跨域访问允许的域名地址为所有systemctl restart elasticsearch     ##重启elasticsearch服务

5.启动ElasticSearch-head服务

#必须在解压后的 elasticsearch-head 目录下启动服务,进程会读取该目录下的 gruntfile.js 文件,否则可能启动失败。
cd /usr/local/src/elasticsearch-head/
npm run start &> elasticsearch-head@0.0.0 start /usr/local/src/elasticsearch-head
> grunt serverRunning "connect:server" (connect) task
Waiting forever...
Started connect web server on http://localhost:9100#elasticsearch-head 监听的端口是 9100
ss -natp |grep 9100

6.通过ELasticSearch-head查看ElasticSearch信息

通过浏览器访问 http://192.168.10.100:9100/ 地址并连接群集。
如果看到群集健康值为 green 绿色,代表群集很健康。
注意:有的时候显示未连接,这时将 localhost 改成 IP 地址即可

7.插入索引

#通过命令插入一个测试索引,索引为 index-demo,类型为 test。
curl -X PUT 'localhost:9200/index-demo1/test/1?pretty&pretty' -H 'content-Type: application/json' -d '{"user":"zhangsan","mesg":"hello world"}'//输出结果如下:
{
"_index" : "index-demo",
"_type" : "test",
"_id" : "1",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 2,
"failed" : 0
},
"created" : true
}

8.浏览器查看索引信息

浏览器访问 http://192.168.10.100:9100/ 查看索引信息,
可以看见索引默认被分片5个,并且有一个副本。
点击“数据浏览”,会发现在node1上创建的索引为 index-demo,类型为 test 的相关信息。

4、ELK Logstash部署(在APache节点上操作)

1.安装Apache服务(httpd)

yum install httpd -y   ##安装Apache服务

2.安装java环境

[root@logstash opt]#java -version
openjdk version "1.8.0_131"
OpenJDK Runtime Environment (build 1.8.0_131-b12)
OpenJDK 64-Bit Server VM (build 25.131-b12, mixed mode)

3.安装Logstash

[root@logstash ~]#cd /opt/
[root@logstash opt]#rz -E
rz waiting to receive.
[root@logstash opt]#ls
logstash-5.5.1.rpm  rh
[root@logstash opt]#rpm -ivh logstash-5.5.1.rpm 
警告:logstash-5.5.1.rpm: 头V4 RSA/SHA512 Signature, 密钥 ID d88e42b4: NOKEY
准备中...                          ################################# [100%]
正在升级/安装...1:logstash-1:5.5.1-1               ################################# [100%]
Using provided startup.options file: /etc/logstash/startup.options
Successfully created system startup script for Logstash[root@logstash opt]#ln -s /usr/share/logstash/bin/logstash  /usr/local/bin/    ##做软链接

4.测试Logstash

[root@logstash ~]#systemctl start logstash.service        ##首先开启服务
[root@logstash ~]#systemctl enable logstash.service
[root@logstash ~]#systemctl status logstash.service 
● logstash.service - logstashLoaded: loaded (/etc/systemd/system/logstash.service; disabled; vendor preset: disabled)Active: active (running) since 三 2024-04-10 22:42:12 CST; 3s agoMain PID: 5783 (java)CGroup: /system.slice/logstash.service└─5783 /usr/bin/java -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+U...4月 10 22:42:12 logstash systemd[1]: Started logstash.
4月 10 22:42:12 logstash systemd[1]: Starting logstash...
##定义输入和输出流:
##输入采用标准输入,输出采用标准输出(类似管道)
##logstash -e 'input { stdin{} } output { stdout{} }'[root@logstash ~]#logstash -e 'input { stdin{} } output { stdout{} }'
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
WARNING: Could not find logstash.yml which is typically located in $LS_HOME/config or /etc/logstash. You can specify the path using --path.settings. Continuing using the defaults
Could not find log4j2 configuration at path //usr/share/logstash/config/log4j2.properties. Using default config which logs to console
22:45:31.013 [main] INFO  logstash.setting.writabledirectory - Creating directory {:setting=>"path.queue", :path=>"/usr/share/logstash/data/queue"}
22:45:31.016 [main] INFO  logstash.setting.writabledirectory - Creating directory {:setting=>"path.dead_letter_queue", :path=>"/usr/share/logstash/data/dead_letter_queue"}
22:45:31.043 [LogStash::Runner] INFO  logstash.agent - No persistent UUID file found. Generating new UUID {:uuid=>"c93492d0-eb1a-4fb2-a962-69e4952cbc77", :path=>"/usr/share/logstash/data/uuid"}
22:45:31.203 [[main]-pipeline-manager] INFO  logstash.pipeline - Starting pipeline {"id"=>"main", "pipeline.workers"=>4, "pipeline.batch.size"=>125, "pipeline.batch.delay"=>5, "pipeline.max_inflight"=>500}
22:45:31.259 [[main]-pipeline-manager] INFO  logstash.pipeline - Pipeline main started
The stdin plugin is now waiting for input:
22:45:31.328 [Api Webserver] INFO  logstash.agent - Successfully started Logstash API endpoint {:port=>9600}www.baidu.com
2024-04-10T14:47:32.349Z logstash www.baidu.com
rubydebug 输出:
#使用 rubydebug 输出详细格式显示,codec 为一种编解码器
logstash -e 'input { stdin{} } output { stdout{ codec=>rubydebug } }'[root@logstash ~]#logstash -e 'input { stdin{} } output { stdout{ codec=>rubydebug } }'
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
WARNING: Could not find logstash.yml which is typically located in $LS_HOME/config or /etc/logstash. You can specify the path using --path.settings. Continuing using the defaults
Could not find log4j2 configuration at path //usr/share/logstash/config/log4j2.properties. Using default config which logs to console
22:55:57.519 [[main]-pipeline-manager] INFO  logstash.pipeline - Starting pipeline {"id"=>"main", "pipeline.workers"=>4, "pipeline.batch.size"=>125, "pipeline.batch.delay"=>5, "pipeline.max_inflight"=>500}
22:55:57.538 [[main]-pipeline-manager] INFO  logstash.pipeline - Pipeline main started
The stdin plugin is now waiting for input:
22:55:57.621 [Api Webserver] INFO  logstash.agent - Successfully started Logstash API endpoint {:port=>9600}
www.baidu.com
{"@timestamp" => 2024-04-10T14:56:14.400Z,"@version" => "1","host" => "logstash","message" => "www.baidu.com"
}
输出到 ES:
#使用 Logstash 将信息写入 Elasticsearch 中
logstash -e 'input { stdin{} } output { elasticsearch { hosts=>["192.168.10.100:9200"] } }'
[root@logstash ~]#logstash -e 'input { stdin{} } output { elasticsearch { hosts=>["192.168.10.100:9200"] } }'
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
WARNING: Could not find logstash.yml which is typically located in $LS_HOME/config or /etc/logstash. You can specify the path using --path.settings. Continuing using the defaults
Could not find log4j2 configuration at path //usr/share/logstash/config/log4j2.properties. Using default config which logs to console
23:13:22.928 [[main]-pipeline-manager] INFO  logstash.outputs.elasticsearch - Elasticsearch pool URLs updated {:changes=>{:removed=>[], :added=>[http://192.168.10.100:9200/]}}
23:13:22.931 [[main]-pipeline-manager] INFO  logstash.outputs.elasticsearch - Running health check to see if an Elasticsearch connection is working {:healthcheck_url=>http://192.168.10.100:9200/, :path=>"/"}
23:13:23.004 [[main]-pipeline-manager] WARN  logstash.outputs.elasticsearch - Restored connection to ES instance {:url=>#<Java::JavaNet::URI:0x65334761>}
23:13:23.005 [[main]-pipeline-manager] INFO  logstash.outputs.elasticsearch - Using mapping template from {:path=>nil}
23:13:23.238 [[main]-pipeline-manager] INFO  logstash.outputs.elasticsearch - Attempting to install template {:manage_template=>{"template"=>"logstash-*", "version"=>50001, "settings"=>{"index.refresh_interval"=>"5s"}, "mappings"=>{"_default_"=>{"_all"=>{"enabled"=>true, "norms"=>false}, "dynamic_templates"=>[{"message_field"=>{"path_match"=>"message", "match_mapping_type"=>"string", "mapping"=>{"type"=>"text", "norms"=>false}}}, {"string_fields"=>{"match"=>"*", "match_mapping_type"=>"string", "mapping"=>{"type"=>"text", "norms"=>false, "fields"=>{"keyword"=>{"type"=>"keyword", "ignore_above"=>256}}}}}], "properties"=>{"@timestamp"=>{"type"=>"date", "include_in_all"=>false}, "@version"=>{"type"=>"keyword", "include_in_all"=>false}, "geoip"=>{"dynamic"=>true, "properties"=>{"ip"=>{"type"=>"ip"}, "location"=>{"type"=>"geo_point"}, "latitude"=>{"type"=>"half_float"}, "longitude"=>{"type"=>"half_float"}}}}}}}}
23:13:23.253 [[main]-pipeline-manager] INFO  logstash.outputs.elasticsearch - New Elasticsearch output {:class=>"LogStash::Outputs::ElasticSearch", :hosts=>[#<Java::JavaNet::URI:0x67ed24a3>]}
23:13:23.285 [[main]-pipeline-manager] INFO  logstash.pipeline - Starting pipeline {"id"=>"main", "pipeline.workers"=>4, "pipeline.batch.size"=>125, "pipeline.batch.delay"=>5, "pipeline.max_inflight"=>500}
The stdin plugin is now waiting for input:
23:13:23.420 [[main]-pipeline-manager] INFO  logstash.pipeline - Pipeline main started
23:13:23.541 [Api Webserver] INFO  logstash.agent - Successfully started Logstash API endpoint {:port=>9600}

5.定义Logstash配置文件

#修改 Logstash 配置文件,让其收集系统日志/var/log/messages,并将其输出到 elasticsearch 中。
chmod +r /var/log/messages					#让 Logstash 可以读取日志vim /etc/logstash/conf.d/system.conf                #该文件需自行创建,文件名可自定义
input {file{path =>"/var/log/messages"						#指定要收集的日志的位置type =>"system"									#自定义日志类型标识start_position =>"beginning"					#表示从开始处收集}
}
output {elasticsearch {										#输出到 elasticsearchhosts => [ "192.168.10.100:9200" ]	#指定 elasticsearch 服务器的地址和端口index =>"system-%{+YYYY.MM.dd}"					#指定输出到 elasticsearch 的索引格式}
}systemctl restart logstash 

6.浏览器访问查看索引信息

浏览器访问 http://192.168.79.26:9100 查看索引信息

5、ELK Kibana部署(在node1节点上操作)

1.安装Kibana

下载地址:https://www.elastic.co/cn/downloads/past-releases/kibana-5-5-1
[root@node1 ~]#cd /opt/
[root@node1 opt]#ls
elasticsearch-5.5.0.rpm    kibana-5.5.1-x86_64.rpm  node-v8.2.1.tar.gz                    rh
elasticsearch-head.tar.gz  node-v8.2.1              phantomjs-2.1.1-linux-x86_64.tar.bz2
[root@node1 opt]#rpm -ivh kibana-5.5.1-x86_64.rpm 
警告:kibana-5.5.1-x86_64.rpm: 头V4 RSA/SHA512 Signature, 密钥 ID d88e42b4: NOKEY
准备中...                          ################################# [100%]
正在升级/安装...1:kibana-5.5.1-1                   ################################# [100%]

2.设置Kibana的主配置文件

cp /etc/kibana/kibana.yml /etc/kibana/kibana.yml.bak ##给匹配值文件做备份
vim /etc/kibana/kibana.yml                           ##设置 Kibana 的主配置文件
---------------------------------------------------------------------------------------------
server.port: 5601                                    ##第2行, 取消注释,Kiabana 服务的默认监听端口为5601
server.host: "0.0.0.0"                               ##第7行, 取消注释,设置 Kiabana 的监听地址,0.0.0.0代表所有地址
elasticsearch.url: "http://192.168.10.100:9200"      ##第21行,取消注释,设置和 Elasticsearch 建立连接的地址和端口
kibana.index: ".kibana"                              ##第30行,取消注释,设置在 elasticsearch 中添加.kibana索引

3.启动Kibana服务

[root@node1 opt]#systemctl start kibana.service 
[root@node1 opt]#systemctl enable kibana.service 
Created symlink from /etc/systemd/system/multi-user.target.wants/kibana.service to /etc/systemd/system/kibana.service.
[root@node1 opt]#lsof -i:5601
COMMAND  PID   USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
node    2332 kibana   11u  IPv4  32050      0t0  TCP *:esmagent (LISTEN)
[root@node1 opt]#netstat -natp | grep 5601
tcp        0      0 0.0.0.0:5601            0.0.0.0:*               LISTEN      2332/node

4.验证Kibana

浏览器访问 http://192.168.10.100:5601

5.将Apache服务器的日志(访问的、错误的)添加到ES并通过Kibana显示

[root@logstash ~]#systemctl status httpd.service
[root@logstash ~]#systemctl start httpd.service 
[root@logstash ~]#systemctl status httpd.service
[root@logstash conf.d]#vim /etc/logstash/conf.d/apache_log.conffile {path => "/etc/httpd/logs/access_log"type => "access"start_position => "beginning"} file {path => "/etc/httpd/logs/error_log"type => "error"start_position => "beginning"} 
} output {if [type] == "access" {elasticsearch {hosts => ["192.168.10.100:9200"]index => "apache_access-%{+YYYY.MM.dd}"} } if [type] == "error" {elasticsearch {hosts => ["192.168.10.100:9200"]index => "apache_error-%{+YYYY.MM.dd}"} } 
} 
cd /etc/logstash/conf.d/
/usr/share/logstash/bin/logstash -f apache_log.conf

6.浏览器访问 http://192.168.10.100:9100 查看索引是否创建

需要访问Apache页面,才会出现access

7.浏览器访问 http://192.168.10.100:5601 登录 Kibana

敬请期待后续

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

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

相关文章

2024.4.17 Python爬虫复习day05 可视化

day05_数据可视化和程序日志 准备web服务器 注意: 记得把source资源到项目中 # 1.导包 from fastapi import FastAPI from fastapi import Response import uvicorn# 2.创建对象 app FastAPI()# 3.使用对象接收浏览器请求,并且使用对象给浏览器响应资源 # 注意: get中传入请求…

【Linux】序列化与反序列化{服客编程/守护进程/JSON}

文章目录 1.引入2. 静态成员函数3.TCP&#xff1a;传输控制协议4.守护进程4.0前台进程4.1介绍4.2认识4.3会话4.3ps axj4.4理解4.5/dev/null4.6守护进程和孤儿进程 5.JSON6.完整代码6.1Makefile6.2Socket.hpp6.3Protocol.hpp6.4Log.hpp6.5Daemon.hpp6.6TcpServer.hpp6.7Client.c…

Spring高手之路17——动态代理的艺术与实践

文章目录 1. 背景2. JDK动态代理2.1 定义和演示2.2 不同方法分别代理2.3 熔断限流和日志监控 3. CGLIB动态代理3.1 定义和演示3.2 不同方法分别代理&#xff08;对比JDK动态代理写法&#xff09;3.3 熔断限流和日志监控&#xff08;对比JDK动态代理写法&#xff09; 4. 动态代理…

基于ssm的智慧餐厅点餐管理系统设计与实现(java项目+文档+元)

风定落花生&#xff0c;歌声逐流水&#xff0c;大家好我是风歌&#xff0c;混迹在java圈的辛苦码农。今天要和大家聊的是一款基于ssm的智慧餐厅点餐管理系统。项目源码以及部署相关请联系风歌&#xff0c;文末附上联系信息 。 项目简介&#xff1a; 智慧餐厅点餐管理系统设计…

使用JAXB实现JavaBean与XML互相转换

JAXB 注解列表 注解使用范围描述XmlAccessorOrder包、类控制类中字段和属性的顺序。XmlAccessorType包、类此注释提供对类中属性和字段的默认序列化的控制。XmlRootElement类、枚举将类或枚举类型映射到XML元素。此注释可与以下注释一起使用&#xff1a;XmlType、XmlEnum、Xml…

踩了一堆坑,终于掌握了postgreSQL主从流的精髓

&#x1f4e2;&#x1f4e2;&#x1f4e2;&#x1f4e3;&#x1f4e3;&#x1f4e3; 哈喽&#xff01;大家好&#xff0c;我是【IT邦德】&#xff0c;江湖人称jeames007&#xff0c;10余年DBA及大数据工作经验 一位上进心十足的【大数据领域博主】&#xff01;&#x1f61c;&am…

C++:运算符与表达式 (信奥赛练习)

运算符与表达式 1. 运算符基本算术运算符赋值运算符比较运算符逻辑运算符 2. 表达式算术表达式逻辑表达式赋值表达式总结 1. 运算符 运算符是用于执行特定操作的符号。在编程和数学中&#xff0c;运算符是表达式的重要组成部分。它们可以用于执行加减乘除等基本算术运算&#…

vue3中覆盖组件样式的方法

在 Vue 3 中&#xff0c;覆盖组件样式的方法与 Vue 2 相似&#xff0c;但由于 Vue 3 更多地依赖于 CSS 的模块化&#xff0c;一些最佳实践可能会有所不同。以下是一些常用的方法来覆盖 Vue 3 中组件的样式&#xff1a; 1. 内联样式 你可以直接在组件的模板中使用 style 属性来…

三年运维开发你还不会编写k8s的资源清单yaml???速度进来学!

三年运维开发你还不会编写k8s的资源清单yaml&#xff1f;&#xff1f;&#xff1f;速度进来学&#xff01; 在Kubernetes&#xff08;K8s&#xff09;中&#xff0c;YAML文件是用于描述集群资源&#xff08;如Pod、Service、Deployment等&#xff09;的常用方式。通过编写和操…

gerrit 拉取失败

在浏览器gerrit的设置界面设置的邮箱地址和在命令行使用git config --gloable user.email设置的邮箱地址必须保持一致吗 在浏览器gerrit的设置界面设置的邮箱地址和在命令行使用git config --global user.email设置的邮箱地址并不一定需要保持一致。这两个邮箱地址是独立的&am…

【数据结构】4.List的介绍

目录 1.什么是List 2.常见接口介绍 3.List的使用 1.什么是List 在集合框架中&#xff0c;List是一个接口&#xff0c;继承自Collection。 Collection也是一个接口&#xff0c;该接口中规范了后序容器中常用的一些方法&#xff0c;具体如下&#xff1a; Iterable也是一个接口…

syscall的检测与绕过(下)

syscall的检测与绕过 ntdll中syscall被执行的格式大致 我们可以通过检测mov r10, rcx类似的代码来确定程序是否直接进行系统调用。 但是很容易被bypass 而且还可以写出很多不一样的写法&#xff0c;显然这个方式是不行的。很轻易就会被bypass。 当然也可以检测syscall指令&a…

UDTF函数 explode

场景&#xff1a; 原hive数据形式 split 处理到一个Array 形式 使用explode炸开后的效果是 explode结合侧面视图达到targeType 目标形式&#xff1a; 一进多出 explode 将hive 中复杂的 array 炸成多行 因为炸开后&#xff0c; movie 列值少于categoryname 列所以这里为了达到…

朴素模式匹配算法

什么是字符串的模式匹配&#xff1f; 字符串模式匹配:在主串中找到与模式串相同的字串&#xff0c;并返回其所在位置 算法思想&#xff1a; 算法思想为:从主串S的第一个字符起&#xff0c;与模式串T的第一个字符比较,若相等&#xff0c;则继续逐个比较后续字符;否则从主串的下一…

Windows环境下删除MySQL

文章目录 一、关闭MySQL服务1、winR打开运行&#xff0c;输入services.msc回车2、服务里找到MySQL并停止 二、卸载MySQL软件1、打开控制模板--卸载程序--卸载MySQL相关的所有组件 三、删除MySQL在物理硬盘上的所有文件1、删除MySQL的安装目录&#xff08;默认在C盘下的Program …

多线程代码案例之阻塞队列

目录 1.生产者消费者模型 2.使用标准库中的阻塞队列 3.模拟实现阻塞队列 在介绍阻塞队列之前&#xff0c;会先介绍一些前置知识&#xff0c;像队列&#xff1a;有普通队列、优先级队列、阻塞队列、和消息队列。前面两个是线程不安全的&#xff0c;而后面两个是线程安全的。本…

前端如何单独做虚拟奖金池?

公司业务需求要做一个虚拟奖金池&#xff0c;具体是需求是&#xff0c;不需要后端数据支持&#xff0c;但是又需要不同用户看到的奖金池数据每次变动都是一致的&#xff0c;并且要在给定的最小最大值中变动。 一开始看需求&#xff0c;因为需要所有登录/未登录&#xff0c;不同…

全栈的自我修养 ———— react实现滑动验证

实现滑动验证 展示依赖实现不借助create-puzzle借助create-puzzle 展示 依赖 npm install rc-slider-captcha npm install create-puzzleapi地址 实现 不借助create-puzzle 需要准备两张图片一个是核验图形&#xff0c;一个是原图------> 这个方法小编试了后感觉比较麻烦…

【七 (1)FineBI FCP模拟试卷-股票收盘价分析】

目录 文章导航一、字段解释二、需求三、操作步骤1、添加计算字段&#xff08;每月最后一天的收盘价&#xff09;2、绘制折线图 文章导航 【一 简明数据分析进阶路径介绍&#xff08;文章导航&#xff09;】 一、字段解释 Company Name&#xff1a;公司名称 Date&#xff1a;…

【vue】绑定事件 v-on

v-on 简写&#xff1a; clickkeyupkeydownkeyup.wkeyup.ctrl.a <!DOCTYPE html> <html lang"en"><head><meta charset"UTF-8"><meta name"viewport" content"widthdevice-width, initial-scale1.0"><…