zookeeper下载安装部署

zookeeper是一个为分布式应用提供一致性服务的软件,它是开源的Hadoop项目的一个子项目,并根据google发表的一篇论文来实现的。zookeeper为分布式系统提供了高效且易于使用的协同服务,它可以为分布式应用提供相当多的服务,诸如统一命名服务,配置管理,状态同步和组服务等。

1、下载zookeeper

下载地址:Apache ZooKeeper

先在Windows系统下载,下载完之后可以通过Xftp软件上传到Linux系统中。也可以直接在Linux系统中通过以下命令下载:

wget http://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/zookeeper-3.4.11/zookeeper-3.4.11.tar.gz

2、单机部署zookeeper

将下载好的zookeeper通过Xftp软件上传到Linux系统中,上传完成之后解压缩。

tar -zxvf zookeeper-3.4.11.tar.gz

将解压后的文件移动到 /usr/local 目录下。

mv zookeeper-3.4.11 /usr/local/

2.1、修改配置文件zoo.cfg

进入到 /usr/local/zookeeper-3.4.11目录下,创建temp/zk/data和temp/zk/log两个子目录,并进入到conf目录下修改配置文件。

执行如下命令:mv  zoo_sample.cfg  zoo.cfg 将zoo_sample.cfg重命名为zoo.cfg,或者执行 cp  zoo_sample.cfg  zoo.cfg 生成zoo.cfg文件,然后修改zoo.cfg文件。

# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial 
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between 
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just 
# example sakes.
#dataDir=D:/MySoftware/Install/tools/zookeeper/data
#dataLogDir=D:/MySoftware/Install/tools/zookeeper/log
dataDir=/usr/local/zookeeper-3.4.11/temp/zk/data
dataLogDir=/usr/local/zookeeper-3.4.11/temp/zk/log# the port at which the clients will connect
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the 
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1## Metrics Providers
#
# https://prometheus.io Metrics Exporter
#metricsProvider.className=org.apache.zookeeper.metrics.prometheus.PrometheusMetricsProvider
#metricsProvider.httpPort=7000
#metricsProvider.exportJvmInfo=true

参数说明:

tickTime: zookeeper中使用的基本时间单位, 时长单位是毫秒。1 * tickTime是客户端与zk服务端的心跳时间,2 * tickTime是客户端会话的超时时间。 
tickTime的默认值为2000毫秒,更低的tickTime值可以更快地发现超时问题,但也会导致更高的网络流量(心跳消息)和更高的CPU使用率(会话的跟踪处理)。

initLimit:此配置表示,允许follower(相对于Leaderer言的“客户端”)连接并同步到Leader的初始化连接时间,以tickTime为单位。当初始化连接时间超过该值,则表示连接失败。此处该参数设置为10, 说明时间限制为10tickTime, 10*2000=20000ms=20s

syncLimit:此配置项表示Leader与Follower之间发送消息时,请求和应答时间长度。如果follower在设置时间内不能与leader通信,那么此follower将会被丢弃。此处该参数设置为5, 说明时间限制为5tickTime, 5*2000=10000ms=10s

dataDir: 数据目录,可以是任意目录。用于配置存储快照文件的目录。

dataLogDir: log目录, 同样可以是任意目录。 如果没有设置该参数, 将使用和dataDir相同的设置.

clientPort: 监听client连接的端口号。zk服务进程监听的TCP端口,默认情况下,服务端会监听2181端口。

maxClientCnxns:这个操作将限制连接到Zookeeper的客户端数量,并限制并发连接的数量,通过IP来区分不同的客户端。此配置选项可以阻止某些类别的Dos攻击。将他设置为零或忽略不进行设置将会取消对并发连接的限制。

例如,此时我们将maxClientCnxns的值设为1,如下所示:

# set maxClientCnxns
   maxClientCnxns=1

启动Zookeeper之后,首先用一个客户端连接到Zookeeper服务器上。之后如果有第二个客户端尝试对Zookeeper进行连接,或者有某些隐式的对客户端的连接操作,将会触发Zookeeper的上述配置。

