Elasticsearch基本安全加上安全的 HTTPS 流量

基本安全加上安全的 HTTPS 流量

  • 在生产环境中,除非您在 HTTP 层启用 TLS,否则某些 Elasticsearch 功能(例如令牌和 API 密钥)将被禁用。这个额外的安全层确保进出集群的所有通信都是安全的。

  • 当您在模式下运行该elasticsearch-certutil工具时http,该工具会询问几个有关您希望如何生成证书的问题。虽然有许多选项,但以下选项会生成适用于大多数环境的证书。

  • 该elasticsearch-certutil工具提示您的第一个问题是您是否要生成证书签名请求 (CSR)。回答 n您是要签署自己的证书,还是y要签署中央 CA 的证书。

- 签署自己的证书

  • 如果您想使用您自已生成的CA证书 。 回答 n,当系统询问您是否要生成 CSR 时。然后指定 CA 证书的位置,即由该工具签署和生成证书.p12。

- 使用中央 CA 签署证书

  • 如果您在中央安全团队的环境中工作,他们可能会为您生成证书。您组织内的基础设施可能已经配置为信任现有的 CA,因此如果您使用 CSR 并将该请求发送给控制您的 CA 的团队,则客户端可能更容易连接到 Elasticsearch。要使用中央 CA,请回答y第一个问题。

先决条件

  • 完成为 Elastic Stack 设置基本安全性中的所有步骤。请参考以下文档:
    Elasticsearch 设置基本安全性

为 Elasticsearch 加密 HTTP 客户端通信

  • 在集群中的每个节点 上,停止 Elasticsearch 和 Kibana(如果它们正在运行)。
root@ubuntu-x64_02:/usr/local/elasticsearch9201# systemctl stop elasticsearch9201
root@ubuntu-x64_02:/usr/local/elasticsearch9201# systemctl stop elasticsearch9202
root@ubuntu-x64_02:/usr/local/elasticsearch9201# systemctl stop elasticsearch9203 
  • 在任何单个节点上,从您安装 Elasticsearch 的目录运行 Elasticsearch HTTP 证书工具以生成证书签名请求 (CSR)。

  • 此命令生成一个.zip文件,其中包含用于 Elasticsearch 和 Kibana 的证书和密钥。每个文件夹都包含一个README.txt 说明如何使用这些文件。

root@ubuntu-x64_02:/usr/local/elasticsearch9201#./bin/elasticsearch-certutil http
  • 当系统询问您是否要生成 CSR 时,请输入: n
## 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 do not 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.

Generate a CSR? [y/N]N 
  • 当系统询问您是否要使用现有 CA 时,请输入: y
## 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.

Use an existing CA? [y/N]y 
  • 输入您的 CA 的路径。elastic-stack-ca.p12 这是您为集群生成的文件 的绝对路径。如: /usr/local/elasticsearch9201/elastic-stack-ca.p12
  • 输入您的 CA 的密码。如果没有,则为空,在这种情况下,您只需在提示符下按ENTER键
## 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 Path: /usr/local/elasticsearch9201/elastic-stack-ca.p12 
Reading a PKCS12 keystore requires a password.
It is possible for the keystore is password to be blank,
in which case you can simply press <ENTER> at the prompt
Password for elastic-stack-ca.p12: 
  • 输入证书的到期值。您可以: 以年、月或日为单位输入有效期。例如,输入90D
## 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] 3Y 
  • 当系统询问您是否要为每个节点生成一个证书时,输入Y , 每个证书都有自己的私钥,并针对特定的主机名或 IP 地址颁发
## 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.

Generate a certificate per node? [y/N]Y
  • 出现提示时,输入集群中第一个节点的名称。使用生成节点证书时使用的相同节点名称。
## What is the name of node #1?

This name will be used as part of the certificate file name, and as a
descriptive name within the certificate.

You can use any descriptive name that you like, but we recommend using the name
of the Elasticsearch node.
 
node #1 name: node-1 
  • 输入用于连接到您的第一个节点的所有主机名。这些主机名将作为 DNS 名称添加到证书的主题备用名称 (SAN) 字段中。

## Which hostnames will be used to connect to node-1?

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.

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.

node-1.es.example.com 

You entered the following hostnames.

 - node-1.es.example.com      

Is this correct [Y/n]Y 
  • 输入客户端可用于连接到您的节点的 IP 地址。这里使用本地回环地址
## Which IP addresses will be used to connect to node-1?

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.

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.

127.0.0.1 


