【搭建 Hbase 集群】

news2024/9/27 5:48:56

搭建 Hbase 集群

  • 一、准备工作
  • 二、三台服务器之间的 SSH 免密登录
    • 1.修改hosts文件添加DNS映射
    • 2.在每台服务器上生成 SSH 密钥对
    • 3.将公共密钥(通常为 ~/.ssh/id_rsa.pub)复制到目标服务器上
    • 4.从本地使用 SSH 命令无需密码连接到目标服务器
  • 二、安装JDK
    • 1.执行解压更名
    • 2.配置环境 source生效
    • 3.分发环境配置
  • 三、安装ZooKeeper 来协调和管理集群中的各个节点
    • 1.解压更名
    • 2.修改配置文件
      • 2-1.配置文件更名修改配置
      • 2-2.根据配置创建数据所需文件夹
    • 3.配置环境
    • 4.分发环境
    • 5.分发环境
      • 5-1.文件远程拷贝
      • 5-2. lvresun-server2、lvrensun-server3 source生效环境变量
    • 6. 每台zookeeper服务分配myid
    • 7.启动验证
    • 8.验证宕机选举是否正常

在内容开始之前需要了解一下几个方面的知识会更好的帮助学习和搭建Hbase集群

  • Hadoop:Hbase 是建立在 Hadoop基础之上的分布式数据库。了解 Hadoop 的基本概念和架构将有助于您理解 Hbase 的工作原理。

  • 分布式系统:Hbase是一个分布式数据库,它将数据存储在多台服务器上。了解分布式系统的概念、优点、挑战和常见的解决方案,将帮助您更好地理解和管理
    Hbase集群。

  • ZooKeeper:Hbase 使用 ZooKeeper 来协调和管理集群中的各个节点。了解 ZooKeeper的基本概念、角色和功能,以及如何安装、配置和运行 ZooKeeper,将有助于您正确地配置和管理 Hbase 的
    ZooKeeper。

  • 网络和主机配置:在搭建 Hbase集群之前,需要确保服务器之间能够相互通信,并具有足够的网络带宽和稳定性。此外,还需要了解如何设置主机名解析和网络配置,以便在集群中使用主机名进行通信。

  • 数据模型和表设计:Hbase 使用键值对存储和访问数据,了解如何设计良好的数据模型和表结构将有助于提高性能和查询效率。

  • 安全性配置:在生产环境中搭建 Hbase集群时,安全性是一个重要的考虑因素。了解如何配置安全认证和访问控制,以保护您的数据和集群是很重要的。

一、准备工作

  1. Hadoop 官方网站 https://archive.apache.org/dist/hadoop/common/
  2. Hbase:官方网站 https://archive.apache.org/dist/hbase/
  3. ZooKeeper:Hbase 使用 ZooKeeper进行协调和管理。官方网站:https://archive.apache.org/dist/zookeeper/
  4. HDFS:Hbase 使用 Hadoop HDFS存储其数据。因此,您需要安装和配置 Hadoop HDFS。一般情况下,Hadoop 的安装包中已经包含了 HDFS。
  5. JDK:确保服务器上安装了 Java Development Kit(JDK)。Hadoop 和 Hbase 都需要运行在 Java环境中,因此需要安装并正确配置 JDK。

我们在这里使用的是一下版本:

lvrensun-server1

[root@lvrensun-server1 soft]# pwd
/root/soft
[root@lvrensun-server1 soft]# ll -h
总用量 700M
-rw-r--r--.  1 root root 396M 22 23:09 hadoop-2.10.2.tar.gz
-rw-r--r--.  1 root root  79M 130 01:50 hbase-0.98.6-hadoop2-bin.tar.gz
-rw-r--r--.  1 root root 177M 316 2017 jdk-8u131-linux-x64.tar.gz
-rw-r--r--.  1 root root  16M 130 01:50 zookeeper-3.4.5.tar.gz
[root@lvrensun-server1 soft]# 

lvrensun-server2

[root@lvrensun-server2 soft]# pwd
/root/soft
[root@lvrensun-server2 soft]# ll -h
总用量 0
[root@lvrensun-server2 soft]# 

lvrensun-server3

[root@lvrensun-server3 soft]# pwd
/root/soft
[root@lvrensun-server3 soft]# ll -h
总用量 0
[root@lvrensun-server3 soft]# 

可以看到上方显示有三台服务器分别是:

hostnameIP资源路径是否有资源包
lvrensun-server1192.168.0.11/root/soft
lvrensun-server2192.168.0.22/root/soft
lvrensun-server3192.168.0.33/root/soft

二、三台服务器之间的 SSH 免密登录

1.修改hosts文件添加DNS映射

vim /etc/hosts

如下图所示
在这里插入图片描述

2.在每台服务器上生成 SSH 密钥对

[root@lvrensun-server1 soft]# ssh-keygen -t rsa
[root@lvrensun-server2 soft]# ssh-keygen -t rsa
[root@lvrensun-server3 soft]# ssh-keygen -t rsa

在生成密钥对时,您可以选择存储位置和设置密钥的密码。如果留空密码,则可以实现完全无密码的免密登录。

3.将公共密钥(通常为 ~/.ssh/id_rsa.pub)复制到目标服务器上

[root@lvrensun-server1 ~]# ssh-copy-id root@192.168.0.11
[root@lvrensun-server1 ~]# ssh-copy-id root@192.168.0.22
[root@lvrensun-server1 ~]# ssh-copy-id root@192.168.0.33
[root@lvrensun-server2 ~]# ssh-copy-id root@192.168.0.11
[root@lvrensun-server2 ~]# ssh-copy-id root@192.168.0.22
[root@lvrensun-server2 ~]# ssh-copy-id root@192.168.0.33
[root@lvrensun-server3 ~]# ssh-copy-id root@192.168.0.11
[root@lvrensun-server3 ~]# ssh-copy-id root@192.168.0.22
[root@lvrensun-server3 ~]# ssh-copy-id root@192.168.0.33

前两步其中一台服务器详细执行步骤如下:

[root@lvrensun-server1 soft]# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:QeDtQ6BMG5mIM2rk2DjM87H5Qe9uCv2i16bF55CI3fI root@lvrensun-server1
The key's randomart image is:
+---[RSA 2048]----+
| . .ooo..        |
|+..oo= +         |
|B=  + . +        |
|=*.. . o .       |
|..o = . S        |
|   ++.+...       |
|   o.=+* .       |
|    .+==+        |
|   .ooBE .       |
+----[SHA256]-----+
[root@lvrensun-server1 ~]# cat ~/.ssh/id_rsa.pub 
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDNW0i7f2CAa/rq55WqUtJBc8igbOSTrsJGlFjX2s1XmONL1nPHk3eKEy1HrqC5kpEwgjYcIawtIq/apERkjqeGNRbjV9/Sq7zUvwiONA1+WJTwI80RyH84ZhV6aHuXTrly+9cx8UF1TbVRh0WgWZcjzFZdzDVIcB18zsBmWXZsGZxxVYD4fjkfXjMKJwOcAGXlUWb3J7O30uB9GcJhasTN98QcFmVp+cGldNJbTlXgUSUffD0HTOAPhlWDgWI3dFq+jCnCI4XzugyF0vU4dv81FiBTgcTxJ25tJvnw2PwtxhSEpklfK9UuYLBrOlDMsDBlkKBITTddJkLOvCsLr1Sr root@lvrensun-server1
[root@lvrensun-server1 ~]# ssh-copy-id root@192.168.0.11
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
The authenticity of host '192.168.0.11 (192.168.0.11)' can't be established.
ECDSA key fingerprint is SHA256:SPQuwBgvdNmYL9PVBgcGTkuynS9iqvn3pBvXv6ZcePw.
ECDSA key fingerprint is MD5:db:a1:53:83:6c:52:e5:6c:d8:75:6a:05:47:b7:26:5b.
Are you sure you want to continue connecting (yes/no)? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
root@192.168.0.11's password: 

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh 'root@192.168.0.11'"
and check to make sure that only the key(s) you wanted were added.

[root@lvrensun-server1 ~]# ssh-copy-id root@192.168.0.22
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
The authenticity of host '192.168.0.22 (192.168.0.22)' can't be established.
ECDSA key fingerprint is SHA256:SPQuwBgvdNmYL9PVBgcGTkuynS9iqvn3pBvXv6ZcePw.
ECDSA key fingerprint is MD5:db:a1:53:83:6c:52:e5:6c:d8:75:6a:05:47:b7:26:5b.
Are you sure you want to continue connecting (yes/no)? yes   
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
root@192.168.0.22's password: 

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh 'root@192.168.0.22'"
and check to make sure that only the key(s) you wanted were added.

