HBase不会运行./start-hbase.sh – 权限被拒绝?

我想运行HBase。 我已经完全安装了hadoop,当我运行start-all.sh ,它工作正常,给了我这个输出:

 hduser@CSLAP106:/usr/local/hadoop/bin$ jps 11956 SecondaryNameNode 12046 JobTracker 12193 TaskTracker 11800 DataNode 11656 NameNode 12254 Jps 

但是,当我想运行start-hbase.sh ,它给了我一些权限被拒绝的错误,我不明白为什么:

 hduser@CSLAP106:/usr/local/hbase/hbase-0.94.6.1/bin$ ./start-hbase.sh localhost: starting zookeeper, logging to /usr/local/hbase/hbase-0.94.6.1/bin/../logs/hbase-hduser-zookeeper-CSLAP106.out localhost: /usr/local/hbase/hbase-0.94.6.1/bin/hbase-daemon.sh: line 150: /usr/local/hbase/hbase-0.94.6.1/bin/../logs/hbase-hduser-zookeeper-CSLAP106.log: Permission denied localhost: head: cannot open '/usr/local/hbase/hbase-0.94.6.1/bin/../logs/hbase-hduser-zookeeper-CSLAP106.out' for reading: No such file or directory /usr/local/hbase/hbase-0.94.6.1/bin/hbase-daemon.sh: line 150: /usr/local/hbase/hbase-0.94.6.1/bin/../logs/hbase-hduser-master-CSLAP106.log: Permission denied head: cannot open '/usr/local/hbase/hbase-0.94.6.1/bin/../logs/hbase-hduser-master-CSLAP106.out' for reading: No such file or directory localhost: starting regionserver, logging to /usr/local/hbase/hbase-0.94.6.1/bin/../logs/hbase-hduser-regionserver-CSLAP106.out localhost: /usr/local/hbase/hbase-0.94.6.1/bin/hbase-daemon.sh: line 150: /usr/local/hbase/hbase-0.94.6.1/bin/../logs/hbase-hduser-regionserver-CSLAP106.log: Permission denied localhost: head: cannot open '/usr/local/hbase/hbase-0.94.6.1/bin/../logs/hbase-hduser-regionserver-CSLAP106.out' for reading: No such file or directory 

之后,我尝试运行sudo ./start-hbase.sh ,而且我有更奇怪的东西!

 root@localhost's password: 

我不知道我应该在这里input什么 。 无论如何,我只是点击input ,它又切换回hduser

 root@localhost's password: root@localhost's password: localhost: Permission denied, please try again. root@localhost's password: localhost: Permission denied, please try again. localhost: Permission denied (publickey,password). starting master, logging to /usr/local/hbase/hbase-0.94.6.1/bin/../logs/hbase-root- master-CSLAP106.out root@localhost's password: root@localhost's password: localhost: Permission denied, please try again. root@localhost's password: localhost: Permission denied, please try again. localhost: Permission denied (publickey,password). hduser@CSLAP106:/usr/local/hbase/hbase-0.94.6.1/bin$ 

我把我的hbase-env.shhbase-site.xml文件中的一些行放在需要的地方:

hbase-env.sh

 # File naming hosts on which HRegionServers will run. $HBASE_HOME/conf/regionservers by default. export HBASE_REGIONSERVERS=/usr/local/hbase/hbase-0.94.6.1/conf/regionservers # File naming hosts on which backup HMaster will run. $HBASE_HOME/conf/backup-masters by default. export HBASE_BACKUP_MASTERS=/usr/local/hbase/hbase-0.94.6.1/conf/backup-masters # Tell HBase whether it should manage it's own instance of Zookeeper or not. export HBASE_MANAGES_ZK=true 

HBase的-site.xml中

 <configuration> <property> <name>hbase.rootdir</name> <value>hdfs://localhost:54310/hbase</value> </property> <property> <name>hbase.cluster.distributed</name> <value>true</value> </property> 

那么,你认为HBase有什么不对的地方呢? 我真的很累这个。 我已经有数周的时间了,每次出现新的错误。 我真的很感激你的时间和精力来帮助我:)

你说ls -l start-hbase.sh的输出是:

 -rwxr-xr-x 1 root root 1872 huhti 4 2013 start-hbase.sh 

如果你想知道你正在登录的用户和组,那么我们有一个简单的方法:

 touch test ls -l test 

并检查用户:组…

问题是用户的所有者和组的所有者的脚本..你有两个解决方案:

 1) sudo chown hduser:hduser start-hbase.sh #here hduser is example...you should know what user and group you have,,, 

为了使它成为你的奴隶…与可执行状态( sudo chmod +x start-hbase.sh

 2) you can be root by: "su root" or "sudo su" or "sudo bash" 

然后执行脚本…

如果更改start-hbase.sh的权限后仍然有问题,请运行以下命令

 sudo chown -R hduser:hadoop /usr/local/hbase 

给“hbase”目录权限写日志文件..

我希望这会帮助其他人…