You entered the following IP addresses.

 - 127.0.0.1

Is this correct [Y/n]Y
  • 对集群中的每个附加节点重复这些步骤。
  • 为每个节点生成证书后,在出现提示时输入私钥密码。或直接回车为空。
## 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] 
  • 默认保存到当前目录
## 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/local/elasticsearch9201/elasticsearch-ssl-http.zip]   

Zip file written to /usr/local/elasticsearch9201/elasticsearch-ssl-http.zip

  • 解压生成的 elasticsearch-ssl-http.zip 文件。这个压缩文件包含一个用于 Elasticsearch 和 Kibana 的目录。
root@ubuntu-x64_02:/usr/local/elasticsearch9201# unzip elasticsearch-ssl-http.zip 
Archive:  elasticsearch-ssl-http.zip
   creating: elasticsearch/
   creating: elasticsearch/node-1/
  inflating: elasticsearch/node-1/README.txt  
  inflating: elasticsearch/node-1/http.p12  
  inflating: elasticsearch/node-1/sample-elasticsearch.yml  
   creating: elasticsearch/node-2/
  inflating: elasticsearch/node-2/README.txt  
  inflating: elasticsearch/node-2/http.p12  
  inflating: elasticsearch/node-2/sample-elasticsearch.yml  
   creating: elasticsearch/node-3/
  inflating: elasticsearch/node-3/README.txt  
  inflating: elasticsearch/node-3/http.p12  
  inflating: elasticsearch/node-3/sample-elasticsearch.yml  
   creating: kibana/
  inflating: kibana/README.txt       
  inflating: kibana/elasticsearch-ca.pem  
  inflating: kibana/sample-kibana.yml 
  • 查看证书生成目录 : es 节点证书
root@ubuntu-x64_02:/usr/local/elasticsearch9201# tree elasticsearch
elasticsearch
├── node-1
│   ├── http.p12
│   ├── README.txt
│   └── sample-elasticsearch.yml
├── node-2
│   ├── http.p12
│   ├── README.txt
│   └── sample-elasticsearch.yml
└── node-3
    ├── http.p12
    ├── README.txt
    └── sample-elasticsearch.yml

3 directories, 9 files
  • 查看证书生成目录 : kibana 证书
root@ubuntu-x64_02:/usr/local/elasticsearch9201# tree kibana/
kibana/
├── elasticsearch-ca.pem
├── README.txt
└── sample-kibana.yml

0 directories, 3 files
  • 在集群中的每个节点上,完成以下步骤:
  • 将相关http.p12证书复制到$ES_PATH_CONF目录中。
root@ubuntu-x64_02:/usr/local/elasticsearch9201# cp  elasticsearch/node-1/http.p12   /usr/local/elasticsearch9201/config/
root@ubuntu-x64_02:/usr/local/elasticsearch9201# cp  elasticsearch/node-2/http.p12   /usr/local/elasticsearch9202/config/
root@ubuntu-x64_02:/usr/local/elasticsearch9201# cp  elasticsearch/node-3/http.p12   /usr/local/elasticsearch9203/config/
  • 编辑该elasticsearch.yml文件以启用 HTTPS 安全并指定安全证书的位置http.p12。
cat >> /usr/local/elasticsearch9201/config/elasticsearch.yml  <<EOF

xpack.security.http.ssl.enabled: true
xpack.security.http.ssl.keystore.path: http.p12

EOF


cat >> /usr/local/elasticsearch9202/config/elasticsearch.yml  <<EOF

xpack.security.http.ssl.enabled: true
xpack.security.http.ssl.keystore.path: http.p12

EOF

cat >> /usr/local/elasticsearch9203/config/elasticsearch.yml  <<EOF

xpack.security.http.ssl.enabled: true
xpack.security.http.ssl.keystore.path: http.p12

EOF
  • 将您的私钥密码添加到 Elasticsearch 的安全设置中。
root@ubuntu-x64_02:/usr/local/elasticsearch9201# cd /usr/local/elasticsearch9201; ./bin/elasticsearch-keystore add xpack.security.http.ssl.keystore.secure_password
Enter value for xpack.security.http.ssl.keystore.secure_password: 

root@ubuntu-x64_02:/usr/local/elasticsearch9201# cd /usr/local/elasticsearch9202; ./bin/elasticsearch-keystore add xpack.security.http.ssl.keystore.secure_password
Enter value for xpack.security.http.ssl.keystore.secure_password: 

