HBase Shell基本操作

一、进入Hbase Shell客户端

先在Linux Shell命令行终端执行start-dfs.sh脚本启动HDFS,再执行start-hbase.sh脚本启动HBase。如果Linux系统已配置HBase环境变量,可直接在任意目录下执行hbase shell脚本命令,就可进入HBase Shell的命令行终端环境,exit可以退出HBase Shell(我安装的是伪分布式的HBase)。

(1) help帮助命令(或者help '命令名称'查看某一具体命令的使用方法)

hbase:055:0> help
HBase Shell, version 2.5.6, r6bac842797dc26bedb7adc0759358e4c8fd5a992, Sat Oct 14 23:36:46 PDT 2023
Type 'help "COMMAND"', (e.g. 'help "get"' -- the quotes are necessary) for help on a specific command.
Commands are grouped. Type 'help "COMMAND_GROUP"', (e.g. 'help "general"') for help on a command group.COMMAND GROUPS:Group name: generalCommands: processlist, status, table_help, version, whoamiGroup name: ddlCommands: alter, alter_async, alter_status, clone_table_schema, create, describe, disable, disable_all, drop, drop_all, enable, enable_all, exists, get_table, is_disabled, is_enabled, list, list_regions, locate_region, show_filtersGroup name: namespaceCommands: alter_namespace, create_namespace, describe_namespace, drop_namespace, list_namespace, list_namespace_tablesGroup name: dmlCommands: append, count, delete, deleteall, get, get_counter, get_splits, incr, put, scan, truncate, truncate_preserve

二、General通用操作命令

(1)status:查看HBase集群状态

hbase:051:0> status
1 active master, 0 backup masters, 1 servers, 0 dead, 5.0000 average load
Took 2.3419 seconds 

(2)version:查看HBase版本信息

hbase:052:0> version
2.5.6, r6bac842797dc26bedb7adc0759358e4c8fd5a992, Sat Oct 14 23:36:46 PDT 2023
Took 0.0029 seconds 

(3)whoami:查看当前登录HBase的系统用户信息

hbase:053:0> whoami
root (auth:SIMPLE)groups: root
Took 0.1906 seconds 

(4)table_help:查看HBase数据表操作的帮助信息

table_help
Help for table-reference commands.You can either create a table via 'create' and then manipulate the table via commands like 'put', 'get', etc.
See the standard help information for how to use each of these commands.

三、Namespace操作

namespace(命名空间)是HBase对数据表的逻辑分组,用于数据表的业务划分。例如上层应用可以不同业务的数据表分别放置在不同的名字空间,以实现不同业务数据表之间的数据隔离。命名空间和数据表是一对多关系,命名空间可以包含多张数据表,一张数据表只能属于一个名字空间。HBase数据库中的NameSpace类似于MySQL数据库中的database。 命名空间是HBASE对数据表的逻辑分组,用于数据表的业务划分。

(1)list_namespace:查询所有命名空间
hbase:036:0> list_namespace
NAMESPACE                                                                                      
default                                                                                        
hbase                                                                                          
ns1                                                                                            
3 row(s)
Took 0.0654 seconds 
(2)list_namespace_tables : 查询指定命名空间的表
hbase:038:0> list_namespace_tables 'ns1'
TABLE                                                                                          
t1                                                                                             
1 row(s)
Took 0.1958 seconds                                                                            
=> ["t1"]
(3)create_namespace : 创建指定的命名空间
hbase:039:0> create_namespace 'ns2'
Took 0.4516 seconds 
(4)describe_namespace : 查询指定命名空间的结构
hbase:041:0> describe_namespace 'ns2'
DESCRIPTION                                                                                    
{NAME => 'ns2'} 
(5)alter_namespace :修改命名空间的结构
hbase:045:0> alter_namespace 'ns2',{METHOD=>'set','name'=>'new'}
Took 1.6665 seconds                                                                            
hbase:046:0> describe_namespace 'ns2'
DESCRIPTION                                                                                    
{NAME => 'ns2', name => 'new'}                                                                 
Quota is disabled
Took 0.2023 seconds
hbase:047:0> alter_namespace 'ns2',{METHOD=>'unset','NAME'=>'name'}
Took 0.1602 seconds                                                                            
hbase:048:0> describe_namespace 'ns2'
DESCRIPTION                                                                                    
{NAME => 'ns2'}                                                                                
Quota is disabled
Took 0.0878 seconds 
(6)drop_namespace:删除命名空间
hbase:049:0> drop_namespace 'ns2'
Took 0.4194 seconds                                                                            
hbase:050:0> list_namespace
NAMESPACE                                                                                      
default                                                                                        
hbase                                                                                          
ns1                                                                                            
3 row(s)
Took 0.0610 seconds