[root@lvrensun-server1 ~]# ssh-copy-id root@192.168.0.33
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
The authenticity of host '192.168.0.33 (192.168.0.33)' can't be established.
ECDSA key fingerprint is SHA256:SPQuwBgvdNmYL9PVBgcGTkuynS9iqvn3pBvXv6ZcePw.
ECDSA key fingerprint is MD5:db:a1:53:83:6c:52:e5:6c:d8:75:6a:05:47:b7:26:5b.
Are you sure you want to continue connecting (yes/no)? yes   
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
root@192.168.0.33's password:

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh 'root@192.168.0.33'"
and check to make sure that only the key(s) you wanted were added.

[root@lvrensun-server1 ~]# 

4.从本地使用 SSH 命令无需密码连接到目标服务器

lvrensun-server1

[root@lvrensun-server1 ~]# ssh lvrensun-server1
Last login: Fri Feb  2 12:54:38 2024 from lvrensun-server2
[root@lvrensun-server1 ~]# exit
登出
Connection to lvrensun-server1 closed.
[root@lvrensun-server1 ~]# ssh lvrensun-server2
Last login: Fri Feb  2 12:54:51 2024 from lvrensun-server2
[root@lvrensun-server2 ~]# exit
登出
Connection to lvrensun-server2 closed.
[root@lvrensun-server1 ~]# ssh lvrensun-server3
Last login: Fri Feb  2 12:55:14 2024 from lvrensun-server2
[root@lvrensun-server3 ~]# 

lvrensun-server2

[root@lvrensun-server2 ~]# ssh lvrensun-server1
Last login: Fri Feb  2 12:53:50 2024 from lvrensun-server2
[root@lvrensun-server1 ~]# exit
登出
Connection to lvrensun-server1 closed.
[root@lvrensun-server2 ~]# ssh lvrensun-server2
Last login: Fri Feb  2 12:54:09 2024 from lvrensun-server2
[root@lvrensun-server2 ~]# exit
登出
Connection to lvrensun-server2 closed.
[root@lvrensun-server2 ~]# ssh lvrensun-server3
Last login: Fri Feb  2 12:54:21 2024 from lvrensun-server2
[root@lvrensun-server3 ~]# 

lvrensun-server3

[root@lvrensun-server3 ~]# ssh lvrensun-server1
Last login: Fri Feb  2 12:56:09 2024 from lvrensun-server1
[root@lvrensun-server1 ~]# exit
登出
Connection to lvrensun-server1 closed.
[root@lvrensun-server3 ~]# ssh lvrensun-server2
Last login: Fri Feb  2 12:56:19 2024 from lvrensun-server1
[root@lvrensun-server2 ~]# exit
登出
Connection to lvrensun-server2 closed.
[root@lvrensun-server3 ~]# ssh lvrensun-server3
Last login: Fri Feb  2 12:56:27 2024 from lvrensun-server1
[root@lvrensun-server3 ~]# 

二、安装JDK

Hadoop 和 Hbase 都需要运行在 Java环境中因此JDK属于基础环境

1.执行解压更名

 tar -xzvf jdk-8u131-linux-x64.tar.gz
 mv jdk-1.8.0-u131/ jdk1.8

如下:

-rw-r--r--. 1 root root  34687765 1月  30 01:50 hadoop-2.10.2-site.tar.gz
-rw-r--r--. 1 root root  82347017 1月  30 01:50 hbase-0.98.6-hadoop2-bin.tar.gz
drwxr-xr-x. 8   10  143       255 315 2017 jdk1.8
-rw-r--r--. 1 root root 185540433 3月  16 2017 jdk-8u131-linux-x64.tar.gz
-rw-r--r--. 1 root root  16402010 1月  30 01:50 zookeeper-3.4.5.tar.gz

2.配置环境 source生效

vim /etc/profile

[root@lvrensun-server1 soft]# vim /etc/profile

添加配置

export JAVA_HOME=/root/soft/jdk1.8
export PATH=$PATH:$JAVA_HOME/bin

source生效

[root@lvrensun-server1 soft]# source /etc/profile
[root@lvrensun-server1 soft]# java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
[root@lvrensun-server1 soft]# 

3.分发环境配置

分发JDK

[root@lvrensun-server1 soft]# scp -r jdk1.8/ lvrensun-server2:/root/soft/
[root@lvrensun-server1 soft]# scp -r jdk1.8/ lvrensun-server3:/root/soft/