root@ubuntu-x64_02:/usr/local/elasticsearch9202# cd /usr/local/elasticsearch9203; ./bin/elasticsearch-keystore add xpack.security.http.ssl.keystore.secure_password
Enter value for xpack.security.http.ssl.keystore.secure_password: 
  • 修改文件 权限
root@ubuntu-x64_02:/usr/local/elasticsearch9203# chown -R elk:elk /usr/local/elasticsearch9201
root@ubuntu-x64_02:/usr/local/elasticsearch9203# chown -R elk:elk /usr/local/elasticsearch9202
root@ubuntu-x64_02:/usr/local/elasticsearch9203# chown -R elk:elk /usr/local/elasticsearch9203
  • 启动 Elasticsearch.
root@ubuntu-x64_02:/usr/local/elasticsearch9203# systemctl start elasticsearch9201
root@ubuntu-x64_02:/usr/local/elasticsearch9203# systemctl start elasticsearch9202
root@ubuntu-x64_02:/usr/local/elasticsearch9203# systemctl start elasticsearch9203 
  • 添加 hosts 解释
root@ubuntu-x64_02:/usr/local/elasticsearch9203# echo "127.0.0.1 node-1.es.example.com" >> /etc/hosts 
root@ubuntu-x64_02:/usr/local/elasticsearch9203# echo "127.0.0.1 node-2.es.example.com" >> /etc/hosts 
root@ubuntu-x64_02:/usr/local/elasticsearch9203# echo "127.0.0.1 node-3.es.example.com" >> /etc/hosts 
  • 使用 -k 选项,不较验 CA 证书 , 否则会 导致无法验证问题
root@ubuntu-x64_02:/usr/local/elasticsearch9201# curl -k -u elastic:123456 https://node-1.es.example.com:9201/_cat/nodes/?v; 
ip        heap.percent ram.percent cpu load_1m load_5m load_15m node.role   master name
127.0.0.1           56          97   6    0.28    0.14     0.21 cdfhilmrstw -      node-1
127.0.0.1           48          97   6    0.28    0.14     0.21 cdfhilmrstw -      node-3
127.0.0.1           63          97   6    0.28    0.14     0.21 cdfhilmrstw *      node-2

为 Kibana 加密 HTTP 客户端通信

  • 浏览器将流量发送到 Kibana,而 Kibana 将流量发送到 Elasticsearch。这些通信通道被单独配置为使用 TLS。您加密浏览器和 Kibana 之间的流量,然后加密 Kibana 和 Elasticsearch 之间的流量。

加密 Kibana 和 Elasticsearch 之间的流量

  • 当您使用该选项运行该elasticsearch-certutil工具时http,它会创建一个/kibana包含elasticsearch-ca.pem文件的目录。您使用此文件将 Kibana 配置为信任 HTTP 层的 Elasticsearch CA。
  • 将文件复制elasticsearch-ca.pem到 Kibana 配置目录,如路径所定义$KBN_PATH_CONF。
root@ubuntu-x64_02:/usr/local/elasticsearch9201# cp  kibana/elasticsearch-ca.pem  /usr/local/kibana/config/

  • 打开kibana.yml并添加以下行以指定 HTTP 层的安全证书的位置。
cat >> /usr/local/kibana/config/kibana.yml  <<EOF

elasticsearch.ssl.certificateAuthorities: /usr/local/kibana/config/elasticsearch-ca.pem

EOF
  • 添加以下行以指定 Elasticsearch 集群的 HTTPS URL。
root@ubuntu-x64_02:/usr/local/elasticsearch9201# cat  /usr/local/kibana/config/kibana.yml| grep "elasticsearch.hosts"
elasticsearch.hosts: ["https://127.0.0.1:9201" ,"https://127.0.0.1:9202" ,"https://127.0.0.1:9203"] 
  • 修改权限
root@ubuntu-x64_02:/usr/local/elasticsearch9201# chown -R elk:elk /usr/local/kibana 
  • 重启 kibana
root@ubuntu-x64_02:/usr/local/elasticsearch9201# systemctl  restart kibana.service 

加密浏览器和 Kibana 之间的流量

  • Kibana 为您创建服务器证书和私钥。Kibana 在从 Web 浏览器接收连接时使用此服务器证书和相应的私钥。

  • 以下为 Kibana 创建证书签名请求 (CSR)。CSR 包含 CA 用于生成和签署安全证书的信息。证书可以是受信任的(由公共、受信任的 CA 签名)或不受信任的(由内部 CA 签名)。自签名或内部签名证书可用于开发环境和构建概念验证,但不应在生产环境中使用。

  • 在投入生产之前,使用受信任的 CA(例如Let’s Encrypt)或您组织的内部 CA 来签署证书。使用签名证书建立浏览器信任以连接到 Kibana 以进行内部访问或在公共互联网上访问。

  • 为 Kibana 生成服务器证书和私钥。