四、DDL操作命令

DDL分组中包含的操作命令很多,主要用于对HBase数据库表的相关管理操作,主要包括创建表、修改表、删除表、列出表、启用表、禁用表等操作。

(1)create:建表(建表的时候,必须至少指定一个列族名称)

在默认的命名空间中,创建表students,并包含一个名为info的列族,列族属性默认。

#如果保留默认的列族设置,建表时直接写列族的名字就可以了
hbase:070:0> create 'students','info'
2024-03-21 00:25:59,140 INFO  [main] client.HBaseAdmin (HBaseAdmin.java:postOperationResult(3591)) - Operation: CREATE, Table Name: default:students, procId: 131 completed
Created table students
Took 3.4314 seconds                                                                            
=> Hbase::Table - students

 在指定的ns1命名空间中,创建表t1,并包含一个名为f1的列族,列族属性自定义。

#建表的同时指定列族属性
hbase:071:0> create 'ns1:t1',{NAME=>'f1',VERSIONS=>5}
2024-03-21 00:28:43,872 INFO  [main] client.HBaseAdmin (HBaseAdmin.java:postOperationResult(3591)) - Operation: CREATE, Table Name: ns1:t1, procId: 134 completed
Created table ns1:t1
Took 2.3465 seconds                                                                            
=> Hbase::Table - ns1:t1

