docker-compose部署elk(8.9.0)并开启ssl认证

news2024/11/29 20:31:09

docker部署elk并开启ssl认证

  • docker-compose部署elk
    • 部署所需yml文件 —— docker-compose-elk.yml
    • 部署
    • 配置elasticsearch和kibana并开启ssl
      • 配置基础数据认证
      • 配置elasticsearch和kibana开启https访问
    • 配置logstash
    • 创建springboot项目进行测试
    • kibana创建视图,查询日志

docker-compose部署elk

部署所需yml文件 —— docker-compose-elk.yml

version: '3.7'
services:
  elasticsearch:
    image: elasticsearch:8.9.0
    container_name: elasticsearch
    hostname: elasticsearch
    restart: "no"
    volumes:
      - /opt/space/soft/docker/elasticsearch/data:/usr/share/elasticsearch/data:rw
      - /opt/space/soft/docker/elasticsearch/config:/usr/share/elasticsearch/config:rw
      - /opt/space/soft/docker/elasticsearch/logs:/usr/share/elasticsearch/logs:rw
      - /opt/space/soft/docker/elasticsearch/plugins:/usr/share/elasticsearch/plugins:rw
    ports:
      - "21033:9200"
      - "21133:9300"
    networks:
      elastic:
        aliases:
          - elasticsearch

  kibana:
    image: kibana:8.9.0
    container_name: kibana
    hostname: kibana
    restart: "no"
    volumes:
      - /opt/space/soft/docker/kibana/data:/usr/share/kibana/data:rw
      - /opt/space/soft/docker/kibana/config:/usr/share/kibana/config:rw
      - /opt/space/soft/docker/kibana/logs:/usr/share/kibana/logs:rw
    ports:
      - 21041:5601
    depends_on:
      - elasticsearch
    networks:
      elastic:
        aliases:
          - kibana
          
  logstash:
    image: logstash:8.9.0
    container_name: logstash
    hostname: logstash
    restart: "no"
    volumes:
      - /opt/space/soft/docker/logstash/config:/usr/share/logstash/config:rw
      - /opt/space/soft/docker/logstash/logs:/usr/share/logstash/logs:rw
      - /opt/space/soft/docker/logstash/pipeline:/usr/share/logstash/pipeline:rw
    ports:
      - 21066:5044
      - 21067:9066
      - 21068:21068
    depends_on:
      - elasticsearch
    networks:
      elastic:
        aliases:
          - logstash


networks:
  elastic:
    name: elastic
    driver: bridge

这里做了端口映射以及挂载数据卷。

部署

1.使用docker-compose命令部署

docker-compose -f docker-compose-elk.yml up -d

部署前需要先将挂载的数据卷注释掉,用于拷贝配置文件到本地磁盘
部署前需要先将挂载的数据卷注释掉,用于拷贝配置文件到本地磁盘

  1. 创建所需目录,拷贝配置文件到本地,并设置读写权限为 777
cd /opt/space/soft/docker/
sudo mkdir -p elasticsearch/{config,data,logs,plugins}
sudo mkdir -p kibana/{config,data,logs}
sudo mkdir -p logstash/{config,pipeline,logs}

sudo docker cp elasticsearch:/usr/share/elasticsearch/config ./elasticsearch/
sudo docker cp kibana:/usr/share/kibana/config ./kibana/
sudo docker cp  logstash:/usr/share/logstash/config ./logstash/
sudo docker cp  logstash:/usr/share/logstash/pipeline ./logstash/