root@ubuntu-x64_02:/usr/local/elasticsearch9201# ./bin/elasticsearch-certutil csr -name kibana-server -dns kibana.example.com
  • 解压缩csr-bundle.zip文件以获得kibana-server.csr未签名的安全证书和kibana-server.key未加密的私钥。
root@ubuntu-x64_02:/usr/local/elasticsearch9201# unzip csr-bundle.zip 
Archive:  csr-bundle.zip
   creating: kibana-server/
  inflating: kibana-server/kibana-server.csr  
  inflating: kibana-server/kibana-server.key  
  • 将证书kibana-server.csr签名请求发送给您的内部 CA 或受信任的 CA 进行签名以获得签名证书。签名文件可以是不同的格式,.crt 例如: kibana-server.crt.
  • 使用自签CA生成证书签名
root@ubuntu-x64_02:/usr/local/elasticsearch9201# tree kibana-server/
kibana-server/
├── kibana-server.crt
├── kibana-server.csr
└── kibana-server.key

0 directories, 3 files
  • 打开kibana.yml并添加以下行以配置 Kibana 以访问服务器证书和未加密的私钥。
root@ubuntu-x64_02:/usr/local/elasticsearch9201# cp ./kibana-server/kibana-server.crt  /usr/local/kibana/config/
root@ubuntu-x64_02:/usr/local/elasticsearch9201# cp ./kibana-server/kibana-server.key  /usr/local/kibana/config/

cat >> /usr/local/kibana/config/kibana.yml  <<EOF

server.ssl.certificate: /usr/local/kibana/config/kibana-server.crt
server.ssl.key: /usr/local/kibana/config/kibana-server.key

EOF


# 目录结构 
root@ubuntu-x64_02:/usr/local/elasticsearch9201# ls -tlh /usr/local/kibana/config/
total 44K
-rw-r--r-- 1 root root  989 Mar 23 15:24 kibana-server.crt
-rw-r--r-- 1 elk  elk  5.5K Mar 23 15:20 kibana.yml
-rw-r--r-- 1 elk  elk  1.7K Mar 23 14:56 kibana-server.key
-rw-r--r-- 1 elk  elk  1.2K Mar 22 18:04 elasticsearch-ca.pem
-rw-r--r-- 1 elk  elk   190 Mar 20 19:20 kibana.keystore
-rw-r--r-- 1 elk  elk  5.2K Mar 20 17:26 kibana.yml.bak
-rwxr-xr-x 1 elk  elk  5.2K Jul  9  2022 kibana.yml_20220709073134.bak
-rwxr-xr-x 1 elk  elk   216 Jul  9  2022 node.options

  • kibana.yml添加以下行入站连接启用 TLS
cat >> /usr/local/kibana/config/kibana.yml  <<EOF

server.ssl.enabled: true

EOF


# 修改权限
root@ubuntu-x64_02:/usr/local/elasticsearch9201# chown -R elk:elk /usr/local/kibana


  • 进行这些更改后,您必须始终通过 HTTPS 访问 Kibana。例如,https://<your_kibana_host>.com。
server.publicBaseUrl: "https://192.168.88.12:5601"
  • 启动 kibana
root@ubuntu-x64_02:/usr/local/elasticsearch9201# systemctl restart kibana.service 
  • 检查状态
root@ubuntu-x64_02:/usr/local/elasticsearch9201# systemctl status  kibana.service 
● kibana.service - kibana
   Loaded: loaded (/lib/systemd/system/kibana.service; disabled; vendor preset: enabled)
   Active: active (running) since Thu 2023-03-23 15:26:50 CST; 6s ago
  Process: 4306 ExecStop=/usr/bin/kill -15 $MAINPID (code=exited, status=203/EXEC)
 Main PID: 4312 (node)
    Tasks: 18
   Memory: 200.5M
      CPU: 6.855s
   CGroup: /system.slice/kibana.service
           ├─4312 /usr/local/kibana/bin/../node/bin/node /usr/local/kibana/bin/../src/cli/dist
           └─4325 /usr/local/kibana/node/bin/node --preserve-symlinks-main --preserve-symlinks /usr/local/kibana/src/cli/dist