(2)list : 查询所有的表
hbase:072:0> list
TABLE                                                                                          
students                                                                                       
ns1:t1                                                                                         
2 row(s)
Took 0.2459 seconds                                                                            
=> ["students", "ns1:t1"]
(3)describe/desc : 查询表结构
hbase:074:0> describe 'students'
Table students is ENABLED                                                                      
students, {TABLE_ATTRIBUTES => {METADATA => {'hbase.store.file-tracker.impl' => DEFAULT'}}}   
COLUMN FAMILIES DESCRIPTION                                                                    
{NAME => 'info', INDEX_BLOCK_ENCODING => 'NONE', VERSIONS => '1', KEEP_DELETED_CELLS => 'FALSE'
, DATA_BLOCK_ENCODING => 'NONE', TTL => 'FOREVER', MIN_VERSIONS => '0', REPLICATION_SCOPE => '0
', BLOOMFILTER => 'ROW', IN_MEMORY => 'false', COMPRESSION => 'NONE', BLOCKCACHE => 'true', BLO
CKSIZE => '65536 B (64KB)'}                                                                    
1 row(s)
Quota is disabled
Took 1.1379 seconds

(4)exists : 判断指定表明是否存在

hbase:075:0> exists 'ns1:t1'
Table ns1:t1 does exist                                                                        
Took 0.0714 seconds                                                                            
=> true
(5)alter:修改表,添加、修改、删除列簇信息

为students表格,增加一个列族score。

hbase:076:0> alter 'students','score'
Updating all regions with the new schema...
1/1 regions updated.
Done.
Took 3.8994 seconds                                                                            
hbase:077:0> desc 'students'
Table students is ENABLED                                                                      
students, {TABLE_ATTRIBUTES => {METADATA => {'hbase.store.file-tracker.impl' => 'DEFAULT'}}}   
COLUMN FAMILIES DESCRIPTION                                                                    
{NAME => 'info', INDEX_BLOCK_ENCODING => 'NONE', VERSIONS => '1', KEEP_DELETED_CELLS => 'FALSE'
, DATA_BLOCK_ENCODING => 'NONE', TTL => 'FOREVER', MIN_VERSIONS => '0', REPLICATION_SCOPE => '0
', BLOOMFILTER => 'ROW', IN_MEMORY => 'false', COMPRESSION => 'NONE', BLOCKCACHE => 'true', BLO
CKSIZE => '65536 B (64KB)'}                                                                    {NAME => 'score', INDEX_BLOCK_ENCODING => 'NONE', VERSIONS => '1', KEEP_DELETED_CELLS => 'FALSE
', DATA_BLOCK_ENCODING => 'NONE', TTL => 'FOREVER', MIN_VERSIONS => '0', REPLICATION_SCOPE => '
0', BLOOMFILTER => 'ROW', IN_MEMORY => 'false', COMPRESSION => 'NONE', BLOCKCACHE => 'true', BL
OCKSIZE => '65536 B (64KB)'}                                                                   2 row(s)
Quota is disabled
Took 0.0753 seconds

修改表格students的列族score的属性VERSIONS的值为5。

hbase:078:0> alter 'students',NAME=>'score',VERSIONS=>5
Updating all regions with the new schema...
1/1 regions updated.
Done.
Took 1.9776 seconds

删除表格表格students的列族score。

hbase:079:0> alter 'students',NAME=>'score',METHOD=>'delete'
Updating all regions with the new schema...
1/1 regions updated.
Done.
Took 2.5517 seconds                                                                            
hbase:080:0> desc 'students'
Table students is ENABLED                                                                      
students, {TABLE_ATTRIBUTES => {METADATA => {'hbase.store.file-tracker.impl' =>'DEFAULT'}}}   
COLUMN FAMILIES DESCRIPTION                                                                    
{NAME => 'info', INDEX_BLOCK_ENCODING => 'NONE', VERSIONS => '1', KEEP_DELETED_CELLS => 'FALSE'
, DATA_BLOCK_ENCODING => 'NONE', TTL => 'FOREVER', MIN_VERSIONS => '0', REPLICATION_SCOPE => '0
', BLOOMFILTER => 'ROW', IN_MEMORY => 'false', COMPRESSION => 'NONE', BLOCKCACHE => 'true', BLO
CKSIZE => '65536 B (64KB)'}                                                                    
1 row(s)
Quota is disabled
Took 0.2625 seconds 

(6)disable:禁用表格

hbase:083:0> disable 'students'
2024-03-21 00:52:29,298 INFO  [main] client.HBaseAdmin (HBaseAdmin.java:rpcCall(926)) - Started disable of students
2024-03-21 00:52:29,810 INFO  [main] client.HBaseAdmin (HBaseAdmin.java:postOperationResult(3591)) - Operation: DISABLE, Table Name: default:students, procId: 158 completed
Took 0.5354 seconds

(7)enable:启用表格

hbase:084:0> enable 'students'
2024-03-21 00:52:51,239 INFO  [main] client.HBaseAdmin (HBaseAdmin.java:rpcCall(866)) - Started enable of students
2024-03-21 00:52:51,882 INFO  [main] client.HBaseAdmin (HBaseAdmin.java:postOperationResult(3591)) - Operation: ENABLE, Table Name: default:students, procId: 161 completed
Took 0.6636 seconds 

(8)drop:删除表格(先要disable表,再删除表

hbase:085:0> disable 'ns1:t1'
2024-03-21 00:53:34,360 INFO  [main] client.HBaseAdmin (HBaseAdmin.java:rpcCall(926)) - Started disable of ns1:t1
2024-03-21 00:53:34,727 INFO  [main] client.HBaseAdmin (HBaseAdmin.java:postOperationResult(3591)) - Operation: DISABLE, Table Name: ns1:t1, procId: 164 completed
Took 0.3910 seconds                                                                            
hbase:086:0> drop 'ns1:t1'
2024-03-21 00:53:43,300 INFO  [main] client.HBaseAdmin (HBaseAdmin.java:postOperationResult(3591)) - Operation: DELETE, Table Name: ns1:t1, procId: 167 completed
Took 0.7044 seconds                                                                            
hbase:087:0> list
TABLE                                                                                          
students                                                                                       
1 row(s)
Took 0.0301 seconds                                                                            
=> ["students"]

五、DML操作命令

DML包含的操作命令很多,主要用于对数据表中的数据进行操作,主要包括全表扫描、读取单行数据、写入数据和删除数据等操作。

(1)put:插入数据(put命令,不能一次性插入多条)

往students表格的info列族,增加2条数据:

行键为s001,列限定符name,单元格值Jack;行键为s001,列限定符age,单元格值20;

往students表格的score列族,增加2条数据:

行键为s001,列限定符Chinese,单元格值90;行键为s001,列限定符Math,单元格值85;

hbase:088:0> put 'students','s001','info:name','Jack'
Took 2.2121 seconds 
hbase:092:0> put 'students','s001','info:age','20'
Took 0.0543 seconds 
hbase:096:0> put 'students','s001','score:Chinese','90'
Took 0.0380 seconds                                                                            
hbase:097:0> put 'students','s001','score:Math','85'
Took 0.0148 seconds 

修改students表格的单元格值:行键为s001,列限定符name,单元格值'Jack'修改为'Mike'。

hbase:089:0> put 'students','s001','info:name','Mike'
Took 0.2027 seconds

(2)get:查询数据

查询students表格,行键为s001的所有数据。

hbase:098:0> get 'students','s001'
COLUMN                   CELL                                                                  info:age                timestamp=2024-03-21T01:11:05.881, value=20                           info:name               timestamp=2024-03-21T01:04:05.318, value=Mike                         score:Chinese           timestamp=2024-03-21T01:16:34.006, value=90                           score:Math              timestamp=2024-03-21T01:16:48.854, value=85                           
1 row(s)
Took 0.1583 seconds

查询行键为s001,数据列为socre:Chinese的单元格值。

hbase:103:0> get 'students','s001','score:Chinese'
COLUMN                   CELL                                                                  score:Chinese           timestamp=2024-03-21T01:16:34.006, value=90                           
1 row(s)
Took 0.0142 seconds

查询学生Mike的多次数学成绩。(确保score列族数学的VERSION版本不止为1)

hbase:108:0> alter 'students',NAME=>'score',VERSIONS=>5
Updating all regions with the new schema...
1/1 regions updated.
Done.
Took 3.6026 seconds

1)写入学生Mike的多次数学成绩

hbase:100:0> put 'students','s001','score:Math','92'
Took 0.0871 seconds                                                                            
hbase:101:0> put 'students','s001','score:Math','100'
Took 0.0158 seconds

2)读取学生Mike最新的一次数学成绩(get命令默认只读出最新写入的单元格值,时间戳版本最大的单元格值内容)。

hbase:102:0> get 'students','s001','score:Math'
COLUMN                   CELL                                                                  score:Math              timestamp=2024-03-21T01:23:13.668, value=100                          
1 row(s)
Took 0.0771 seconds 

3)查询学生Mike的3次数学成绩。

hbase:111:0> get 'students','s001',{COLUMN=>'score:Math',VERSIONS=>3}
COLUMN                   CELL                                                                  score:Math              timestamp=2024-03-21T01:32:55.629, value=85                           score:Math              timestamp=2024-03-21T01:32:35.808, value=92                           score:Math              timestamp=2024-03-21T01:23:13.668, value=100                          
1 row(s)
Took 0.2027 seconds

(3)scan:扫描数据(读取所有行的每个列族的所有数据列的最新时间戳版本的单元格值)

1)为了获得更好效果,现在students表中写入多行数据。