2.2、配置环境变量

修改/etc/profile文件,在文件最后加上如下配置:

#set zookeeper
export ZOOKEEPER_HOME=/usr/local/zookeeper-3.4.11
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$HADOOP_HOME/bin:$ZOOKEEPER_HOME/bin:$PATH:$HOME/bin

然后执行 source /etc/profile 命令使修改立即生效。

2.3、启动zookeeper服务端和客户端

进入到zookeeper-3.4.11目录下的bin目录中,执行如下命令启动zookeeper服务端。

./zkServer.sh start

启动zookeeper客户端:如果是连接同一台主机上的zookeeper进程,那么直接运行bin/目录下的zkCli.cmdWindows环境下)或者zkCli.shLinux环境下),即可连接上zookeeper 
直接执行zkCli.cmd或者zkCli.sh命令默认以主机号 127.0.0.1,端口号 2181 来连接zk,如果要连接不同机器上的zk,可以使用 -server 参数。

bin目录下输入命令:./zkCli.sh 或 bash zkCli.sh  (默认以主机号127.0.0.1,端口号2181连接)

./zkCli.sh 
或 bash zkCli.sh./zkCli.sh -server 192.168.10.188:2181
或 bash zkCli.sh -server 192.168.10.188:2181

命令 ./zkCli.sh -server 192.168.10.188:2181 表示以主机号192.168.10.188,端口号2181连接。

断开连接zookeeper:

关闭zookeeper:

./zkServer.sh stop

3、伪集群部署zookeeper

所谓伪集群, 是指在单台机器中启动多个zookeeper进程, 并组成一个集群。集群是指在多台机器中分别启动一个zookeeper进程。

下面这种伪集群部署方式只有一个zookeeper-3.4.11目录(即下载zk后解压缩的那个目录),在zookeeper-3.4.11目录下创建temp/zk目录,在该目录下分别创建了data1、data2、data3和log1、log2、log3目录。另外在data1、data2、data3中均创建myid文件。

另外一种伪集群部署方式是在/usr/local目录下创建多个zookeeper目录,这里仍然以三个zookeeper服务器为例,创建三个zookeeper目录,分别命名为zookeeper1、zookeeper2和zookeeper3,然后在这三个目录下都要将下载的zookeeper-3.4.11.tar.gz压缩包解压成zookeeper-3.4.11目录,同时在zookeeper1、zookeeper2、zookeeper3目录下都只需要创建一个data和log目录即可。

3.1、修改配置文件

首先在 /usr/local/zookeeper-3.4.11 目录下创建 temp/zk子目录,在该子目录下分别创建data1、data2、data3和log1、log2、log3目录。另外在data1、data2、data3中均创建myid文件。

mkdir -p /usr/local/zookeeper-3.4.11/temp/zk
cd /usr/local/zookeeper-3.4.11/temp/zk
mkdir data1
mkdir data2
mkdir data3
mkdir log1
mkdir log2
mkdir log3# 分别在data1、data2、data3目录下创建myid文件,并分别写入1、2、3,代表zookeeper服务的id
echo 1 > data1/myid
echo 2 > data2/myid
echo 3 > data3/myid

复制三个配置文件:

cp zoo_sample.cfg zoo1.cfg
cp zoo_sample.cfg zoo2.cfg
cp zoo_sample.cfg zoo3.cfg

分别修改zoo1.cfg、zoo2.cfg和zoo3.cfg三个配置文件,这三个配置文件的区别就在于dataDir、dataLogDir 和 clientPort 的不同。

zoo1.cfg文件内容如下所示:

# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial 
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between 
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just 
# example sakes.
#dataDir=D:/MySoftware/Install/tools/zookeeper/data
#dataLogDir=D:/MySoftware/Install/tools/zookeeper/log
dataDir=/usr/local/zookeeper-3.4.11/temp/zk/data1
dataLogDir=/usr/local/zookeeper-3.4.11/temp/zk/log1# the port at which the clients will connect
clientPort=2181server.1=192.168.1.128:2888:3888
server.2=192.168.1.128:2889:3889
server.3=192.168.1.128:2890:3890# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the 
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1## Metrics Providers
#
# https://prometheus.io Metrics Exporter
#metricsProvider.className=org.apache.zookeeper.metrics.prometheus.PrometheusMetricsProvider
#metricsProvider.httpPort=7000
#metricsProvider.exportJvmInfo=true

zoo2.cfg文件内容如下所示:

# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial 
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between 
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just 
# example sakes.
#dataDir=D:/MySoftware/Install/tools/zookeeper/data
#dataLogDir=D:/MySoftware/Install/tools/zookeeper/log
dataDir=/usr/local/zookeeper-3.4.11/temp/zk/data2
dataLogDir=/usr/local/zookeeper-3.4.11/temp/zk/log2# the port at which the clients will connect
clientPort=2182server.1=192.168.1.128:2888:3888
server.2=192.168.1.128:2889:3889
server.3=192.168.1.128:2890:3890# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the 
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1## Metrics Providers
#
# https://prometheus.io Metrics Exporter
#metricsProvider.className=org.apache.zookeeper.metrics.prometheus.PrometheusMetricsProvider
#metricsProvider.httpPort=7000
#metricsProvider.exportJvmInfo=true

zoo3.cfg文件内容如下所示:

# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial 
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between 
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just 
# example sakes.
#dataDir=D:/MySoftware/Install/tools/zookeeper/data
#dataLogDir=D:/MySoftware/Install/tools/zookeeper/log
dataDir=/usr/local/zookeeper-3.4.11/temp/zk/data3
dataLogDir=/usr/local/zookeeper-3.4.11/temp/zk/log3# the port at which the clients will connect
clientPort=2183server.1=192.168.1.128:2888:3888
server.2=192.168.1.128:2889:3889
server.3=192.168.1.128:2890:3890# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the 
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1## Metrics Providers
#
# https://prometheus.io Metrics Exporter
#metricsProvider.className=org.apache.zookeeper.metrics.prometheus.PrometheusMetricsProvider
#metricsProvider.httpPort=7000
#metricsProvider.exportJvmInfo=true

3.2、配置环境变量

修改/etc/profile文件,在文件最后加上如下配置:

#set zookeeper
export ZOOKEEPER_HOME=/usr/local/zookeeper-3.4.11
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$HADOOP_HOME/bin:$ZOOKEEPER_HOME/bin:$PATH:$HOME/bin

然后执行 source /etc/profile 命令使修改立即生效。

3.3、启动zookeeper

进入到zookeeper的bin目录下,分别执行下面三个命令,启动zookeeper。

./zkServer.sh start zoo1.cfg
./zkServer.sh start zoo2.cfg
./zkServer.sh start zoo3.cfg

查看zookeeper的状态:

通过下面的命令可以查看三个server哪个是 leader,哪个是follower:

./zkServer.sh status zoo1.cfg
./zkServer.sh status zoo2.cfg
./zkServer.sh status zoo3.cfg

通过客户端连接zookeeper,可以查看zookeeper的节点。

./zkCli.sh -server 192.168.1.128:2181

4、集群部署zookeeper

这里以三台计算机为例,在三台计算机上实现zookeeper的集群部署。在三台计算机上都下载zookeeper-3.4.11.tar.gz压缩包,然后解压成zookeeper-3.4.11目录。下面演示先在一台计算机上操作,剩下两台计算机的操作与这一台完全相同。

4.1、修改配置文件

类似于伪集群部署,先在 /usr/local/zookeeper-3.4.11 目录下创建 temp/zk子目录,并在temp/zk目录下创建data和logs目录。另外在data目录下创建myid文件,并在myid文件中写入一个1~255之间的任意一个数字,比如为1。这三台计算机中的myid文件的内容都不能相同。假设另两台的myid的数字分别是2和3。