sudo chmod 777 -R /opt/space/soft/docker/elasticsearch/*
sudo chmod 777 -R /opt/space/soft/docker/kibana/*
sudo chmod 777 -R /opt/space/soft/docker/logstash/*
  1. 修改jvm参数(作者电脑配置不够高,所以需要进行修改)
    3.1 修改elasticsearch的jvm参数
    打开/opt/space/soft/docker/elasticsearch/config/jvm.options文件,按图中所示进行配置。
    修改elasticsearch的jvm参数
    3.2 修改logstash的jvm参数
    打开/opt/space/soft/docker/logstash/config/jvm.options文件,按图中所示进行配置。
    修改logstash的jvm参数
  2. 放开docker-compose-elk.yml文件内挂载数据卷的注释,并执行下列命令。
docker-compose  -f docker-compose-elk.yml stop
docker-compose  -f docker-compose-elk.yml rm
docker-compose  -f docker-compose-elk.yml up -d

配置elasticsearch和kibana并开启ssl

配置基础数据认证

参考文档

  1. 进入elasticsearch的docker容器内
docker exec -it elasticsearch bash
  1. 生成elastic-stack-ca.p12
./bin/elasticsearch-certutil ca

命令示意图

  1. 生成elastic-certificates.p12
./bin/elasticsearch-certutil cert --ca elastic-stack-ca.p12

命令示意图
4. 拷贝elastic-certificates.p12到目录/usr/share/elasticsearch/config/certs,删除elastic-stack-ca.p12

mv elastic-certificates.p12 config/certs/
mv elastic-stack-ca.p12 ./config/

elastic-stack-ca.p12文件保留下来,后面有用

5.设置elasticsearch.yml配置文件
安装如图所示进行修改

xpack.security.transport.ssl:
  enabled: true
  verification_mode: certificate
  keystore.path: certs/elastic-certificates.p12
  truststore.path: certs/elastic-certificates.p12

按照如图所示修改
6.如果certificate设置了密码,需要执行一下两个命令

./bin/elasticsearch-keystore add xpack.security.transport.ssl.keystore.secure_password

./bin/elasticsearch-keystore add xpack.security.transport.ssl.truststore.secure_password

命令1示意图
命令2示意图

此处可能出现以下错误,需要退出容器,给提示的文件设置所属用户

sudo chown linux当前登录用户名 elasticsearch/config/elasticsearch.keystore

注意点

  1. 退出elasticsearch容器,给certificates文件赋予777权限
sudo chmod 777 elasticsearch/config/certs/elastic-certificates.p12 
  1. 重启elasticsearch容器
docker restart elasticsearch

配置elasticsearch和kibana开启https访问

参考文档

  1. 再次进入elasticsearch的docker容器内
docker exec -it elasticsearch bash
  1. 生成elasticsearch-ssl-http.zip

命令所需操作过长,此处不在截图

elasticsearch@elasticsearch:~$ ./bin/elasticsearch-certutil http

## Elasticsearch HTTP Certificate Utility

The 'http' command guides you through the process of generating certificates
for use on the HTTP (Rest) interface for Elasticsearch.

This tool will ask you a number of questions in order to generate the right
set of files for your needs.

## Do you wish to generate a Certificate Signing Request (CSR)?

A CSR is used when you want your certificate to be created by an existing
Certificate Authority (CA) that you do not control (that is, you don't have
access to the keys for that CA). 

If you are in a corporate environment with a central security team, then you
may have an existing Corporate CA that can generate your certificate for you.
Infrastructure within your organisation may already be configured to trust this
CA, so it may be easier for clients to connect to Elasticsearch if you use a
CSR and send that request to the team that controls your CA.

If you choose not to generate a CSR, this tool will generate a new certificate
for you. That certificate will be signed by a CA under your control. This is a
quick and easy way to secure your cluster with TLS, but you will need to
configure all your clients to trust that custom CA.

## 生成CSR 输入n
Generate a CSR? [y/N]n

## Do you have an existing Certificate Authority (CA) key-pair that you wish to use to sign your certificate?

If you have an existing CA certificate and key, then you can use that CA to
sign your new http certificate. This allows you to use the same CA across
multiple Elasticsearch clusters which can make it easier to configure clients,
and may be easier for you to manage.

If you do not have an existing CA, one will be generated for you.

## 是否使用存在的ca 输入y(在基础配置时生成了)
Use an existing CA? [y/N]y

## What is the path to your CA?

Please enter the full pathname to the Certificate Authority that you wish to
use for signing your new http certificate. This can be in PKCS#12 (.p12), JKS
(.jks) or PEM (.crt, .key, .pem) format.
## 输入ca文件的地址
CA Path: /usr/share/elasticsearch/config/elastic-stack-ca.p12
Reading a PKCS12 keystore requires a password.
It is possible for the keystore's password to be blank,
in which case you can simply press <ENTER> at the prompt
## 输入文件设置的密码
Password for elastic-stack-ca.p12:

## How long should your certificates be valid?

Every certificate has an expiry date. When the expiry date is reached clients
will stop trusting your certificate and TLS connections will fail.

Best practice suggests that you should either:
(a) set this to a short duration (90 - 120 days) and have automatic processes
to generate a new certificate before the old one expires, or
(b) set it to a longer duration (3 - 5 years) and then perform a manual update
a few months before it expires.

You may enter the validity period in years (e.g. 3Y), months (e.g. 18M), or days (e.g. 90D)

## 设置过期时间
For how long should your certificate be valid? [5y] 5y

## Do you wish to generate one certificate per node?

If you have multiple nodes in your cluster, then you may choose to generate a
separate certificate for each of these nodes. Each certificate will have its
own private key, and will be issued for a specific hostname or IP address.

Alternatively, you may wish to generate a single certificate that is valid
across all the hostnames or addresses in your cluster.

If all of your nodes will be accessed through a single domain
(e.g. node01.es.example.com, node02.es.example.com, etc) then you may find it
simpler to generate one certificate with a wildcard hostname (*.es.example.com)
and use that across all of your nodes.

However, if you do not have a common domain name, and you expect to add
additional nodes to your cluster in the future, then you should generate a
certificate per node so that you can more easily generate new certificates when
you provision new nodes.

## 是否为每一个节点生成证书 输入n
Generate a certificate per node? [y/N]n

## Which hostnames will be used to connect to your nodes?

These hostnames will be added as "DNS" names in the "Subject Alternative Name"
(SAN) field in your certificate.

You should list every hostname and variant that people will use to connect to
your cluster over http.
Do not list IP addresses here, you will be asked to enter them later.

If you wish to use a wildcard certificate (for example *.es.example.com) you
can enter that here.

## 节点的hostname,设置为elasticsearch,敲两次回车
Enter all the hostnames that you need, one per line.
When you are done, press <ENTER> once more to move on to the next step.

elasticsearch

You entered the following hostnames.

 - elasticsearch

## 配置是否正确
Is this correct [Y/n]y

## Which IP addresses will be used to connect to your nodes?

If your clients will ever connect to your nodes by numeric IP address, then you
can list these as valid IP "Subject Alternative Name" (SAN) fields in your
certificate.

If you do not have fixed IP addresses, or not wish to support direct IP access
to your cluster then you can just press <ENTER> to skip this step.

## 节点的ip(可以在宿主机通过命令docker inspect elasticsearch查看),设置为172.27.0.2,敲两次回车
Enter all the IP addresses that you need, one per line.
When you are done, press <ENTER> once more to move on to the next step.

172.27.0.2

You entered the following IP addresses.

 - 172.27.0.2
## 配置是否正确
Is this correct [Y/n]y

## Other certificate options

The generated certificate will have the following additional configuration
values. These values have been selected based on a combination of the
information you have provided above and secure defaults. You should not need to
change these values unless you have specific requirements.

Key Name: elasticsearch
Subject DN: CN=elasticsearch
Key Size: 2048

## 是否更改任意项
Do you wish to change any of these options? [y/N]n

## What password do you want for your private key(s)?

Your private key(s) will be stored in a PKCS#12 keystore file named "http.p12".
This type of keystore is always password protected, but it is possible to use a
blank password.

If you wish to use a blank password, simply press <enter> at the prompt below.
## 输入生成文件的密码(可不设置,设置需要在后面进行配置)
Provide a password for the "http.p12" file:  [<ENTER> for none]
## 再次输入生成文件的密码
Repeat password to confirm: 

## Where should we save the generated files?

A number of files will be generated including your private key(s),
public certificate(s), and sample configuration options for Elastic Stack products.

These files will be included in a single zip archive.

## 生成压缩文件的地址和名称,直接敲回车即可
What filename should be used for the output zip file? [/usr/share/elasticsearch/elasticsearch-ssl-http.zip] 

Zip file written to /usr/share/elasticsearch/elasticsearch-ssl-http.zip
  1. 移动elasticsearch-ssl-http.zip压缩包
 mv elasticsearch-ssl-http.zip ./config/
  1. 解压,并移动elasticsearc的http.p12文件,删除其余文件
unzip config/elasticsearch-ssl-http.zip
mv elasticsearch/http.p12 ./config/certs/
rm -rf elasticsearch/  kibana/
  1. 设置密码是需要执行该命令,没有设置则跳过
./bin/elasticsearch-keystore add xpack.security.http.ssl.keystore.secure_password

命令示意图
7. 退出elasticsearch容器,给http.p12文件赋予777权限

sudo chmod 777 elasticsearch/config/certs/http.p12
  1. 重启elasticsearch容器
docker restart elasticsearch

10.进入容器给elastic用户设置密码,验证https访问
修改密码参考资料

bin/elasticsearch-reset-password -u elastic -i

修改密码示意图
浏览器访问
https://宿主机IP:映射端口

作者这里宿主机IP为192.168.0.100 映射端口为21033
故访问https://192.168.0.100:21033/
访问需要帐号密码进行验证,帐号为elastic 密码为刚刚设置的密码
需要帐号密码验证

登录成功后可看到elasticsearch配置
在这里插入图片描述
11. 复制压缩包(第二步生成的)内kibana文件夹下elasticsearch-ca.pem到kibana的配置文件夹内
12. 配置kibana_system用户的密码
进入elasticsearch容器内,执行下列命令

bin/elasticsearch-reset-password -u kibana_system -i
  1. 生成kibana用https访问的公钥和私钥
./bin/elasticsearch-certutil csr -name kibana-server

会生成一个压缩文件,解压后有一下文件

/kibana-server
|_ kibana-server.csr
|_ kibana-server.key
  1. 将kibana-server.csr和kibana-server.key两个文件拷贝到kibana配置文件夹内
  2. 执行下列命令,生成
openssl  x509 -req -days 3650 -in kibana-server.csr -signkey kibana-server.key -out kibana-server.crt
  1. 打开kibana配置文件kibana.yml,添加和修改以下配置(IP自查)
server.host: "0.0.0.0"
server.shutdownTimeout: "5s"
elasticsearch.hosts: [ "https://172.27.0.2:9200" ]
monitoring.ui.container.elasticsearch.enabled: true
elasticsearch.ssl.certificateAuthorities: ["/usr/share/kibana/config/elasticsearch-ca.pem"]
elasticsearch.username: "kibana_system"
elasticsearch.password: "12步设置的密码"

server.ssl.certificate: "/usr/share/kibana/config/kibana-server.crt"
server.ssl.key: "/usr/share/kibana/config/kibana-server.key"
server.ssl.enabled: true
# 设置中文访问
i18n.locale: "zh-CN"
  1. 给生成的四个文件设置777权限
sudo chmod 777 elasticsearch-ca.pem kibana-server.csr kibana-server.key kibana-server.crt
  1. 重启kibana
  2. 登录kibana控制台验证
    浏览器访问
    https://宿主机IP:映射端口

作者这里宿主机IP为192.168.0.100 映射端口为21041
故访问https://192.168.0.100:21041/
访问需要帐号密码进行验证,帐号为elastic 密码为刚刚设置的密码,登录成功后选择自己浏览
kibana控制台登录页
登录成功标识

配置logstash

  1. 设置elasticsearch内置用户logstash_system密码(上面已经设置过两个用户的密码了,此处就当留一个考点吧)
  2. 生成logstash和elasticsearch之间的安全认证文件(文件elastic-certificates.p12大家还有印象吗?)
#如果设置有密码此命令需要输入密码
openssl pkcs12 -in elasticsearch/config/certs/elastic-certificates.p12 -cacerts -nokeys -chain  -out logstash.pem
  1. 移动logstash.pem文件到logstash配置文件目录下,并设置777权限
sudo chmod 777 logstash.pem
  1. 配置logstash.yml文件
http.host: "0.0.0.0"

xpack.monitoring.enabled: true
xpack.monitoring.elasticsearch.username: logstash_system
xpack.monitoring.elasticsearch.password: 第一步设置的密码

#这里必须用 https 这里必须用 https 这里必须用 https
xpack.monitoring.elasticsearch.hosts: [ "https://172.27.0.2:9200" ]
#你的ca.pem 的所在路径
xpack.monitoring.elasticsearch.ssl.certificate_authority: "/usr/share/logstash/config/logstash.pem"
xpack.monitoring.elasticsearch.ssl.verification_mode: certificate
# 探嗅 es节点,设置为 false
xpack.monitoring.elasticsearch.sniffing: false
  1. 使用kabina配置一个新的elasticsearch用户给logstash使用

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

在这里插入图片描述

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

  1. 在pipeline目录下,增加logstash.conf文件
    配置如下
# Sample Logstash configuration for creating a simple
# Beats -> Logstash -> Elasticsearch pipeline.

input {
  tcp {
    port => 21068
    codec => json_lines
  }
}

output {
  elasticsearch {
    hosts => ["https://172.27.0.2:9200"]
    index => "自定义索引名称-%{+YYYY.MM.dd}"
    user => "自定义用户"
    password => "自定义密码"
    ssl_enabled => true
    ssl_certificate_authorities => ["/usr/share/logstash/config/logstash.pem"]
  }
}
  1. 重启logstash

创建springboot项目进行测试

  1. 在pom文件内添加依赖
       <dependency>
           <groupId>net.logstash.logback</groupId>
           <artifactId>logstash-logback-encoder</artifactId>
           <version>7.4</version>
       </dependency>
  1. 配置logback.xml文件,添加以下appender
    destination配置问logstash的地址,需要哪些数据请自定义。
	<springProperty scope="context" name="appName" source="spring.application.name"/>
    <springProperty scope="context" name="port" source="server.port"/>
    <appender name="LOGSTASH" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
        <destination>ip:port</destination>
        <encoder class="net.logstash.logback.encoder.LoggingEventCompositeJsonEncoder">
            <timestamp>
                <timeZone>Asia/Shanghai</timeZone>
            </timestamp>
            <providers>
                <pattern>
                    <pattern>
                        {
                        "index":"index-%d{yyyy-MM-dd}",
                        "appName":"${appName}",
                        "pid": "${PID:-}",
                        "port":"${port}",
                        "timestamp":"%d{yyyy-MM-dd HH:mm:ss.SSS}",
                        "thread":"%thread",
                        "level":"%level",
                        "class": "%logger",
                        "message": "%message",
                        "stack_trace":"%exception"
                        }
                    </pattern>
                </pattern>
            </providers>
        </encoder>
        <keepAliveDuration>5 minutes</keepAliveDuration>
    </appender>
  1. 将新增加appender的名字添加到root内
    <root level="INFO">
        <appender-ref ref="ERROR"/>
        <appender-ref ref="WARN"/>
        <appender-ref ref="INFO"/>
        <appender-ref ref="DEBUG"/>
        <appender-ref ref="LOGSTASH"/>
        <appender-ref ref="STDOUT"/>
    </root>

4.启动验证

kibana创建视图,查询日志

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

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

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

相关文章

李宏毅生成式AI课程笔记(持续更新

01 ChatGPT在做的事情 02 预训练&#xff08;Pre-train&#xff09; ChatGPT G-Generative P-Pre-trained T-Transformer GPT3 ----> InstructGPT&#xff08;经过预训练的GPT3&#xff09; 生成式学习的两种策略 我们在使用ChatGPT的时候会注意到&#xff0c;网站上…

2023/10/15

文章目录 1.uniapp之Vue2升Vue3值得注意的几点1.1 页面生命周期的使用1.2 引入资源的方式 2. 浏览器本地存储之Cookie和webStorage3. CSS变量 var()的用法4. CSS之实现线性渐变背景5. 图片无法和文字对齐的正确解决方案6. 使用正则处理接口返回的富文本内的图片7. transition实…

Java练习题-获取数组元素最大值

✅作者简介&#xff1a;CSDN内容合伙人、阿里云专家博主、51CTO专家博主、新星计划第三季python赛道Top1&#x1f3c6; &#x1f4c3;个人主页&#xff1a;hacker707的csdn博客 &#x1f525;系列专栏&#xff1a;Java练习题 &#x1f4ac;个人格言&#xff1a;不断的翻越一座又…

[cpp primer随笔] 11. 内联函数与constexpr函数

1. 内联函数 调用函数一般比对等价表达式求值要慢。因为调用函数除了对表达式求值外&#xff0c;还包含一系列过程&#xff0c;包括堆栈建立、拷贝实参、跳转执行等等。而在程序之中&#xff0c;通常存在一些优化规模较小、流程直接、却调用频率很高的函数&#xff0c;我们可以…

51系列—基于51单片机的集中抄表设计(代码+文档资料)

概述 自动抄表&#xff08;Automatic Meter Reading-AMR&#xff09;是指采用通讯和计算机网络等技术自动读取和处理表计数据。发展电能自动抄表技术是提高用电管理水平的需要&#xff0c;也是网络和计算机技术迅速发展的必然。在用电管理方面&#xff0c;采用自动抄表技术&am…

YOLOv5-QAT量化部署

目录 前言一、QAT量化浅析二、YOLOv5模型训练1. 项目的克隆和必要的环境依赖1.1 项目克隆1.2 项目代码结构整体介绍1.3 环境安装 2. 数据集和预训练权重的准备2.1 数据集2.2 预训练权重准备 3. 训练模型3.1 修改数据配置文件3.2 修改模型配置文件3.3 训练模型3.4 mAP测试 三、Y…

浅谈“智慧园区”

前言&#xff1a;国庆《中国智慧园区发展白皮书&#xff08;2022&#xff09;》&#xff0c;很全面的介绍智慧园区的起源、发展阶段、涉及内容、未来规划、竞争格局等。做了些笔记&#xff0c;这对在智慧园区工作的伙伴应该很有帮助&#xff0c;下面是笔记和一些公开资料的整合…

小谈设计模式(30)—Java设计模式总结

小谈设计模式&#xff08;30&#xff09;—Java设计模式总结 专栏介绍专栏地址专栏介绍 总括三个主要类别abc 创建型模式&#xff08;Creational Patterns&#xff09;常见的创建型模式单例模式&#xff08;Singleton Pattern&#xff09;工厂模式&#xff08;Factory Pattern&…

【计算机网络笔记】分组交换中的报文交付时间计算例题

系列文章目录 什么是计算机网络&#xff1f; 什么是网络协议&#xff1f; 计算机网络的结构 数据交换之电路交换 数据交换之报文交换和分组交换 系列文章目录题目解答 题目 在下图所示的采用“存储-转发”方式的分组交换网络中所有链路的数据传输速率为100 Mbps&#xff0c;分…

[开源]基于Vue+ElementUI+G2Plot+Echarts的仪表盘设计器

一、开源项目简介 基于SpringBoot、MyBatisPlus、ElementUI、G2Plot、Echarts等技术栈的仪表盘设计器&#xff0c;具备仪表盘目录管理、仪表盘设计、仪表盘预览能力&#xff0c;支持MySQL、Oracle、PostgreSQL、MSSQL、JSON等数据集接入&#xff0c;对于复杂数据处理还可以使用…

【具身智能模型1】PaLM-E: An Embodied Multimodal Language Model

论文标题&#xff1a;PaLM-E: An Embodied Multimodal Language Model 论文作者&#xff1a;Danny Driess, Fei Xia, Mehdi S. M. Sajjadi, Corey Lynch, Aakanksha Chowdhery, Brian Ichter, Ayzaan Wahid, Jonathan Tompson, Quan Vuong, Tianhe Yu, Wenlong Huang, Yevgen C…

Trello的替代方案有哪些?6种国内外选择!

Trello是一个功能强大的项目管理工具&#xff0c;可以帮助团队组织和跟踪他们的工作。然而它并不是唯一的工具。Trello有很多替代方案&#xff0c;它们提供了独特的功能和不同的方法来管理任务和项目。以下是Trello的一些优秀替代方案&#xff1a;Zoho Projects、Basecamp、Wri…

NET 8发布首个RC,比.NET 7的超级快更快!

NET 8 发布了首个 RC。据称 RC 阶段会发布两个版本&#xff0c;正式版将于 2023 年 11 月 14 日至 16 日在 .NET Conf 2023 上推出。.NET 8 是长期支持 (LTS) 版本&#xff0c;将会获得 3 年技术支持。 公告写道&#xff0c;此版本为 Android 和 WASM 引入了全新的 AOT 模式、…

Leetcode—27.移除元素【简单】

2023每日刷题&#xff08;一&#xff09; Leetcode—27.移除元素 无脑直接法实现代码 int removeElement(int* nums, int numsSize, int val){int i 0;int length 0;int j 0;while(i < numsSize) {// 存在等于val的数组元素if(nums[i] val) {j i;int flag 0;while(j…

如何降低海康、大华等网络摄像头调用的高延迟问题(二)

目录 1.RTSP介绍 2.解决办法1 3.解决办法2 1.RTSP介绍 RTSP&#xff08;Real-time Streaming Protocol&#xff09;是一种用于实时流媒体传输的网络协议。它被设计用于在服务器和客户端之间传输音频、视频以及其他流媒体数据。 RTSP协议允许客户端通过与服务器建立RTSP会话…

系统架构师备考倒计时21天(每日知识点)

测试阶段划分 单元测试&#xff1a;依据详细设计&#xff0c;模块测试&#xff0c;模块功能、性能、接口等集成测试&#xff1a;依据概要设计&#xff0c;模块间的接口系统测试&#xff1a;依据需求文档&#xff0c;在真实环境下&#xff0c;验证完整的软件配置项能否和系统正…

【linux】日志和journalctl 管理查看日志

目录 既看即用 简略介绍 linux的日志类型 系统日志 介绍 区别的简单说明 区别的详细说明 journalctl是什么&#xff1f;&#xff08;查看系统日志的工具&#xff09; 详细内容 linux的日志类型 systemd日志&#xff08;systemd-journald&#xff09; 放在哪个目录 …

推荐几款好用的通用型项目管理软件!

目前市面上的项目管理产品非常丰富&#xff0c;在选择项目管理软件的过程中一一了解这些产品哪个更好更适合自己的团队&#xff0c;无疑会浪费很多时间成本。通用性项目管理工具可以满足大部分团队的项目管理需求&#xff0c;那有什么好用的通用型项目管理软件呢&#xff1f;知…

电商数据API接口:新服务下电商网站、跨境电商独立站,移动APP的新型拉新武器

互联网的发展改变了我们的生活方式&#xff0c;也改变了企业商家们的营销方式&#xff0c;越来越多的企业商家把产品营销从线下转到线上&#xff0c;选择在线商城、移动APP、微信公众号等互联网工具进行营销活动。而随着营销模式的多元化和电子支付渠道的进一步发展&#xff0c…

Linux 系统安装 Redis7 —— 超详细操作演示!

内存数据库 Redis7 一、Redis 概述1.1 Redis 简介1.2 Redis 的用途1.3 Redis 特性1.4 Redis 的IO模型 二、Redis 的安装与配置2.1 Redis 的安装2.2 连接前的配置2.3 Redis 客户端分类2.4 Redis 配置文件详解 三、Redis 命令四、Redis 持久化五、Redis 主从集群六、Redis 分布式…