hbase:112:0> put 'students','s002','info:name','Tom'                                                                           
hbase:113:0> put 'students','s002','info:age','19'
hbase:114:0> put 'students','s002','score:Chinese','87'                                                                           
hbase:115:0> put 'students','s002','score:Math','70'
hbase:116:0> put 'students','s003','info:name','Lucy'                                                                            
hbase:117:0> put 'students','s003','info:age',18'
hbase:122:0> put 'students','s003','score:Chinese','80'                                                                           
hbase:123:0> put 'students','s003','score:Math','90'

2)对数据表students进行全表扫描。

hbase:124:0> scan 'students'
ROW                      COLUMN+CELL                                                           s001                    column=info:age, timestamp=2024-03-21T01:11:05.881, value=20          s001                    column=info:name, timestamp=2024-03-21T01:04:05.318, value=Mike       s001                    column=score:Chines, timestamp=2024-03-21T01:16:34.006, value=90      s001                    column=score:Math, timestamp=2024-03-21T01:32:55.629, value=85        s002                    column=info:Chinese, timestamp=2024-03-21T01:43:05.067, value=89       s002                    column=info:Math, timestamp=2024-03-21T01:43:22.209, value=95         s002                    column=info:age, timestamp=2024-03-21T01:42:45.619, value=19          s002                    column=info:name, timestamp=2024-03-21T01:42:33.917, value=Tom        s003                    column=info:age, timestamp=2024-03-21T01:44:16.318, value=18          s003                    column=info:name, timestamp=2024-03-21T01:43:45.397, value=Lucy       s003                    column=score:Chinese, timestamp=2024-03-21T01:45:40.078, value=80      s003                    column=score:Math, timestamp=2024-03-21T01:45:53.743, value=90        
3 row(s)
Took 0.2514 seconds 

