当前位置:   article > 正文

hbase开启,shell命令实战_nameerror: undefined local variable or method `bin

nameerror: undefined local variable or method `bin' for main:object

hadoop@dblab-VirtualBox:~$ source /etc/profile
hadoop@dblab-VirtualBox:~$ echo $HBASE_HOME
/usr/local/hbase
hadoop@dblab-VirtualBox:~$ start-hbase.sh
localhost: starting zookeeper, logging to /usr/local/hbase/bin/../logs/hbase-hadoop-zookeeper-dblab-VirtualBox.out
starting master, logging to /usr/local/hbase/logs/hbase-hadoop-master-dblab-VirtualBox.out
OpenJDK 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
starting regionserver, logging to /usr/local/hbase/logs/hbase-hadoop-1-regionserver-dblab-VirtualBox.out
hadoop@dblab-VirtualBox:~$ jps
3328 HQuorumPeer
1921 NodeManager
1442 DataNode
1795 ResourceManager
1635 SecondaryNameNode
2550 RunJar
2055 Master
3432 HMaster
3563 HRegionServer
1292 NameNode
2380 Worker
3932 Jps
hadoop@dblab-VirtualBox:~$ ps -ef|grep hbase
hadoop    3314     1  0 11:02 ?        00:00:00 bash /usr/local/hbase/bin/hbase-daemon.sh --config /usr/local/hbase/conf foreground_start zookeeper
hadoop    3328  3314  4 11:02 ?        00:00:02 /usr/lib/jvm/default-java/bin/java -Dproc_zookeeper -XX:OnOutOfMemoryError=kill -9 %p -XX:+UseConcMarkSweepGC -Dhbase.log.dir=/usr/local/hbase/bin/../logs -Dhbase.log.file=hbase-hadoop-zookeeper-dblab-VirtualBox.log -Dhbase.home.dir=/usr/local/hbase/bin/.. -Dhbase.id.str=hadoop -Dhbase.root.logger=INFO,RFA -Djava.library.path=/usr/local/hadoop/lib/native -Dhbase.security.logger=INFO,RFAS org.apache.hadoop.hbase.zookeeper.HQuorumPeer start
hadoop    3418     1  0 11:02 pts/0    00:00:00 bash /usr/local/hbase/bin/hbase-daemon.sh --config /usr/local/hbase/conf foreground_start master
hadoop    3432  3418 14 11:02 pts/0    00:00:08 /usr/lib/jvm/default-java/bin/java -Dproc_master -XX:OnOutOfMemoryError=kill -9 %p -XX:+UseConcMarkSweepGC -XX:PermSize=128m -XX:MaxPermSize=128m -Dhbase.log.dir=/usr/local/hbase/logs -Dhbase.log.file=hbase-hadoop-master-dblab-VirtualBox.log -Dhbase.home.dir=/usr/local/hbase -Dhbase.id.str=hadoop -Dhbase.root.logger=INFO,RFA -Djava.library.path=/usr/local/hadoop/lib -Dhbase.security.logger=INFO,RFAS org.apache.hadoop.hbase.master.HMaster start
hadoop    3549     1  0 11:02 pts/0    00:00:00 bash /usr/local/hbase/bin/hbase-daemon.sh --config /usr/local/hbase/conf foreground_start regionserver -D hbase.regionserver.port=16201 -D hbase.regionserver.info.port=16301
hadoop    3563  3549 14 11:02 pts/0    00:00:08 /usr/lib/jvm/default-java/bin/java -Dproc_regionserver -XX:OnOutOfMemoryError=kill -9 %p -XX:+UseConcMarkSweepGC -Dhbase.log.dir=/usr/local/hbase/logs -Dhbase.log.file=hbase-hadoop-1-regionserver-dblab-VirtualBox.log -Dhbase.home.dir=/usr/local/hbase -Dhbase.id.str=hadoop-1 -Dhbase.root.logger=INFO,RFA -Djava.library.path=/usr/local/hadoop/lib -Dhbase.security.logger=INFO,RFAS org.apache.hadoop.hbase.regionserver.HRegionServer -D hbase.regionserver.port=16201 -D hbase.regionserver.info.port=16301 start
hadoop    3949  1129  0 11:03 pts/0    00:00:00 grep --color=auto hbase
hadoop@dblab-VirtualBox:~$ hbase shell
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/hbase/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
2021-01-08 11:15:02,666 WARN  [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
HBase Shell; enter 'help<RETURN>' for list of supported commands.
Type "exit<RETURN>" to leave the HBase Shell
Version 1.1.5, r239b80456118175b340b2e562a5568b5c744252e, Sun May  8 20:29:26 PDT 2016
hbase(main):001:0> help create
ERROR: wrong number of arguments (0 for 1)
Here is some help for this command:
Creates a table. Pass a table name, and a set of column family
specifications (at least one), and, optionally, table configuration.
Column specification can be a simple string (name), or a dictionary
(dictionaries are described below in main help output), necessarily 
including NAME attribute. 
Examples:
Create a table with namespace=ns1 and table qualifier=t1
  hbase> create 'ns1:t1', {NAME => 'f1', VERSIONS => 5}
Create a table with namespace=default and table qualifier=t1
  hbase> create 't1', {NAME => 'f1'}, {NAME => 'f2'}, {NAME => 'f3'}
  hbase> # The above in shorthand would be the following:
  hbase> create 't1', 'f1', 'f2', 'f3'
  hbase> create 't1', {NAME => 'f1', VERSIONS => 1, TTL => 2592000, BLOCKCACHE => true}
  hbase> create 't1', {NAME => 'f1', CONFIGURATION => {'hbase.hstore.blockingStoreFiles' => '10'}}
  
Table configuration options can be put at the end.
Examples:
  hbase> create 'ns1:t1', 'f1', SPLITS => ['10', '20', '30', '40']
  hbase> create 't1', 'f1', SPLITS => ['10', '20', '30', '40']
  hbase> create 't1', 'f1', SPLITS_FILE => 'splits.txt', OWNER => 'johndoe'
  hbase> create 't1', {NAME => 'f1', VERSIONS => 5}, METADATA => { 'mykey' => 'myvalue' }
  hbase> # Optionally pre-split the table into NUMREGIONS, using
  hbase> # SPLITALGO ("HexStringSplit", "UniformSplit" or classname)
  hbase> create 't1', 'f1', {NUMREGIONS => 15, SPLITALGO => 'HexStringSplit'}
  hbase> create 't1', 'f1', {NUMREGIONS => 15, SPLITALGO => 'HexStringSplit', REGION_REPLICATION => 2, CONFIGURATION => {'hbase.hregion.scan.loadColumnFamiliesOnDemand' => 'true'}}
You can also keep around a reference to the created table:
  hbase> t1 = create 't1', 'f1'
Which gives you a reference to the table named 't1', on which you can then
call methods.
HBase Shell, version 1.1.5, r239b80456118175b340b2e562a5568b5c744252e, Sun May  8 20:29:26 PDT 2016
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: general
  Commands: status, table_help, version, whoami
  Group name: ddl
  Commands: alter, alter_async, alter_status, create, describe, disable, disable_all, drop, drop_all, enable, enable_all, exists, get_table, is_disabled, is_enabled, list, show_filters
  Group name: namespace
  Commands: alter_namespace, create_namespace, describe_namespace, drop_namespace, list_namespace, list_namespace_tables
  Group name: dml
  Commands: append, count, delete, deleteall, get, get_counter, get_splits, incr, put, scan, truncate, truncate_preserve
  Group name: tools
  Commands: assign, balance_switch, balancer, balancer_enabled, catalogjanitor_enabled, catalogjanitor_run, catalogjanitor_switch, close_region, compact, compact_rs, flush, major_compact, merge_region, move, split, trace, unassign, wal_roll, zk_dump
  Group name: replication
  Commands: add_peer, append_peer_tableCFs, disable_peer, disable_table_replication, enable_peer, enable_table_replication, list_peers, list_replicated_tables, remove_peer, remove_peer_tableCFs, set_peer_tableCFs, show_peer_tableCFs
  Group name: snapshots
  Commands: clone_snapshot, delete_all_snapshot, delete_snapshot, list_snapshots, restore_snapshot, snapshot
  Group name: configuration
  Commands: update_all_config, update_config
  Group name: quotas
  Commands: list_quotas, set_quota
  Group name: security
  Commands: grant, revoke, user_permission
  Group name: procedures
  Commands: abort_procedure, list_procedures
  Group name: visibility labels
  Commands: add_labels, clear_auths, get_auths, list_labels, set_auths, set_visibility
SHELL USAGE:
Quote all names in HBase Shell such as table and column names.  Commas delimit
command parameters.  Type <RETURN> after entering a command to run it.
Dictionaries of configuration used in the creation and alteration of tables are
Ruby Hashes. They look like this:
  {'key1' => 'value1', 'key2' => 'value2', ...}
and are opened and closed with curley-braces.  Key/values are delimited by the
'=>' character combination.  Usually keys are predefined constants such as
NAME, VERSIONS, COMPRESSION, etc.  Constants do not need to be quoted.  Type
'Object.constants' to see a (messy) list of all constants in the environment.
If you are using binary keys or values and need to enter them in the shell, use
double-quote'd hexadecimal representation. For example:
  hbase> get 't1', "key\x03\x3f\xcd"
  hbase> get 't1', "key\003\023\011"
  hbase> put 't1', "test\xef\xff", 'f1:', "\x01\x33\x40"
The HBase shell is the (J)Ruby IRB with the above HBase-specific commands added.
For more on the HBase Shell, see http://hbase.apache.org/book.html
hbase(main):002:0> list
TABLE                                                                                                                                                                                                                                        
student                                                                                                                                                                                                                                      
1 row(s) in 0.2450 seconds
=> ["student"]
hbase(main):003:0> desc student
NameError: undefined local variable or method `student' for #<Object:0x64bebd55>
hbase(main):004:0> desc studentudentdent
NameError: undefined local variable or method `sdent' for #<Object:0x64bebd55>
hbase(main):019:0> desc 'student'
Table student is ENABLED                                                                                                                                                                                                                     
student                                                                                                                                                                                                                                      
COLUMN FAMILIES DESCRIPTION                                                                                                                                                                                                                  
{NAME => 'info', BLOOMFILTER => 'ROW', VERSIONS => '1', IN_MEMORY => 'false', KEEP_DELETED_CELLS => 'FALSE', DATA_BLOCK_ENCODING => 'NONE', TTL => 'FOREVER', COMPRESSION => 'NONE', MIN_VERSIONS => '0', BLOCKCACHE => 'true', BLOCKSIZE => 
'65536', REPLICATION_SCOPE => '0'}                                                                                                                                                                                                           
1 row(s) in 0.1310 seconds
hbase(main):020:0> scan 'student'
ROW                                                          COLUMN+CELL                                                                                                                                                                     
 1                                                           column=info:age, timestamp=1508814159739, value=23                                                                                                                              
 1                                                           column=info:gender, timestamp=1508814122262, value=F                                                                                                                            
 1                                                           column=info:name, timestamp=1508814065444, value=Xueqian                                                                                                                        
 2                                                           column=info:age, timestamp=1508814285707, value=24                                                                                                                              
 2                                                           column=info:gender, timestamp=1508814255038, value=M                                                                                                                            
 2                                                           column=info:name, timestamp=1508814221190, value=Weiliang                                                                                                                       
 3                                                           column=info:age, timestamp=1508835657344, value=\x00\x00\x00\x1A                                                                                                                
 3                                                           column=info:gender, timestamp=1508835657344, value=M                                                                                                                            
 3                                                           column=info:name, timestamp=1508835657344, value=Rongcheng                                                                                                                      
 4                                                           column=info:age, timestamp=1508835657344, value=\x00\x00\x00\x1B                                                                                                                
 4                                                           column=info:gender, timestamp=1508835657344, value=M                                                                                                                            
 4                                                           column=info:name, timestamp=1508835657344, value=Guanhua                                                                                                                        
4 row(s) in 0.0920 seconds
hbase(main):021:0> 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/2023面试高手/article/detail/725737
推荐阅读
相关标签
  

闽ICP备14008679号