Mar 23 15:26:50 ubuntu-x64_02 systemd[1]: kibana.service: Unit entered failed state.
Mar 23 15:26:50 ubuntu-x64_02 systemd[1]: kibana.service: Failed with result 'exit-code'.
Mar 23 15:26:50 ubuntu-x64_02 systemd[1]: Started kibana.

  • 登录 kibana ,输入 elastic:123456登录密码,由于CA是自签,浏览器会提示未验证,开发环境可以使用
    在这里插入图片描述

小结

  • 此方案建立在基本安全方案的基础上,并使用 TLS 保护所有 HTTP 流量。除了在 Elasticsearch 集群的传输接口上配置 TLS 之外,您还可以在 Elasticsearch 和 Kibana 的 HTTP 接口上配置 TLS。如果您需要 HTTP 层上的双向(双向)TLS,则需要配置相互验证的加密。

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

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

相关文章

初始React

一.React的诞生1.什么是React?React是一个讲数据渲染为HTML视图的来源Js库&#xff0c;用于构建用户界面的JS库。在以前的学习中构建用户界面的常用操作步骤&#xff1a;发送请求获取数据处理数据&#xff08;过滤&#xff0c;整理格式等&#xff09;操作DOM呈现页面2.React诞…

《SpringBoot》第02章 自动配置机制(一) 项目启动

前言 关于SpringBoot&#xff0c;最大的特点就是开箱即用&#xff0c;通过自动配置机制&#xff0c;遵守约定大于配置这个准则&#xff0c;那么这个是如何实现的呢&#xff1f; 本章首先会介绍SpringBoot的启动执行 一、启动第一步&#xff1a;初始化 1.本章概述 当启动Sp…

【论文精读(李沐老师)】Attention Is All You Need

Abstract 在主流的序列转录&#xff08;给你一个序列&#xff0c;生成另外一个序列&#xff09;模型中主要是依赖复杂的RNN和CNN&#xff0c;一般包括encoder和decoder两个结构。在性能最好的模型里&#xff0c;通常使用注意力机制连接encoder和decoder。 &#xff08;本文想做…

HTTP API接口设计规范

1. 所有请求使用POST方法 使用post&#xff0c;相对于get的query string&#xff0c;可以支持复杂类型的请求参数。例如日常项目中碰到get请求参数为数组类型的情况。 便于对请求和响应统一做签名、加密、日志等处理 2. URL规则 URL中只能含有英文&#xff0c;使用英文单词或…

爱玩飞飞加速实现与分析

一步一步找数据。然后根据游戏数据找游戏基址&#xff0c;游戏基址可以遍历所有数据。想学的可以看看。第一步找基础数据&#xff0c;我们用的ce7.1.当然你们也可以用其他版本。网上随便下一个就行。 第一步。打开ce7.1附加游戏进程。 然后看下自己的血量是多少。我们这里是5…

HTML5支持的视频文件格式和音频文件格式有哪些?

在 HTML5 标准中, 我们有了新的 和 标签, 分别可以引入视频和音频文件的标签 那么这些标签又可以支持哪些文件格式呢 ? 格式支持 视频文件格式 MP4&#xff1a;MPEG-4 Part 14&#xff0c;支持H.264编码。几乎所有的浏览器都支持该格式。 WebM&#xff1a;谷歌开发的格式&a…

【最短路算法】第三弹:一文学懂spfa 算法(队列优化的Bellman-Ford算法)

博主简介&#xff1a;努力学习的大一在校计算机专业学生&#xff0c;热爱学习和创作。目前在学习和分享&#xff1a;算法、数据结构、Java等相关知识。博主主页&#xff1a; 是瑶瑶子啦所属专栏: 算法 &#xff1b;该专栏专注于蓝桥杯和ACM等算法竞赛&#x1f525;近期目标&…

Java Script