3)对数据表students的指定行键范围的数据进行扫描。

#若只指定开始的行键STARTROW,会一直扫描到最后,包含STARTROW和最后一行数据
hbase:135:0> scan 'students',{STARTROW=>'s002'}
ROW                      COLUMN+CELL                                                           s002                    column=info:age, timestamp=2024-03-21T01:42:45.619, value=19          s002                    column=info:name, timestamp=2024-03-21T01:42:33.917, value=Tom        s002                    column=score:Chinese, timestamp=2024-03-21T01:48:44.123, value=87      s002                    column=score:Math, timestamp=2024-03-21T01:48:59.578, value=70        s003                    column=info:age, timestamp=2024-03-21T01:44:16.318, value=18          s003                    column=info:name, timestamp=2024-03-21T01:43:45.397, value=Lucy       s003                    column=score:Chinese, timestamp=2024-03-21T01:45:40.078, value=80      s003                    column=score:Math, timestamp=2024-03-21T01:45:53.743, value=90        
2 row(s)
Took 0.6646 seconds 
#同时指定STARTROW和STOPROW,行键范围包括STARTROW,但不包含STOPROW的数据
hbase:136:0> scan 'students',{STARTROW=>'s002',STOPROW=>'s003'}
ROW                      COLUMN+CELL                                                           s002                    column=info:age, timestamp=2024-03-21T01:42:45.619, value=19          s002                    column=info:name, timestamp=2024-03-21T01:42:33.917, value=Tom        s002                    column=score:Chinese, timestamp=2024-03-21T01:48:44.123, value=87      s002                    column=score:Math, timestamp=2024-03-21T01:48:59.578, value=70        
1 row(s)
Took 0.0566 seconds

4)对数据表students的指定列族info进行扫描。

hbase:137:0> scan 'students',{COLUMNS=>['info']}
ROW                      COLUMN+CELL                                                           s001                    column=info:age, timestamp=2024-03-21T01:11:05.881, value=20          s001                    column=info:name, timestamp=2024-03-21T01:04:05.318, value=Mike       s002                    column=info:age, timestamp=2024-03-21T01:42:45.619, value=19          s002                    column=info:name, timestamp=2024-03-21T01:42:33.917, value=Tom        s003                    column=info:age, timestamp=2024-03-21T01:44:16.318, value=18          s003                    column=info:name, timestamp=2024-03-21T01:43:45.397, value=Lucy       
3 row(s)
Took 0.2538 seconds

5)对数据表students的指定列族info下的name数据列进行扫描。

hbase:138:0> scan 'students',{COLUMNS=>['info:name']}
ROW                      COLUMN+CELL                                                           s001                    column=info:name, timestamp=2024-03-21T01:04:05.318, value=Mike       s002                    column=info:name, timestamp=2024-03-21T01:42:33.917, value=Tom        s003                    column=info:name, timestamp=2024-03-21T01:43:45.397, value=Lucy       
3 row(s)
Took 0.0447 seconds

6)对数据表students的前2行数据进行扫描。