mkdir -p /usr/local/zookeeper-3.4.11/temp/zk
cd /usr/local/zookeeper-3.4.11/temp/zk
mkdir data
mkdir log# 在data目录下创建myid文件,并写入1,代表zookeeper服务的id
echo 1 > data1/myid

执行如下命令:mv  zoo_sample.cfg  zoo.cfg 将zoo_sample.cfg重命名为zoo.cfg,或者执行 cp  zoo_sample.cfg  zoo.cfg 生成zoo.cfg文件,然后修改zoo.cfg文件。

在三台计算机的zoo.cfg中都加入下面三行(三台计算机的zoo.cfg内容可以完全相同):

server.1=192.168.1.128:2888:3888
server.2=192.168.1.129:2888:3888
server.3=192.168.1.130:2888:3888

server.X=A:B:C,如果配置的是伪集群模式,三个serverip地址都相同,所以各个serverB, C参数必须不同。这里是集群模式,三个serverip地址不同,故BC可以相同

# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial 
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between 
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just 
# example sakes.
#dataDir=D:/MySoftware/Install/tools/zookeeper/data
#dataLogDir=D:/MySoftware/Install/tools/zookeeper/log
dataDir=/usr/local/zookeeper-3.4.11/temp/zk/data
dataLogDir=/usr/local/zookeeper-3.4.11/temp/zk/log# the port at which the clients will connect
clientPort=2181server.1=192.168.1.128:2888:3888
server.2=192.168.1.129:2888:3888
server.3=192.168.1.130:2888:3888# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the 
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1## Metrics Providers
#
# https://prometheus.io Metrics Exporter
#metricsProvider.className=org.apache.zookeeper.metrics.prometheus.PrometheusMetricsProvider
#metricsProvider.httpPort=7000
#metricsProvider.exportJvmInfo=true

clientPort是客户端连接zookeeper服务器的端口,由于这里是集群部署,每台zookeeper服务器的ip地址都不相同(如上面所示),所以三台服务器的clientPort可以相同。客户端通过下面的命令与其中一个zookeeper服务器建立连接(这里以ip为192.168.1.128的主机为例):

命令:bash zkCli.sh -server 192.168.1.128:2181 以主机号192.168.1.128,端口号2181连接。

3.2、配置环境变量

修改/etc/profile文件,在文件最后加上如下配置:

#set zookeeper
export ZOOKEEPER_HOME=/usr/local/zookeeper-3.4.11
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$HADOOP_HOME/bin:$ZOOKEEPER_HOME/bin:$PATH:$HOME/bin

然后执行 source /etc/profile 命令使修改立即生效。

3.3、启动zookeeper

在三台计算机上都要进入到zookeeper的bin目录下,执行下面的命令:

./zkServer.sh start zoo.cfg

./zkServer.sh start zoo.cfg

在三台计算机上都要进入到zookeeper的bin目录下,执行下面的命令查看zookeeper的状态:

./zkServer.sh status zoo.cfg

./zkServer.sh status zoo.cfg

客户端通过下面的命令连接zookeeper服务器,可以查看zookeeper的节点。

./zkCli.sh -server 192.168.1.128:2181      (连接ip192.168.1.128zookeeper服务器)

./zkCli.sh -server 192.168.1.129:2181      (连接ip192.168.1.129zookeeper服务器)

./zkCli.sh -server 192.168.1.130:2181      (连接ip192.168.1.130zookeeper服务器)

./zkCli.sh -server 192.168.1.128:2181      (连接ip为192.168.1.128的zookeeper服务器)./zkCli.sh -server 192.168.1.129:2181      (连接ip为192.168.1.129的zookeeper服务器)./zkCli.sh -server 192.168.1.130:2181      (连接ip为192.168.1.130的zookeeper服务器)

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

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

相关文章

docker部署mongo过程

