当前位置: 首页> 财经> 产业 > 企业邮箱申请域名_保定网络公司电话_外贸国际网站推广_网页制作app

企业邮箱申请域名_保定网络公司电话_外贸国际网站推广_网页制作app

时间:2025/7/10 14:39:14来源:https://blog.csdn.net/2301_80912559/article/details/143609213 浏览次数:0次
企业邮箱申请域名_保定网络公司电话_外贸国际网站推广_网页制作app

1. 查看hbase状态

# 进入hbase 命令行
hbase shell
status

我这里没启用高可用hbase

1 active master, 0 backup masters, 2 servers, 1 dead, 1.0000 average load
Took 5.2635 seconds  

2. 查看版本号

version
hbase:002:0> version
2.4.11, r7e672a0da0586e6b7449310815182695bc6ae193, Tue Mar 15 10:31:00 PDT 2022
Took 0.0006 seconds  

3. 命名空间操作

# 创建命名空间
create_namespace '命名空间名'# 显示所有命名空间
list_namespace# 删除命名空间
drop_namespace '命名空间名'# 查看命名空间中的表有什么
list_namespace_tables
hbase:001:0> list_namespace
NAMESPACE                                                                                                      
default                                                                                                        
hbase                                                                                                          
2 row(s)
Took 0.8956 seconds                                                                                            
hbase:002:0> create_namespace 'hainiu'
Took 0.3163 seconds                                                                                            
hbase:003:0> list_namespace
NAMESPACE                                                                                                      
default                                                                                                        
hainiu                                                                                                         
hbase                                                                                                          
3 row(s)
Took 0.0371 seconds                                                                                            
hbase:004:0> drop_namespace 'hainiu'
Took 0.1986 seconds                                                                                            
hbase:005:0> list_namespace
NAMESPACE                                                                                                      
default                                                                                                        
hbase                                                                                                          
2 row(s)
Took 0.0247 seconds         

4. 创建表

# 创建默认命名空间的表
create '表名称', '列族名称1','列族名称2','列族名称N'# 创建带有命名空间的表
create '命名空间:表名称', '列族名称1','列族名称2','列族名称N'
hbase:007:0> create 'hainiu:info','info1','info2', 'info3'
Created table hainiu:info
Took 2.4064 seconds                                                                                            
=> Hbase::Table - hainiu:info
-- 指定了命名空间,即在该指定的命名空间下创建表,否则就默认在default下创建表。
-- 创建表必须指明列族
-- hainiu是命名空间,info是表,info1,info2,info3是列族

创建完之后有一个region是上线的

状态和该表region的位置:

5. 列出所有的表

# 查看所有的表
list# 查询指定命名空间下的表
list_namespace_tables '命名空间'
hbase:012:0> list
TABLE                                                                                                          
hainiu:info                                                                                                    
1 row(s)
Took 0.1127 seconds                                                                                            
=> ["hainiu:info"]
hbase:013:0> list_namespace_tables 'hainiu'
TABLE                                                                                                          
info                                                                                                           
1 row(s)
Took 0.0161 seconds                                                                                            
=> ["info"]

只显示用户创建的表信息

6. 获取表的描述

