在麒麟V10SP3下安装CDH6.3,运行 # hive -e "show databases;",,报错
/opt/cloudera/parcels/CDH-6.3.2-1.cdh6.3.2.p0.1605554/bin/../lib/hive/conf/hive-env.sh:行24: /opt/cloudera/parcels/CDH-6.3.2-1.cdh6.3.2.p0.1605554/lib/hbase/hbase-common.jar: 权限不够
/opt/cloudera/parcels/CDH-6.3.2-1.cdh6.3.2.p0.1605554/bin/../lib/hive/conf/hive-env.sh:行25: /opt/cloudera/parcels/CDH-6.3.2-1.cdh6.3.2.p0.1605554/lib/hbase/hbase-hadoop-compat.jar: 权限不够
/opt/cloudera/parcels/CDH-6.3.2-1.cdh6.3.2.p0.1605554/bin/../lib/hive/conf/hive-env.sh:行26: /opt/cloudera/parcels/CDH-6.3.2-1.cdh6.3.2.p0.1605554/lib/hbase/hbase-hadoop2-compat.jar: 权限不够
/opt/cloudera/parcels/CDH-6.3.2-1.cdh6.3.2.p0.1605554/bin/../lib/hive/conf/hive-env.sh:行27: /opt/cloudera/parcels/CDH-6.3.2-1.cdh6.3.2.p0.1605554/lib/hbase/hbase-protocol.jar: 权限不够
/opt/cloudera/parcels/CDH-6.3.2-1.cdh6.3.2.p0.1605554/bin/../lib/hive/conf/hive-env.sh:行28: /opt/cloudera/parcels/CDH-6.3.2-1.cdh6.3.2.p0.1605554/lib/hbase/hbase-server.jar: 权限不够
/opt/cloudera/parcels/CDH-6.3.2-1.cdh6.3.2.p0.1605554/bin/../lib/hive/conf/hive-env.sh:行29: /opt/cloudera/parcels/CDH-6.3.2-1.cdh6.3.2.p0.1605554/lib/hbase/lib/htrace-core.jar: 权限不够
能正常显示库表
OK
default
Time taken: 1.896 seconds, Fetched: 1 row(s)
同样运行 beeline 也出同样的错误

CDH6.3 运行hive -e hive -e "show databases;"报错:hive-env.sh:行24: hbase-common.jar: 权限不够
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
20条回答 默认 最新
- 问答-莫得感情 2024-11-03 06:14关注
️题主您好️,目前由我为您解答👇🏼
🧡参考谷歌智能助手,由吾为汝整理提供🧡The error message clearly indicates a permission issue with the HBase JAR files located in the CDH parcel directory. Hive relies on some HBase libraries, and your current user doesn't have the necessary permissions to access them. Here's a breakdown of the solution and some important considerations:
1. Verify Ownership and Permissions:
First, determine the user and group owning the CDH installation and the problematic JAR files:
ls -l /opt/cloudera/parcels/CDH-6.3.2-1.cdh6.3.2.p0.1605554/lib/hbase/
The output should show the owner and group (e.g.,
cloudera-scm:cloudera-scm
). Ensure your user belongs to the correct group.2. Correcting Permissions (Recommended approach - using
chmod
andchown
):The most common solution is to recursively grant read and execute permissions to the
hbase
directory and its contents for the appropriate group and user. This is the safest method if you know the correct owner and group for your CDH installation. Replacecloudera-scm
with the actual user and group from thels -l
output if they are different.sudo chown -R cloudera-scm:cloudera-scm /opt/cloudera/parcels/CDH-6.3.2-1.cdh6.3.2.p0.1605554/lib/hbase sudo chmod -R g+rx /opt/cloudera/parcels/CDH-6.3.2-1.cdh6.3.2.p0.1605554/lib/hbase
chown -R cloudera-scm:cloudera-scm ...
: This recursively changes the owner and group of thehbase
directory and all its contents tocloudera-scm
.chmod -R g+rx ...
: This recursively grants read (r
) and execute (x
) permissions to the group (g
) associated with thehbase
directory.
3. Adding User to Group (If your user isn't already in the group):
If your user is not part of the
cloudera-scm
group (or the group owning the CDH installation), add them:sudo usermod -a -G cloudera-scm <your_username>
Replace
<your_username>
with your actual username. Log out and back in (or runnewgrp cloudera-scm
) for the group change to take effect.4. Using
chmod 755
(Less recommended - broad permissions):While
chmod 755
will grant read and execute permissions to everyone, it's generally less secure. Only use this if you fully understand the implications and other options aren't feasible.sudo chmod -R 755 /opt/cloudera/parcels/CDH-6.3.2-1.cdh6.3.2.p0.1605554/lib/hbase
5. Check Hive Configuration (Less likely, but important):
Ensure that
hive-env.sh
is correctly configured and sourcing the necessary environment variables. Verify that theHBASE_HOME
environment variable (if set) points to the correct HBase installation directory.Important Considerations:
- CDH User: It's best practice to run Hive commands as the dedicated CDH user (e.g.,
cloudera-scm
). This simplifies permission management and avoids such issues. You can usesudo -u cloudera-scm hive -e "show databases;"
. - Parcel Management: If you've recently upgraded or modified CDH parcels, re-distributing the parcels and restarting related services might resolve the issue: Use the Cloudera Manager UI to re-deploy the CDH and HBase parcels.
- Kylin V10 SP3 Compatibility: While CDH 6.3 should generally be compatible with Kylin V10 SP3, ensure all dependencies are met. Check the Kylin and CDH documentation for specific compatibility details.
By following these steps, you should be able to resolve the permission issue and run Hive commands successfully. Remember to replace placeholders like
<your_username>
andcloudera-scm
with your system's actual values. Always prefer the more specific permission adjustments (chown
andchmod
with group permissions) over broad changes likechmod 755
. If the issue persists, double-check your CDH installation and configuration.解决 无用评论 打赏 举报