Я пытаюсь использовать простые команды для доступа к HBase через подпроцесс в Python. Следующий код дает мне неправильный вывод:Использование подпроцесса для доступа к HBase
import subprocess
cmd=['hbase','shell','list']
subprocess.call(cmd)
Вместо того чтобы дать мне список таблиц в HBase, я получаю следующий вывод:
Usage: hbase [<options>] <command> [<args>]
Options:
--config DIR Configuration direction to use. Default: ./conf
--hosts HOSTS Override the list in 'regionservers' file
Commands:
Some commands take arguments. Pass no args or -h for usage.
shell Run the HBase shell
hbck Run the hbase 'fsck' tool
snapshot Create a new snapshot of a table
snapshotinfo Tool for dumping snapshot information
wal Write-ahead-log analyzer
hfile Store file analyzer
zkcli Run the ZooKeeper shell
upgrade Upgrade hbase
master Run an HBase HMaster node
regionserver Run an HBase HRegionServer node
zookeeper Run a Zookeeper server
rest Run an HBase REST server
thrift Run the HBase Thrift server
thrift2 Run the HBase Thrift2 server
clean Run the HBase clean up script
classpath Dump hbase CLASSPATH
mapredcp Dump CLASSPATH entries required by mapreduce
pe Run PerformanceEvaluation
ltt Run LoadTestTool
version Print the version
CLASSNAME Run the class named CLASSNAME
Как дать команду подпроцесса?
Я уверен, что оболочка hbase фактически ожидает интерактивную оболочку. – orion78fr