我想运行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没有运行有什么问题呢?我真的累坏了。我已经花了几个星期的时间来解决这个问题,每次都会出现新的错误。我非常感谢你的时间和努力来帮助我:)
发布于 2014-01-16 16:28:31
您可以说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,,,
为了使它成为您的slave...with可执行状态(sudo chmod +x start-hbase.sh
)
2) you can be root by: "su root" or "sudo su" or "sudo bash"
然后执行剧本..。
发布于 2015-08-17 05:29:30
如果在更改start-hbase.sh的权限后仍有问题,请运行以下命令
sudo chown -R hduser:hadoop /usr/local/hbase
允许“hbase”目录写入日志文件。
我希望这能对其他人有所帮助..。
https://stackoverflow.com/questions/21166542
复制相似问题