hbase:139:0> scan 'students',{LIMIT=>2}
ROW                      COLUMN+CELL                                                           s001                    column=info:age, timestamp=2024-03-21T01:11:05.881, value=20          s001                    column=info:name, timestamp=2024-03-21T01:04:05.318, value=Mike       s001                    column=score:Chinese, timestamp=2024-03-21T01:16:34.006, value=90      s001                    column=score:Math, timestamp=2024-03-21T01:32:55.629, value=85        s002                    column=info:age, timestamp=2024-03-21T01:42:45.619, value=19          s002                    column=info:name, timestamp=2024-03-21T01:42:33.917, value=Tom        s002                    column=score:Chinese, timestamp=2024-03-21T01:48:44.123, value=87      s002                    column=score:Math, timestamp=2024-03-21T01:48:59.578, value=70        
2 row(s)
Took 0.0328 seconds 
(4)count:统计表行数
hbase:141:0> count 'students'
3 row(s)
Took 1.1445 seconds                                                                            
=> 3
(5)delete:删除指定数据列单元格

删除数据表students的指定数据列单元格(删除行键003的列族score下的列限定符Math单元格)。

hbase:143:0> delete 'students','s003','score:Math'
Took 0.0677 seconds                                                                            
hbase:144:0> get 'students','s003'
COLUMN                   CELL                                                                  info:age                timestamp=2024-03-21T01:44:16.318, value=18                           info:name               timestamp=2024-03-21T01:43:45.397, value=Lucy                         score:Chines            timestamp=2024-03-21T01:45:40.078, value=80                           
1 row(s)
Took 0.1472 seconds

(6)deleteall:删除指定数据行

1)删除数据表students的行键为s003的数据。

hbase:145:0> deleteall 'students','s003'
Took 0.1017 seconds                                                                            
hbase:146:0> get 'students','s003'
COLUMN                   CELL                                                                  
0 row(s)
Took 0.0270 seconds 

2)删除数据表students的行键为s002,列名为score:chinese的所有数据。

hbase:148:0> deleteall 'students','s002','score:Chinese'
Took 0.0182 seconds                                                                            
hbase:149:0> get 'students','s002'
COLUMN                   CELL                                                                  info:age                timestamp=2024-03-21T01:42:45.619, value=19                           info:name               timestamp=2024-03-21T01:42:33.917, value=Tom                          score:Math              timestamp=2024-03-21T01:48:59.578, value=70                           
1 row(s)
Took 0.0348 seconds

(7)append:给指定列的单元格追加内容

给行键s002,列名info: name的数据列单元格值Tom后面追加son后变成Tomson。

hbase:007:0> append 'students','s002','info:name','son'
CURRENT VALUE = Tomson
Took 0.9325 seconds 
hbase:008:0> get 'students','s002'
COLUMN                                         CELL                                                                                                                                 info:age                                      timestamp=2024-03-21T01:42:45.619, value=19                                                                                          info:name                                     timestamp=2024-03-21T06:16:33.838, value=Tomson                                                                                      score:Math                                    timestamp=2024-03-21T01:48:59.578, value=70                                                                                          
1 row(s)
Took 0.4914 seconds 

(8)truncate:清空指定数据表的全部数据内容

清空数据表students的内容。

hbase:009:0> truncate 'students'
Truncating 'students' table (it may take a while):
Disabling table...
2024-03-21 06:17:52,730 INFO  [main] client.HBaseAdmin (HBaseAdmin.java:rpcCall(926)) - Started disable of students
2024-03-21 06:17:57,843 INFO  [main] client.HBaseAdmin (HBaseAdmin.java:postOperationResult(3591)) - Operation: DISABLE, Table Name: default:students, procId: 194 completed
Truncating table...
2024-03-21 06:17:57,898 INFO  [main] client.HBaseAdmin (HBaseAdmin.java:rpcCall(806)) - Started truncating students
2024-03-21 06:18:02,439 INFO  [main] client.HBaseAdmin (HBaseAdmin.java:postOperationResult(3591)) - Operation: TRUNCATE, Table Name: default:students, procId: 197 completed
Took 10.4274 seconds                                                                                                                                                                
hbase:010:0> scan 'students'
ROW                                            COLUMN+CELL                                                                                                                          
0 row(s)
Took 6.5341 seconds

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

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

相关文章

【容器源码篇】Set容器(HashSet,LinkedHashSet,TreeSet的特点)