# 默认命名空间
describe '表名'# 指定命名空间
describe '命名空间:表名'
hbase:001:0> describe 'hainiu:info'
Table hainiu:info is ENABLED                                                                                   
hainiu:info                                                                                                    
COLUMN FAMILIES DESCRIPTION                                                                                    
{NAME => 'info1', BLOOMFILTER => 'ROW', IN_MEMORY => 'false', VERSIONS => '1', KEEP_DELETED_CELLS => 'FALSE', D
ATA_BLOCK_ENCODING => 'NONE', COMPRESSION => 'NONE', TTL => 'FOREVER', MIN_VERSIONS => '0', BLOCKCACHE => 'true
', BLOCKSIZE => '65536', REPLICATION_SCOPE => '0'}                                                             {NAME => 'info2', BLOOMFILTER => 'ROW', IN_MEMORY => 'false', VERSIONS => '1', KEEP_DELETED_CELLS => 'FALSE', D
ATA_BLOCK_ENCODING => 'NONE', COMPRESSION => 'NONE', TTL => 'FOREVER', MIN_VERSIONS => '0', BLOCKCACHE => 'true
', BLOCKSIZE => '65536', REPLICATION_SCOPE => '0'}                                                             {NAME => 'info3', BLOOMFILTER => 'ROW', IN_MEMORY => 'false', VERSIONS => '1', KEEP_DELETED_CELLS => 'FALSE', D
ATA_BLOCK_ENCODING => 'NONE', COMPRESSION => 'NONE', TTL => 'FOREVER', MIN_VERSIONS => '0', BLOCKCACHE => 'true
', BLOCKSIZE => '65536', REPLICATION_SCOPE => '0'}                                                             3 row(s)
Quota is disabled
Took 1.6924 seconds 

7. 删除列族

# 删除hainiu_table 表的 cf3 列族
alter 'hainiu:info',{NAME=>'info',METHOD=>'delete'}
# 查看表结构
describe 'hainiu:info'
hbase:001:0> alter 'hainiu:info',{NAME=>'info3',METHOD=>'delete'}
Updating all regions with the new schema...
1/1 regions updated.
Done.
Took 4.1782 seconds                                                                                            
hbase:002:0> describe 'hainiu:info'
Table hainiu:info is ENABLED                                                                                   
hainiu:info                                                                                                    
COLUMN FAMILIES DESCRIPTION                                                                                    
{NAME => 'info1', BLOOMFILTER => 'ROW', IN_MEMORY => 'false', VERSIONS => '1', KEEP_DELETED_CELLS => 'FALSE', D
ATA_BLOCK_ENCODING => 'NONE', COMPRESSION => 'NONE', TTL => 'FOREVER', MIN_VERSIONS => '0', BLOCKCACHE => 'true
', BLOCKSIZE => '65536', REPLICATION_SCOPE => '0'}                                                             {NAME => 'info2', BLOOMFILTER => 'ROW', IN_MEMORY => 'false', VERSIONS => '1', KEEP_DELETED_CELLS => 'FALSE', D
ATA_BLOCK_ENCODING => 'NONE', COMPRESSION => 'NONE', TTL => 'FOREVER', MIN_VERSIONS => '0', BLOCKCACHE => 'true
', BLOCKSIZE => '65536', REPLICATION_SCOPE => '0'}                                                             2 row(s)
Quota is disabled
Took 0.0695 seconds   

8. 其他ddl操作

# 把表设置为disable(下线)
disable '表名'# drop表
# 先把表下线,再drop表
disable '表名'
# 启动表
enable '表名'
drop '表名'  # 判断表是否存在
exists '表名'# 判断表是否下线
is_disabled '表名'# 判断表是否上线
is_enabled '表名'
hbase:003:0> create 'hainiu:student', 'name', 'age'
Created table hainiu:student
Took 1.3426 seconds                                                                                            
=> Hbase::Table - hainiu:student
hbase:004:0> disable 'hainiu:student'
Took 0.7914 seconds                                                                                            
hbase:005:0> drop 'hainiu:student'
Took 0.7322 seconds                                                                                            
hbase:006:0> list_namespace_tables 'hainiu'
TABLE                                                                                                          
info                                                                                                           
1 row(s)
Took 0.0437 seconds                                                                                            
=> ["info"]
-- 先下线表,才可以删除表
hbase:001:0> exists 'hainiu:info'
Table hainiu:info does exist                                                                                   
Took 1.2314 seconds                                                                                            
=> true
hbase:002:0> is_disabled 'hainiu:info'
false                                                                                                          
Took 0.0261 seconds                                                                                            
=> false

关键字:企业邮箱申请域名_保定网络公司电话_外贸国际网站推广_网页制作app

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: