- Hadoop 3.3.5
- 配置单元3.1.3
- 不 rust 钢0.10.2
我按照此链接中的说明为Hadoop 3.3.5构建tez 0.10.2:https://tez.apache.org/install.html
数据库存储在s3存储桶中,我可以使用hive.execution.engine= mr运行“select count(*)from m1.t1”。
当我设置hive.execution.engine=tez并运行相同的查询时,我立即得到了这个错误:
2023-02-15T21:21:09,208 INFO [a6e2cd1a-b2c9-42d8-9568-8e0b64677f77 main] client.TezClient: App did not succeed. Diagnostics: Application application_1676506240754_0019 failed 2 times due to AM Contai
ner for appattempt_1676506240754_0019_000002 exited with exitCode: 1
Failing this attempt.Diagnostics: [2023-02-15 21:21:08.730]Exception from container-launch.
Container id: container_1676506240754_0019_02_000001
Exit code: 1
[2023-02-15 21:21:08.732]Container exited with a non-zero exit code 1. Error file: prelaunch.err.
Last 4096 bytes of prelaunch.err :
Last 4096 bytes of stderr :
Error: Could not find or load main class org.apache.tez.dag.app.DAGAppMaster
[2023-02-15 21:21:08.733]Container exited with a non-zero exit code 1. Error file: prelaunch.err.
Last 4096 bytes of prelaunch.err :
Last 4096 bytes of stderr :
Error: Could not find or load main class org.apache.tez.dag.app.DAGAppMaster
如果我在tez-site.xml中将tez.use.cluster.hadoop-libs设置为true,即使我在hadoop的core-site.xml、hive的hive-site.xml和.bashrc环境变量中设置了fs.s3a凭据,YARN仍会运行,但会因加载aws凭据错误而失败。
keys are masked to show sample only:
echo $AWS_ACCESS_KEY_ID
I9U996400005XXXXXXXX
echo $AWS_SECRET_KEY
mPY8GiU6NegNWoVnaODXXXXXXXXXXXXXXXXXXXX
hive> set hive.execution.engine=tez;
hive> select count(*) from m1.t1;
Query ID = hdp-user_20230215210146_62ed9fab-5d4a-42a9-bf54-5fb6f84a9048
Total jobs = 1
Launching Job 1 out of 1
Status: Running (Executing on YARN cluster with App id application_1676506240754_0015)
----------------------------------------------------------------------------------------------
VERTICES MODE STATUS TOTAL COMPLETED RUNNING PENDING FAILED KILLED
----------------------------------------------------------------------------------------------
Map 1 container INITIALIZING -1 0 0 -1 0 0
Reducer 2 container INITED 1 0 0 1 0 0
----------------------------------------------------------------------------------------------
VERTICES: 00/02 [>>--------------------------] 0% ELAPSED TIME: 2.03 s
----------------------------------------------------------------------------------------------
Status: Failed
Vertex failed, vertexName=Map 1, vertexId=vertex_1676506240754_0015_3_00, diagnostics=[Vertex vertex_1676506240754_0015_3_00 [Map 1] killed/failed due to:ROOT_INPUT_INIT_FAILURE, Vertex Input: t1 initializer failed, vertex=vertex_1676506240754_0015_3_00 [Map 1], java.nio.file.AccessDeniedException: s3a://hadoop-cluster/warehouse/tablespace/managed/hive/m1.db/t1: org.apache.hadoop.fs.s3a.auth.NoAuthWithAWSException: No AWS Credentials provided by TemporaryAWSCredentialsProvider SimpleAWSCredentialsProvider EnvironmentVariableCredentialsProvider IAMInstanceCredentialsProvider : com.amazonaws.SdkClientException: Unable to load AWS credentials from environment variables (AWS_ACCESS_KEY_ID (or AWS_ACCESS_KEY) and AWS_SECRET_KEY (or AWS_SECRET_ACCESS_KEY))
尝试将core-site.xml中的所有fs.s3a属性添加到tez-site.xml中,并在配置单元会话内设置fs,s3 a,access. key和fs.s3a.secret.key=,但仍出现相同错误。
org.apache.hadoop.fs.s3a.auth.NoAuthWithAWSException: No AWS Credentials provided by TemporaryAWSCredentialsProvider SimpleAWSCredentialsProvider EnvironmentVariableCredentialsProvider IAMInstanceCredentialsProvider : com.amazonaws.SdkClientException: Unable to load AWS credentials from environment variables (AWS_ACCESS_KEY_ID (or AWS_ACCESS_KEY) and AWS_SECRET_KEY (or AWS_SECRET_ACCESS_KEY))
问题:根据tez安装说明
确保未在tez-site.xml中设置tez.use.cluster.hadoop-libs,或者如果设置了,则值应为false
但是当设置为false时,tez无法运行。当设置为true时,我得到了aws凭据错误,即使我在每个可能的位置或环境变量中设置了它们。
======================================更新:我不确定这是否是这个问题的正确答案,但是我最终通过将这个属性添加到hive-site.xml中使它工作起来
<property>
<name>hive.conf.hidden.list</name>
<value>javax.jdo.option.ConnectionPassword,hive.server2.keystore.password,fs.s3a.proxy.password,dfs.adls.oauth2.credential,fs.adl.oauth2.credential</value>
</property>
默认情况下,所有fs.s3a凭证都是隐藏配置,即使你没有设置这个属性。我显式地添加了这个属性,并从值中删除了所有相关的fs.s3a凭证。现在,我可以用tez运行select count(*)。
1条答案
按热度按时间whitzsjs1#
我正在运行YARN,但加载aws凭据失败
在将任何作业提交给YARN之前,配置单元会从作业配置中删除
hive.conf.hidden.list
中的属性。因此,在您的情况下,缺少的属性fs.s3a.access.key
和fs.s3a.secret.key
会导致No AWS Credentials provided
。请参见此处
hive.conf.hidden.list
下的S3文件系统相关属性;你的更新解决了这个问题,我认为这是正确的解决方案。但是,只是让你知道,现在你暴露了S3密钥密码在各种日志文件。一些文件,我知道如下;
Hive-〉
<HIVE_HOME>/logs/<user>/webhcat/webhcat.log.<date>
Hadoop -〉1个内存6个内存1个
如果您有权访问源代码,则可以修改此方法,使其不在配置单元日志中生成上述属性。