分发环境变量

[root@lvrensun-server1 soft]# scp /etc/profile lvrensun-server2:/etc/
[root@lvrensun-server1 soft]# scp /etc/profile lvrensun-server3:/etc/

再到 lvresun-server2、lvrensun-server3 source生效环境变量

[root@lvrensun-server2 ~]# source /etc/profile
[root@lvrensun-server2 ~]# java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
[root@lvrensun-server2 ~]# 
[root@lvrensun-server3 soft]# source /etc/profile
[root@lvrensun-server3 soft]# java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
[root@lvrensun-server3 soft]# 

三、安装ZooKeeper 来协调和管理集群中的各个节点

1.解压更名

[root@lvrensun-server1 soft]# tar -xzvf zookeeper-3.4.5.tar.gz
.......
-rw-r--r--.  1 root root   34687765 1月  30 01:50 hadoop-2.10.2-site.tar.gz
-rw-r--r--.  1 root root   82347017 1月  30 01:50 hbase-0.98.6-hadoop2-bin.tar.gz
drwxr-xr-x.  8   10   143       255 315 2017 jdk1.8
-rw-r--r--.  1 root root  185540433 3月  16 2017 jdk-8u131-linux-x64.tar.gz
drwxr-xr-x. 10  501 games      4096 115 2012 zookeeper-3.4.5
-rw-r--r--.  1 root root   16402010 1月  30 01:50 zookeeper-3.4.5.tar.gz
[root@lvrensun-server1 soft]# mv zookeeper-3.4.5 zookeeper
[root@lvrensun-server1 soft]# ll
总用量 311512
-rw-r--r--.  1 root root   34687765 1月  30 01:50 hadoop-2.10.2-site.tar.gz
-rw-r--r--.  1 root root   82347017 1月  30 01:50 hbase-0.98.6-hadoop2-bin.tar.gz
drwxr-xr-x.  8   10   143       255 315 2017 jdk1.8
-rw-r--r--.  1 root root  185540433 3月  16 2017 jdk-8u131-linux-x64.tar.gz
drwxr-xr-x. 10  501 games      4096 115 2012 zookeeper
-rw-r--r--.  1 root root   16402010 1月  30 01:50 zookeeper-3.4.5.tar.gz
[root@lvrensun-server1 soft]# 

2.修改配置文件

2-1.配置文件更名修改配置

[root@lvrensun-server1 conf]# pwd
/root/soft/zookeeper/conf
[root@lvrensun-server1 conf]# mv zoo_sample.cfg zoo.cfg
[root@lvrensun-server1 conf]# vim 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=/root/soft/zookeeper/data
dataLogDir=/root/soft/zookeeper/log
# the port at which the clients will connect
clientPort=2181
#
# 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

server.1=lvrensun-server1:2888:2299
server.2=lvrensun-server2:2888:2299
server.3=lvrensun-server3:2888:2299

2-2.根据配置创建数据所需文件夹

[root@lvrensun-server1 conf]# mkdir -p /root/soft/zookeeper/data
[root@lvrensun-server1 conf]# mkdir -p /root/soft/zookeeper/log
[root@lvrensun-server1 conf]# ll ../
总用量 1488
drwxr-xr-x.  2  501 games     149 22 13:18 bin
-rw-r--r--.  1  501 games   75988 10月  1 2012 build.xml
-rw-r--r--.  1  501 games   70223 10月  1 2012 CHANGES.txt
drwxr-xr-x.  2  501 games      70 22 13:32 conf
drwxr-xr-x. 10  501 games     130 22 13:18 contrib
drwxr-xr-x.  2 root root        6 22 13:34 data
drwxr-xr-x.  2  501 games    4096 22 13:18 dist-maven
drwxr-xr-x.  6  501 games    4096 22 13:18 docs
-rw-r--r--.  1  501 games    1953 10月  1 2012 ivysettings.xml
-rw-r--r--.  1  501 games    3120 10月  1 2012 ivy.xml
drwxr-xr-x.  4  501 games     235 22 13:18 lib
-rw-r--r--.  1  501 games   11358 10月  1 2012 LICENSE.txt
drwxr-xr-x.  2 root root        6 22 13:34 log
-rw-r--r--.  1  501 games     170 10月  1 2012 NOTICE.txt
-rw-r--r--.  1  501 games    1770 10月  1 2012 README_packaging.txt
-rw-r--r--.  1  501 games    1585 10月  1 2012 README.txt
drwxr-xr-x.  5  501 games      47 22 13:18 recipes
drwxr-xr-x.  8  501 games     154 22 13:18 src
-rw-r--r--.  1  501 games 1315806 11月  5 2012 zookeeper-3.4.5.jar
-rw-r--r--.  1  501 games     833 11月  5 2012 zookeeper-3.4.5.jar.asc
-rw-r--r--.  1  501 games      33 11月  5 2012 zookeeper-3.4.5.jar.md5
-rw-r--r--.  1  501 games      41 11月  5 2012 zookeeper-3.4.5.jar.sha1
[root@lvrensun-server1 conf]# 