1、拉取MongoDB镜像,这里拉取最新版本。 docker pull mongo2、运行容器 docker run -d --name mongo -p 27017:27017 \ -e MONGO_INITDB_ROOT_USERNAMEadmin \ -e MONGO_INITDB_ROOT_PASSWORD123456 \ mongo:latest --auth#由于 mongodb 默认情况下,…

寒假前端第一次作业

1、用户注册&#xff1a; <!DOCTYPE html> <html lang"en"> <head><meta charset"UTF-8"><meta name"viewport" content"widthdevice-width, initial-scale1.0"><title>用户注册</title> …

Flink异步IO

本文讲解 Flink 用于访问外部数据存储的异步 I/O API。对于不熟悉异步或者事件驱动编程的用户,建议先储备一些关于 Future 和事件驱动编程的知识。 本文代码gitee地址: https://gitee.com/ddxygq/BigDataTechnical/blob/main/Flink/src/main/java/operator/AsyncIODemo.java …

Java面试——框架篇

1、Spring框架中的单例bean是线程安全的吗&#xff1f; 所谓单例就是所有的请求都用一个对象来处理&#xff0c;而多例则指每个请求用一个新的对象来处理。 结论&#xff1a;线程不安全。 Spring框架中有一个Scope注解&#xff0c;默认的值就是singleton&#xff0c;单例的。一…

性能优化-OpenMP概述(一)-宏观全面理解OpenMP

本文旨在从宏观角度来介绍OpenMP的原理、编程模型、以及在各个领域的应用、使用、希望读者能够从本文整体上了解OpenMP。 &#x1f3ac;个人简介&#xff1a;一个全栈工程师的升级之路&#xff01; &#x1f4cb;个人专栏&#xff1a;高性能&#xff08;HPC&#xff09;开发基础…

多语言历史报纸广告事件抽取(ACL2023)

1、写作动机&#xff1a; 首先&#xff0c;获取大规模的、有注释的历史数据集是困难的&#xff0c;因为只有领域专家才能可靠地为它们打标签。其次&#xff0c;大多数现成的NLP模型是在现代语言文本上训练的&#xff0c;这使得它们在应用于历史语料库时效果显著降低。这对于研…

响应式Web开发项目教程(HTML5+CSS3+Bootstrap)第2版 例3-4 CSS 立方体