文章目录 ⭐容器继承关系&#x1f339;Set容器&#x1f5d2;️HashSet源码解析构造方法public HashSet()public HashSet(Collection<? extends E> c)public HashSet(int initialCapacity, float loadFactor)HashSet(int initialCapacity, float loadFactor, boolean dum…

VLAN实验记录---对抗遗忘

sw1的接口6应该调成混杂模式&#xff0c;因为pc2,4,5,6的pvid各不相同而网段相同&#xff0c;所以往上去路由时应该剥离标记&#xff08;VLAN里面是标记而不是标签&#xff09;出去&#xff0c;这样 路由器上的物理接口用来管理不带标记的流量&#xff0c;而vlan2流量的往上打上…

记录 AI绘图 Stable Diffusion的本地安装使用,可搭建画图服务端

开头 最近刷短视频看到了很多关于AI绘图&#xff0c;Midjourney&#xff0c;gittimg.ai&#xff0c;Stable Diffusion等一些绘图AI工具&#xff0c;感受到了AI绘画的魅力。通过chatGPT生成关键词再加上绘图工具&#xff0c;真是完美&#xff0c;文末教大家如何用gpt提词 Midj…

每日算法之接雨水

题目描述 给定 n 个非负整数表示每个宽度为 1 的柱子的高度图&#xff0c;计算按此排列的柱子&#xff0c;下雨之后能接多少雨水。 示例 1&#xff1a; 输入&#xff1a;height [0,1,0,2,1,0,1,3,2,1,2,1] 输出&#xff1a;6 解释&#xff1a;上面是由数组 [0,1,0,2,1,0,1…

打造核心竞争力:高效Web系统数据中台的设计与实践_光点科技

在数字化的浪潮中&#xff0c;数据已经成为企业赖以生存和发展的核心资源。一个高效的Web系统数据中台&#xff0c;能够赋予企业在激烈的市场竞争中立于不败之地的能力。本文将深入探讨如何设计和实施一个能够提升企业数据管理水平和支持业务决策的高效数据中台架构。 数据中台…

【YOLOv8训练结果评估】YOLOv8如何使用训练好的模型对验证集进行评估及评估参数详解

《博主简介》 小伙伴们好&#xff0c;我是阿旭。专注于人工智能、AIGC、python、计算机视觉相关分享研究。 ✌更多学习资源&#xff0c;可关注公-仲-hao:【阿旭算法与机器学习】&#xff0c;共同学习交流~ &#x1f44d;感谢小伙伴们点赞、关注&#xff01; 《------往期经典推…

P8623 [蓝桥杯 2015 省 B] 移动距离 Python

[蓝桥杯 2015 省 B] 移动距离 题目描述 X 星球居民小区的楼房全是一样的&#xff0c;并且按矩阵样式排列。其楼房的编号为 $1,2,3, \cdots $ 。 当排满一行时&#xff0c;从下一行相邻的楼往反方向排号。 比如&#xff1a;当小区排号宽度为 6 6 6 时&#xff0c;开始情形如…

腾讯云优惠券领取及使用常见问题解答

随着云计算的普及&#xff0c;腾讯云作为国内领先的云计算服务提供商&#xff0c;为越来越多的企业和个人提供了丰富的云产品和服务。为了帮助用户更好地了解和使用腾讯云优惠券&#xff0c;本文将为大家解答关于腾讯云优惠券领取及使用的常见问题。 一、腾讯云优惠券概述 腾讯…

软件设计师24--概念设计阶段

软件设计师24--概念设计阶段 考点1&#xff1a;概念设计过程考点2&#xff1a;E-R图属性E-R模型-联系类型判断例题&#xff1a;E-R模型-联系类型判断扩充的E-R模型 考点1&#xff1a;概念设计过程 需求分析 --> 抽象数据 --> 设计局部ER模型 --> 合并局部模型消除冲突…

二维前缀和与二维差分的表示

前缀和&#xff1a; 上述图片是求范围内的总和的图和公式 上述图片是初始化前缀和数组的图和公式 差分&#xff1a; 上图是差分公式 #include<iostream> #include<climits> #include<algorithm> #include<cstring> #include<cstdio> #include&l…

vue 借助vue-amap插件对高德地图的简单使用