一.初识js 1.与css html的关系 HTML 网页的结构(骨CSS:网页的表现(皮JavaScript :网页的行为2.运行过程 编写的代码是保存在文件上,也就是存储到硬盘(外存zhong)双击以后,html文件浏览器(引用程序)就会读取文件,将文件内容加载到内存中,(数据流向:硬盘->内存)浏览器会解析用…

Linux——基本指令

目录 01. ls 指令 02. pwd命令 03. cd 指令 04. touch指令 05.mkdir指令&#xff08;重要&#xff09; 06.rmdir指令 && rm 指令&#xff08;重要&#xff09; 07.man指令&#xff08;重要&#xff09; 08.cp指令&#xff08;重要&#xff09; 09.mv指令&…

react使用craco.config.js完成rem移动端适配(sass)

环境&#xff1a; "react": "^18.2.0", "react-dom": "^18.2.0", "react-router-dom": "^6.8.2", "sass": "^1.58.3", yarn add craco/craco postcss-pxtorem lib-flexible 1、创建 craco.…

Java入门知识(超详细讲解)

&#x1f648;作者简介&#xff1a;练习时长两年半的Java up主 &#x1f649;个人主页&#xff1a;老茶icon &#x1f64a; ps:点赞&#x1f44d;是免费的&#xff0c;却可以让写博客的作者开兴好久好久&#x1f60e; &#x1f4da;系列专栏&#xff1a;Java全栈&#xff0c;计…

REDIS19_zipList压缩列表详解、快递列表 - QuickList、跳表 - SkipList

文章目录①. 压缩列表 - zipList②. 快递列表 - QuickList③. 跳表 - SkipList①. 压缩列表 - zipList ①. ZipList是一种特殊的"双端链表",由一系列特殊编码的连续内存块组成。可以在任意一端进行压入/弹出操作,并且该操作的时间复杂度为O(1) (oxff:11111111) type…

BI界的ChatGPT,它有什么厉害之处

​ChatGPT火了&#xff0c;注册用户从0到1亿&#xff0c;仅用了2个月时间。ChatGPT的背后是大数据、大模型、大算力&#xff0c;是AI的能力集中化的典型场景。那么在BI界&#xff0c;是否也有一款像ChatGPT一样智能BI软件&#xff0c;只要告诉它我们想看啥数据&#xff0c;它噔…

使用 Jpom 自动构建和部署项目

比 Jenkins 简单的项目构建和部署工具。 前端项目自动构建部署 我有几个自用的前端项目&#xff0c;每次修改代码后都需要本地打包再上传到服务器进行部署&#xff0c;感觉有点麻烦&#xff0c;不够自动化&#xff0c;所以一直想找个能够实现自动构建和部署的工具。 这时候可…

智能灯泡灯一Homekit智能家居

传统的灯泡是通过手动打开和关闭开关来工作。有时&#xff0c;它们可以通过声控、触控、红外等方式进行控制&#xff0c;或者带有调光开关&#xff0c;让用户调暗或调亮灯光。 智能灯泡内置有芯片和通信模块&#xff0c;可与手机、家庭智能助手、或其他智能硬件进行通信&#…

Camtasia Studio2023非常好用的电脑录屏软件

如果你需要制作视频教程、游戏直播或其他视频内容&#xff0c;那么一个好的录屏软件就是必不可少的。Camtasia Studio是非常好用的录屏软件&#xff0c;它们可以记录计算机屏幕上发生的所有活动&#xff0c;并可捕捉声音。这些软件还提供了一些视频编辑功能&#xff0c;如裁剪、…

【Python学习笔记(七)】queue队列模块的使用

queue队列模块的使用 前言 为了解决多线程之间共享数据的问题&#xff0c;需要对线程进行加锁或者是线程等待&#xff1b; 更简单的解决这一问题&#xff0c;就需要引入队列的概念&#xff1a; 队列是一种特殊的线性表&#xff0c;是一种先进先出 (FIFO) 的数据结构&#xff…

代码随想录第二十七天(669、108、538、回溯算法介绍)

669. 修剪二叉搜索树 不能简单地通过递归实现代码&#xff0c;比如&#xff1a; class Solution { public:TreeNode* trimBST(TreeNode* root, int low, int high) {if (root nullptr || root->val < low || root->val > high) return nullptr;root->left t…

Altium Designer 2023版本安装过程

1、解压下载好的文件。 2、双击打开Setup文件夹。 3、找到installer文件&#xff0c;右键点击&#xff0c;并且以管理员身份运行。 4、点解next。 5、选择语言位&#xff1a;Chinese&#xff0c;点击我同意&#xff0c;接着next。 6、勾选前面两个&#xff0c;点击next。 7、选…

View绘制流程分析

View绘制流程分析 目录介绍 01.addView的流程分析 1.1 wm.addView()流程 02.requestLayout绘制 2.1 源码流程分析2.2 View绘制流程简析 03.performMeasure测量 3.1 performMeasure源码3.2 measure设计思路3.3 measure测量流程 04.performLayout布局 4.1 performLayout源码4.2…
最新文章