代码 <!doctype html> <html> <head> <meta charset"utf-8"> <title>CSS 立方体</title> <link href"CSS/style.css" rel"stylesheet" type"text/css"> <style> .box {width: 200px…

【Docker】快速入门之Docker的安装及使用

一、引言 1、什么是Docker Docker是一个开源的应用容器引擎&#xff0c;它让开发者可以将他们的应用及其依赖打包到一个可移植的镜像中&#xff0c;然后发布到任何流行的Linux或Windows操作系统的机器上&#xff0c;也可以实现虚拟化。容器是完全使用沙箱机制&#xff0c;相互之…

滚柱导轨精度等级是如何划分?

滚柱导轨的精度等级主要根据其表面精度、滑块与导轨表面的公差以及定位精度等性能指标来划分。根据不同的标准和应用需求&#xff0c;精度等级的划分存在一定的差异。 1、行走平行度&#xff1a;普通级&#xff08;无标注/C&#xff09;5μm&#xff0c;高级&#xff08;H&…

vue/vue3/js来动态修改我们的界面浏览器上面的文字和图标

前言&#xff1a; 整理vue/vue3项目中修改界面浏览器上面的文字和图标的方法。 效果&#xff1a; vue2/vue3: 默认修改 public/index.html index.html <!DOCTYPE html> <html lang"en"><head><link rel"icon" type"image/sv…

超维空间M1无人机使用说明书——41、ROS无人机使用yolo进行物体识别

引言&#xff1a;用于M1无人机使用的18.04系统&#xff0c;采用的opencv3.4.5版本&#xff0c;因此M1无人机只提供了基于yolov3和yolov4版本的darknet_ros功能包进行物体识别&#xff0c;识别效果足够满足日常的物体识别使用&#xff0c;如果需要更高版本的yolov7或者yolov8&am…

python tcp socket中实现SSL/TLS认证

SSL/TLS介绍 官话说SSL是安全套接层(secure sockets layer)&#xff0c;TLS是SSL的继任者&#xff0c;叫传输层安全(transport layer security)。 说白点&#xff0c;就是在明文的上层和TCP层之间加上一层加密&#xff0c;这样就保证上层信息传输的安全。如HTTP协议是明文传输…

大模型LLM Agent在 Text2SQL 应用上的实践

1.前言 在上篇文章中「如何通过Prompt优化Text2SQL的效果」介绍了基于Prompt Engineering来优化Text2SQL效果的实践&#xff0c;除此之外我们还可以使用Agent来优化大模型应用的效果。 本文将从以下4个方面探讨通过AI Agent来优化LLM的Text2SQL转换效果。 1 Agent概述2 Lang…

Flashduty 案例分享 - 途游游戏

Flashduty 作为功能完备的事件OnCall中心&#xff0c;可以接入云上、云下不同监控系统&#xff0c;统一做告警降噪分派、认领升级、排班协同&#xff0c;已经得到众多先进企业的认可。我们采访了一些典型客户代表&#xff0c;了解他们的痛点、选型考虑和未来展望&#xff0c;集…

烟火自动识别预警和监管系统 烟火检测识别系统---豌豆云

烟火自动识别预警和监管系统 烟火检测识别系统—豌豆云 烟火检测报警系统全自动对视频图象信息开展解析鉴别&#xff0c;不用人工控制;及时处理工地监控地区内烟雾、火焰&#xff0c;以更快、最好的形式开展预警信息。 合理的帮助管理者解决&#xff0c;并最大限度的减少乱报…

力扣hot100 二叉树的最近公共祖先 递归

Problem: 236. 二叉树的最近公共祖先 &#x1f468;‍&#x1f3eb; 参考大佬题解 &#x1f496; 图解 时间复杂度, 示例&#xff1a; O ( n ) O(n) O(n) 空间复杂度, 示例&#xff1a; O ( n ) O(n) O(n) &#x1f496; AC code /*** Definition for a binary tree node.*…

Linux网络编程(一-网络相关知识点)

目录 一、网络相关知识简介 二、网络协议的分层模型 2.1 OSI七层模型 2.2 TCP/IP五层模型 2.3 协议层报文间的封装与拆封 三、IP协议 3.1 MAC地址 3.2 IP地址 3.3 MAC地址与IP地址区别 一、网络相关知识简介 互联网通信的本质是数字通信&#xff0c;任何数字通信都离…

微信小程序:flex常用布局

在我们平时微信小程序开发过程中为了页面能达到设计小伙伴的预期&#xff0c;追求还原度&#xff0c;那我们肯定会使用很多常用的布局方式&#xff0c;那我们今天就介绍一下微信小程序中常用的一些flex布局 1、常用flex布局 /** 水平垂直居中 **/ .flex-center {display: fle…

Android Studio点击Run背后发生了什么

文章目录 背景&#x1f4d2;真相 &#x1f418;Projects 和 taskSettings文件build.gradle脚本 Gradle的执行流程 背景&#x1f4d2; 在 Android Studio 中经常点击“RUN”按钮&#xff0c;即可对编写的代码进行编译、打包&#xff0c;安装到目标设备&#xff0c;并运行APP&am…

6.2 声音编辑工具GoldWave5简介(2)

6.2.2转换声音格式 GoldWave5支持多种声音格式&#xff0c;它不但可以编辑扩展名是wav、mp3、au、voc等格式的声音文件&#xff0c;还可以编辑Apple电脑所使用的声音文件&#xff1b;并且GoldWave5还可以把Matlab中的mat文件当作声音文件来处理。利用这些功能可以很容易进行声…