gpt4 book ai didi

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

转载 作者:IT王子 更新时间:2023-10-29 00:35:31 26 4
gpt4 key购买 nike

我想运行 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 时,它给了我一些 permission denied 的错误,我不明白为什么:

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:

我不知道我应该在这里输入什么。无论如何,我只是点击了 Enter,它又切换回了 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

并检查 user: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"

然后执行脚本...

关于linux - HBase 在 ./start-hbase.sh 之后不运行 - 权限被拒绝?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21166542/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com