我想运行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:
我不知道我应该在这里输入什么。无论如何,我只需点击输入,然后再次切换回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.sh
和hbase-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没有运行的错误是什么?我真的很累这个。我已经工作了几周,每次都会出现新的错误。我非常感谢您花时间和精力帮助我:)。
答案 0 :(得分:2)
你说ls -l start-hbase.sh的输出是:
-rwxr-xr-x 1 root root 1872 huhti 4 2013 start-hbase.sh
如果您想知道您要登录的用户和组,请使用简单的方法:
touch test
ls -l test
并检查用户:group ...
问题是脚本的用户所有者和组所有者.. 你有两个解决方案:
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"
然后执行脚本......
答案 1 :(得分:0)
如果在更改start-hbase.sh的权限后仍有问题,请运行以下命令
sudo chown -R hduser:hadoop /usr/local/hbase
授予'hbase'目录写入日志文件的权限..
我希望这对其他人有帮助......