3.配置环境

[root@lvrensun-server1 zookeeper]# vim /etc/profile

添加内容:

export ZOOKEEPER_HOME=/root/soft/zookeeper
export PATH=$PATH:$ZOOKEEPER_HOME/bin

生效

[root@lvrensun-server1 zookeeper]# source /etc/profile

4.分发环境

分发包:

[root@lvrensun-server1 soft]# pwd
/root/soft
[root@lvrensun-server1 soft]# scp -r zookeeper lvrensun-server2:/root/soft/
......
[root@lvrensun-server1 soft]# scp -r zookeeper lvrensun-server3:/root/soft/
......
[root@lvrensun-server1 soft]# 

5.分发环境

5-1.文件远程拷贝

[root@lvrensun-server1 soft]# scp /etc/profile lvrensun-server2:/etc/
[root@lvrensun-server1 soft]# scp /etc/profile lvrensun-server3:/etc/

5-2. lvresun-server2、lvrensun-server3 source生效环境变量

[root@lvrensun-server2 soft]# source /etc/profile
[root@lvrensun-server3 soft]# source /etc/profile

6. 每台zookeeper服务分配myid

[root@lvrensun-server1 bin]# echo "1" > /root/soft/zookeeper/data/myid
[root@lvrensun-server2 bin]# echo "2" > /root/soft/zookeeper/data/myid
[root@lvrensun-server3 bin]# echo "3" > /root/soft/zookeeper/data/myid

其中 myid中的 1、2、3 分别对应的是 zoo.cfg 文件中配置项server.1、server.2、server.3中一一对应的数字,知道就行了,对应即可

7.启动验证

[root@lvrensun-server1 bin]# cd /root/soft/zookeeper/bin/
[root@lvrensun-server1 bin]# zkServer.sh start
JMX enabled by default
Using config: /root/soft/zookeeper/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
[root@lvrensun-server1 bin]# zkServer.sh status
JMX enabled by default
Using config: /root/soft/zookeeper/bin/../conf/zoo.cfg
Mode: follower
[root@lvrensun-server1 bin]# 

[root@lvrensun-server2 bin]# cd /root/soft/zookeeper/bin/
[root@lvrensun-server2 bin]# zkServer.sh start
JMX enabled by default
Using config: /root/soft/zookeeper/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
[root@lvrensun-server2 bin]# zkServer.sh status
JMX enabled by default
Using config: /root/soft/zookeeper/bin/../conf/zoo.cfg
Mode: follower
[root@lvrensun-server2 bin]# 

[root@lvrensun-server3 bin]# cd /root/soft/zookeeper//bin/
[root@lvrensun-server3 bin]# zkServer.sh start
JMX enabled by default
Using config: /root/soft/zookeeper/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
[root@lvrensun-server3 bin]# zkServer.sh status
JMX enabled by default
Using config: /root/soft/zookeeper/bin/../conf/zoo.cfg
Mode: leader

启动一切正产 lvrensun-server3 为主节点

8.验证宕机选举是否正常

把主服务器停掉

[root@lvrensun-server3 bin]# ./zkServer.sh stop
JMX enabled by default
Using config: /root/soft/zookeeper/bin/../conf/zoo.cfg
Stopping zookeeper ... STOPPED
[root@lvrensun-server3 bin]# 

查看其他两台状态

[root@lvrensun-server1 bin]# zkServer.sh status
JMX enabled by default
Using config: /root/soft/zookeeper/bin/../conf/zoo.cfg
Mode: follower
[root@lvrensun-server1 bin]# 

