bash HBase 在 ./start-hbase.sh 后不运行 - 权限被拒绝?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21166542/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 09:16:34  来源:igfitidea点击:

HBase does not run after ./start-hbase.sh - Permission Denied?

linuxbashhadoophbasepermission-denied

提问by Nazanin

I want to run HBase. I have installed hadoop completely and when I run start-all.sh, it works fine and gives me this output:

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

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

But when I want to run start-hbase.sh, it gives me some errors of permission deniedwhich I do not understand why:

但是当我想运行时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

after that, I tried to run sudo ./start-hbase.sh, and I got something more weird!

在那之后,我试着跑sudo ./start-hbase.sh,我得到了更奇怪的东西!

root@localhost's password:

I do not know what I am supposed to type here. anyway I just clicked Enterand it switched back to hduseragain:

我不知道我应该在这里输入什么。无论如何,我只是单击Enterhduser再次切换回:

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$

I put some lines from my hbase-env.shand hbase-site.xmlfiles in case they are needed:

我从我的hbase-env.shhbase-site.xml文件中放了一些行,以防需要它们:

hbase-env.sh

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

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>

So, what do you think is wrong with HBase that it does not run! I am really getting exhausted with this. It has been weeks I am working on it and every time it comes up with a new error. I would really appreciate your time and effort to help me :)

那么,你认为 HBase 不运行有什么问题!我真的对此感到筋疲力尽。我已经花了数周时间来处理它,每次出现新错误时。我真的很感激你的时间和精力来帮助我:)

采纳答案by MLSC

you say the output of ls -l start-hbase.sh is :

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

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

if you want to know what user and group you are logging with , there us simple way:

如果您想知道您正在登录的用户和组,我们有简单的方法:

touch test
ls -l test

and check user:group ...

并检查用户:组...

the problem is user owner and group owner of script.. you have two solutions:

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

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

inorder to make it your slave...with executable state(sudo chmod +x start-hbase.sh)

为了让它成为你的奴隶......具有可执行状态(sudo chmod +x start-hbase.sh

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

and then execute the script...

然后执行脚本...

回答by Rajnish

If you still have problem after changing the permission of start-hbase.sh then run following command

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

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

Give permission to 'hbase' directory to write log file..

授予'hbase'目录写入日志文件的权限..

I hope this will help to other folks...

我希望这会对其他人有所帮助...