需求&#xff1a;实现点击获取经纬度、定位、对特殊位置标点及自定义信息窗体功能。 高德地图的官网API&#xff1a;概述-地图 JS API 1.4 | 高德地图API vue-amap的中文文档&#xff1a;组件 | vue-amap 实现&#xff1a; 1、安装vue-amap插件 npm install vue-amap --save…

代码随想录第23天| 669. 修剪二叉搜索树 108.将有序数组转换为二叉搜索树 538.把二叉搜索树转换为累加树

669. 修剪二叉搜索树 669. 修剪二叉搜索树 - 力扣&#xff08;LeetCode&#xff09; 代码随想录 (programmercarl.com) 你修剪的方式不对&#xff0c;我来给你纠正一下&#xff01;| LeetCode&#xff1a;669. 修剪二叉搜索树_哔哩哔哩_bilibili 给你二叉搜索树的根节点 root …

大数据之scala

为什么学习scala spark是新一代内存级大数据计算框架&#xff0c;是大数据的重要内容 spark就是使用scala编写的&#xff0c;因此为了更好的学习spark&#xff0c;需要掌握scala这门语言 spark的兴起&#xff0c;带动scala语言的发展 scala发展历史 联邦理工学院的马丁 奥德…

17.注释和关键字

文章目录 一、 注释二、关键字class关键字 我们之前写的HelloWorld案例写的比较简单&#xff0c;但随着课程渐渐深入&#xff0c;当我们写一些比较难的代码时&#xff0c;在刚开始写完时&#xff0c;你知道这段代码是什么意思&#xff0c;但是等过了几天&#xff0c;再次看这段…

使用 OpenOCD 来调试 STM32

STM32 在 Windows 上的交叉编译二 调试 在上一篇博客 《在Windows上交叉编译STM32(环境搭建)》 &#xff0c;已经让 CubeMX 生成的工程成功编译&#xff0c;并下载到板子上了。 这篇博客主要继续介绍接下来的步骤&#xff0c;调试。硬件是使用的 ST-LINK &#xff0c;别的也无…

C++基础11:模板与命名空间

此专栏为移动机器人知识体系下的编程语言中的 C {\rm C} C从入门到深入的专栏&#xff0c;参考书籍&#xff1a;《深入浅出 C {\rm C} C》(马晓锐)和《从 C {\rm C} C到 C {\rm C} C精通面向对象编程》(曾凡锋等)。 10.模板与命名空间 10.1 模板简述 模板使函数和类的处理对象…

API数据接口开发tglobal淘宝海外获得淘宝商品详情数据、商品ID、商品标题、价格、销量、规格属性等参数接入请求演示

要获取淘宝海外的商品详情、商品ID、商品标题、价格、销量、规格属性等参数&#xff0c;你可以使用淘宝海外的API。以下是一个简单的Python示例&#xff0c;使用requests库来调用淘宝海外的API。 首先&#xff0c;你需要注册一个开放平台账号并创建一个应用&#xff0c;以获取…

春秋云境CVE-2022-24663

简介 远程代码执行漏洞&#xff0c;任何订阅者都可以利用该漏洞发送带有“短代码”参数设置为 PHP Everywhere 的请求&#xff0c;并在站点上执行任意 PHP 代码。P.S. 存在常见用户名低权限用户弱口令 正文 进入首页我们没看到任何有价值的东西&#xff0c;那么就只好去寻找…

TOP100-回溯(二)

4.39. 组合总和 给你一个 无重复元素 的整数数组 candidates 和一个目标整数 target &#xff0c;找出 candidates 中可以使数字和为目标数 target 的 所有 不同组合 &#xff0c;并以列表形式返回。你可以按 任意顺序 返回这些组合。 candidates 中的 同一个 数字可以 无限制…

【算法刷题 | 二叉树 05】3.28(左叶子之和、找树 左下角的值)

文章目录 11.左叶子之和11.1问题11.2解法一&#xff1a;递归11.2.1递归思路11.2.2代码实现 11.3解法二&#xff1a;栈11.3.1栈思想11.3.2代码实现 12.找树左下角的值12.1问题12.2解法一&#xff1a;层序遍历 11.左叶子之和 11.1问题 给定二叉树的根节点 root &#xff0c;返回…