[root@lvrensun-server2 bin]# zkServer.sh status
JMX enabled by default
Using config: /root/soft/zookeeper/bin/../conf/zoo.cfg
Mode: leader
[root@lvrensun-server2 bin]# 

可以看到 lvrensun-server2 服务器中zookeeper节点已经被选为主服务节点

四、安装 Hadoop Hbase 是建立在 Hadoop基础之上的分布式数据库

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

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

相关文章

Linux/Docker 修改系统时区

目录 1. Linux 系统1.1 通过 timedatectl 命令操作1.2 直接修改 /etc/localtime 文件 2. Docker 容器中的 Linux 操作环境: CentOS / AlmaOSMySQL Docker 镜像 1. Linux 系统 1.1 通过 timedatectl 命令操作 使用 timedatectl list-timezones 命令列出可用的时区…

Learning from Unlabeled 3D Environments forVision-and-Language Navigation

这篇论文是关于高级指令的 摘要 在视觉和语言导航 (VLN) 中,实体代理需要按照自然语言指令在真实的 3D 环境中进行导航。现有 VLN 方法的一个主要瓶颈是缺乏足够的训练数据,导致对未见过的环境的泛化效果不理想。虽然 VLN 数据通常是手动收集的&#x…

2024年 前端JavaScript Web APIs 第一天 笔记

1.1 -声明变量const优先 1.2 -DOM树和DOM对象 1.3 -获取DOIM元素 1.4 -DOM修改元素内容以及年会抽奖 <!DOCTYPE html> <html lang"en"><head><meta charset"UTF-8" /><meta http-equiv"X-UA-Compatible" content&quo…

初识面相对象深入理解、构造方法--学习JavaEE的day12

day12 一、初识面相对象深入理解 需求&#xff1a; 创建人类的对象&#xff0c;并操作对象 分析&#xff1a; 人类 - Person 属性&#xff1a;name、sex、age 方法&#xff1a;eat、sleep 场景&#xff1a;创建多个对象&#xff0c;去操作对象 public class Person {//成员变…

9、taocms代码审计

