hbase 0.98.5无法在windows上启动

m1m5dgzv  于 2021-05-30  发布在  Hadoop
关注(0)|答案(1)|浏览(495)

我已经在Windows7 pc上下载并安装了HBASe0.98.5。我遵循了apache的入门步骤并进行了修改 base-site.xml 如下所示(配置元素为空oob):

<configuration>
    <property>
    <name>hbase.rootdir</name>
    <value>file:///c:/datastore/hbase</value>
  </property>
  <property>
    <name>hbase.zookeeper.property.dataDir</name>
    <value>c:/datastore/zookeper</value>
  </property>
</configuration>

启动hbase时,出现以下错误:

2014-08-13 14:37:26,827 DEBUG [main-EventThread] master.ActiveMasterManager: A master is now available
2014-08-13 14:37:26,828 WARN  [M:0;rzm01:57477] hbase.ZNodeClearer: Environment variable HBASE_ZNODE_FILE not set; znodes will not be cleared on crash by start scripts (Longer MTTR!)
2014-08-13 14:37:26,829 INFO  [M:0;rzm01:57477] master.ActiveMasterManager: Registered Active Master=rzm01.self,57477,1407929845469
2014-08-13 14:37:26,836 INFO  [M:0;rzm01:57477] Configuration.deprecation: fs.default.name is deprecated. Instead, use fs.defaultFS
2014-08-13 14:37:26,909 FATAL [M:0;rzm01:57477] master.HMaster: Unhandled exception. Starting shutdown.
java.lang.NullPointerException
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1010)
        at org.apache.hadoop.util.Shell.runCommand(Shell.java:404)
        at org.apache.hadoop.util.Shell.run(Shell.java:379)
        at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:589)
        at org.apache.hadoop.util.Shell.execCommand(Shell.java:678)
        at org.apache.hadoop.util.Shell.execCommand(Shell.java:661)
        at org.apache.hadoop.fs.RawLocalFileSystem.setPermission(RawLocalFileSystem.java:639)
        at org.apache.hadoop.fs.FilterFileSystem.setPermission(FilterFileSystem.java:468)
        at org.apache.hadoop.fs.ChecksumFileSystem.create(ChecksumFileSystem.java:456)
        at org.apache.hadoop.fs.ChecksumFileSystem.create(ChecksumFileSystem.java:424)
        at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:905)
        at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:886)
        at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:783)
        at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:772)
        at org.apache.hadoop.hbase.util.FSUtils.setVersion(FSUtils.java:651)
        at org.apache.hadoop.hbase.util.FSUtils.setVersion(FSUtils.java:629)
        at org.apache.hadoop.hbase.util.FSUtils.checkVersion(FSUtils.java:587)
        at org.apache.hadoop.hbase.master.MasterFileSystem.checkRootDir(MasterFileSystem.java:461)
        at org.apache.hadoop.hbase.master.MasterFileSystem.createInitialFileSystemLayout(MasterFileS
ystem.java:152)
        at org.apache.hadoop.hbase.master.MasterFileSystem.<init>(MasterFileSystem.java:128)
        at org.apache.hadoop.hbase.master.HMaster.finishInitialization(HMaster.java:790)
        at org.apache.hadoop.hbase.master.HMaster.run(HMaster.java:603)
        at org.apache.hadoop.hbase.master.HMasterCommandLine$LocalHMaster.run(HMasterCommandLine.java:263)
        at java.lang.Thread.run(Thread.java:744)
2014-08-13 14:37:26,912 INFO  [M:0;rzm01:57477] master.HMaster: Aborting
2014-08-13 14:37:26,912 DEBUG [M:0;rzm01:57477] master.HMaster: Stopping service threads
2014-08-13 14:37:26,913 INFO  [M:0;rzm01:57477] ipc.RpcServer: Stopping server on 57477
2014-08-13 14:37:26,914 INFO  [M:0;rzm01:57477] master.HMaster: Stopping infoServer
2014-08-13 14:37:26,918 INFO  [RpcServer.listener,port=57477] ipc.RpcServer: RpcServer.listener,port=57477: stopping
2014-08-13 14:37:26,952 INFO  [main] regionserver.ShutdownHook: Installed shutdown hook thread: Shutdownhook:RS:0;rzm01:57505

通过看 ProcessBuilder#start() 方法引发异常时,似乎缺少某些参数:

public Process start() throws IOException {
        // Must convert to array first -- a malicious user-supplied
        // list might try to circumvent the security check.
        String[] cmdarray = command.toArray(new String[command.size()]);
        cmdarray = cmdarray.clone();

        for (String arg : cmdarray)
            if (arg == null)
                throw new NullPointerException(); // this is line 1010
        // Throws IndexOutOfBoundsException if command is empty
        String prog = cmdarray[0];

有什么问题吗?

0pizxfdo

0pizxfdo1#

问题是hbase distributive for windows缺少一些hadoop文件。您可以从以下博客下载这些文件:http://www.srccodes.com/p/article/39/error-util-shell-failed-locate-winutils-binary-hadoop-binary-path (感谢abhijit ghosh为windows构建并共享这些文件—否则您必须自己构建它们)。
因此,请按照以下步骤解决问题:
下载或构建适用于windows的hadoop二进制文件和库;
将这些文件(例如winutils.exe、winutils.dll等)复制到 %HBASE_HOME%\bin 编辑 %HBASE_HOME%\conf\hbase-env.cmd :查找行:

set HBASE_OPTS="-XX:+UseConcMarkSweepGC" "-Djava.net.preferIPv4Stack=true"

并在末尾添加以下选项: "-Dhadoop.home.dir=c:\hbase-0.98.5-hadoop2" 哪里 c:\hbase-0.98.5-hadoop2 是您的hbase主目录,因此它将变为:

set HBASE_OPTS="-XX:+UseConcMarkSweepGC" "-Djava.net.preferIPv4Stack=true" "-Dhadoop.home.dir=c:\hbase-0.98.5-hadoop2"`

祝你好运

相关问题