一、XSS 1、DOM型xss 限制 无复现 payload: aa)alert(1)( 触发的参数&#xff1a;name代码 根据路由找到对应的文件&#xff0c;在api.php里接受全局变量action&#xff0c;最终赋值给$m,判断 如果$m不在数组就结束&#xff0c;新建方法复制给$model。检查类的方法是否存…

2024 年广东省职业院校技能大赛(高职组)“云计算应用”赛项样题 2

#需要资源或有问题的&#xff0c;可私博主&#xff01;&#xff01;&#xff01; #需要资源或有问题的&#xff0c;可私博主&#xff01;&#xff01;&#xff01; #需要资源或有问题的&#xff0c;可私博主&#xff01;&#xff01;&#xff01; 某企业根据自身业务需求&#…

【全局异常处理记录】⭐️通过自定义全局处理器有效统一各种异常并记录

目录 前言 方案 示例 测试 总结 前言 朋友们大家好啊&#xff0c;随着项目的进行&#xff0c;接口也是越来越多了&#xff0c;每个接口无论调用成功与否&#xff0c;都要有相应的应对措施&#xff0c;总不能出错的时候返回一堆异常信息给调用者&#xff0c;所以每个接口都…

Python算法100例-3.2 水仙花数

完整源代码项目地址&#xff0c;关注博主私信源代码后可获取 1.问题描述2.问题分析3.算法设计4.确定程序框架5.完整的程序6.问题拓展7.巧用字符串技巧 1&#xff0e;问题描述 输出所有的“水仙花数”。所谓的“水仙花数”是指一个三位数&#xff0c;其各位数字的立方和等于该…

【机器学习】有监督学习算法之:支持向量机

支持向量机 1、引言2、决策树2.1 定义2.2 原理2.3 实现方式2.4 算法公式2.5 代码示例 3、总结 1、引言 小屌丝&#xff1a;鱼哥&#xff0c;泡澡啊。 小鱼&#xff1a;不去 小屌丝&#xff1a;… 此话当真&#xff1f; 小鱼&#xff1a;此话不假 小屌丝&#xff1a;到底去还是…

奔跑吧,前端er!前端五大方向技能罗列,webGL、AI、桌面、游戏

经常看到头条上前端们争论各种框架的优劣&#xff0c;然后相互争吵不休&#xff0c;其实技术也好&#xff0c;框架也好&#xff0c;都是服务于项目需求的&#xff0c;争论的铁子们都站在自己的项目角度来品评工具&#xff0c;肯定是公说公有理婆说婆有理啦。 技术和框架是中性的…

ArrayBlockingQueue 数组阻塞队列 源码阅读

1. 概述 数组阻塞队列 有界的阻塞数组, 容量一旦创建, 无法修改阻塞队列, 队列满的时候, 往队列put数据会被阻塞, 队列空, 取数据也会被阻塞并发安全 2. 数据结构 /** 存储队列元素的数组 */ /** 存储队列元素的数组 */ final Object[] items;/** 队首位置&#xff0c;下一…

【王道操作系统】ch1计算机系统概述-06虚拟机

文章目录 【王道操作系统】ch1计算机系统概述-06虚拟机01传统计算机02虚拟机的基本概念&#xff08;1&#xff09;第一类虚拟机管理程序&#xff08;2&#xff09; 第二类虚拟机管理程序&#xff08;3&#xff09; 两类虚拟机管理程序的对比 【王道操作系统】ch1计算机系统概述…

【Linux系统化学习】线程概念

目录 线程的概念 线程的引出 什么是线程 理解线程比进程更加的轻量化 线程的优点 现成的缺点 线程异常 线程用途 Linux进程VS线程 线程的简单现象 线程的概念 有关操作系统的书籍或者课本都会这样描述线程&#xff1a; 线程是比进程轻量化的一种执行流线程是进程内部…

[SWPUCTF 2021 新生赛]babyrce

先打开环境 分析代码&#xff0c;要给COOKIE赋值admin1 使用hackbar赋值 打开rasalghul.php 分析代码&#xff0c;使用GET传参url&#xff0c;如果url里没有/ /&#xff0c;则赋值给ip&#xff0c;然后通过shell_exec函数得到flag&#xff0c;否则&#xff0c;返回nonono。他…

备战蓝桥杯————递归反转单链表

当要求只反转单链表中的一部分时&#xff0c;递归实现确实具有一定的挑战性&#xff0c;但也是可行的。下面我将介绍一种递归实现的方法来反转单链表中的一部分。 一、反转链表 题目描述 给你单链表的头节点 head &#xff0c;请你反转链表&#xff0c;并返回反转后的链表。 示…

详解Win 7重置电脑操作步骤

文章目录 介绍Win 7 重置系统的方法&#xff1a;1.按下键盘上的Windows键和R键&#xff0c;打开运行窗口&#xff0c;输入sysprep 点击回车确定。2.之后就会出现如下界面&#xff0c;在这个新打开的窗口中双击 sysprep 程序3.选择【进入系统全新体验&#xff08;00BE) 】&#…

C++ sort排序

sort函数接受两个迭代器作为参数&#xff0c;分别表示要排序的范围的起始和结束位置。 请注意&#xff0c;sort函数默认使用小于运算符&#xff08;<&#xff09;来比较元素的顺序&#xff0c;默认从小到大排。 在这里&#xff0c;使用str.begin()和str.end()来表示整个字符…

【MDVRP多站点物流配送车辆路径规划问题(带容量限制)】基于遗传算法GA求解

课题名称&#xff1a;基于遗传算法求解带容量限制的多站点的物流配送路径问题MDVRP 版本时间&#xff1a;2023-03-12 代码获取方式&#xff1a;QQ&#xff1a;491052175 或者 私聊博主获取 模型描述&#xff1a; 15个城市中&#xff0c;其中北京&#xff0c;长沙和杭州三座…

springboot241基于SpringBoot+Vue的电商应用系统的设计与实现

基于SpringBootVue的电商应用系统的设计与实现 摘 要 现代经济快节奏发展以及不断完善升级的信息化技术&#xff0c;让传统数据信息的管理升级为软件存储&#xff0c;归纳&#xff0c;集中处理数据信息的管理方式。本电商应用系统就是在这样的大环境下诞生&#xff0c;其可以…

构建 ESLint 内存泄露检测插件入门:提升代码质量与防范运行时风险

前言 本文目的是介绍如何创建开发一个自定义规则 ESLint 插件。利用其能力,检测一些代码中可能存在的内存泄露并及时进行提示,避免潜在的后期影响。 本文实现其中一部分功能–检测事件监听器的使用是否存在内存泄露为例来演示基本的 ESLint 自定义规则插件开发的过程。用以…