gpt4 book ai didi

java - AWS EMR - 使用 Java SDK 安装 HUE

转载 作者:行者123 更新时间:2023-12-01 11:29:51 25 4
gpt4 key购买 nike

我正在尝试设置 StepConfig 以在集群上安装和运行 HUE。我通过以下方式创建步骤:

private StepConfig newInstallHueStep() {
return new StepConfig()
.withName("Install Hue")
.withActionOnFailure(getDefaultActionOnFailure())
.withHadoopJarStep(stepFactory.newScriptRunnerStep("s3://us-west-1.elasticmapreduce/libs/hue/install-hue"));
}

private StepConfig newRunHueStep() {
return new StepConfig()
.withName("Run Hue")
.withActionOnFailure(getDefaultActionOnFailure())
.withHadoopJarStep(stepFactory.newScriptRunnerStep("s3://us-west-1.elasticmapreduce/libs/hue/run-hue"));
}

结果是步骤安装 Hue 成功,而运行 Hue 失败。

enter image description here

标准错误日志:

=== Uninstalling hbase
=== Saved registry at /var/lib/hue/app.reg
=== Saved /usr/lib/hue/build/env/lib/python2.6/site-packages/hue.pth
=== Uninstalling security
=== Saved registry at /var/lib/hue/app.reg
=== Saved /usr/lib/hue/build/env/lib/python2.6/site-packages/hue.pth
=== Uninstalling search
=== Saved registry at /var/lib/hue/app.reg
=== Saved /usr/lib/hue/build/env/lib/python2.6/site-packages/hue.pth
=== Uninstalling sqoop
=== Saved registry at /var/lib/hue/app.reg
=== Saved /usr/lib/hue/build/env/lib/python2.6/site-packages/hue.pth
=== Uninstalling zookeeper
=== Saved registry at /var/lib/hue/app.reg
=== Saved /usr/lib/hue/build/env/lib/python2.6/site-packages/hue.pth
=== Uninstalling rdbms
=== Saved registry at /var/lib/hue/app.reg
=== Saved /usr/lib/hue/build/env/lib/python2.6/site-packages/hue.pth
=== Uninstalling spark
=== Saved registry at /var/lib/hue/app.reg
=== Saved /usr/lib/hue/build/env/lib/python2.6/site-packages/hue.pth
=== Uninstalling impala
=== Saved registry at /var/lib/hue/app.reg
=== Saved /usr/lib/hue/build/env/lib/python2.6/site-packages/hue.pth
=== Saved /usr/lib/hue/build/env/lib/python2.6/site-packages/hue.pth
Running '/usr/lib/hue/build/env/bin/hue syncdb --noinput' with None
Running '/usr/lib/hue/build/env/bin/hue migrate --merge' with None
Traceback (most recent call last):
File "/usr/lib/hue/build/env/bin/hue", line 9, in <module>
load_entry_point('desktop==3.7.1-amzn-2', 'console_scripts', 'hue')()
File "/usr/lib/hue/desktop/core/src/desktop/manage_entry.py", line 60, in entry
execute_manager(settings)
File "/usr/lib/hue/build/env/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/core/management/__init__.py", line 459, in execute_manager
utility.execute()
File "/usr/lib/hue/build/env/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/core/management/__init__.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/lib/hue/build/env/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/core/management/base.py", line 196, in run_from_argv
self.execute(*args, **options.__dict__)
File "/usr/lib/hue/build/env/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/core/management/base.py", line 232, in execute
output = self.handle(*args, **options)
File "/usr/lib/hue/build/env/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/core/management/base.py", line 371, in handle
return self.handle_noargs(**options)
File "/usr/lib/hue/desktop/core/src/desktop/management/commands/install_all_examples.py", line 89, in handle_noargs
raise exception
hadoop.fs.exceptions.WebHdfsException: SecurityException: Failed to obtain user group information: org.apache.hadoop.security.authorize.AuthorizationException: User: hue is not allowed to impersonate hue (error 403)
Command exiting with ret '255'
<小时/>

我也尝试过单步Run Hue,然后标准错误是:

Command exiting with ret '255'

最佳答案

使用 Java sdk 安装 Hue 的正确方法是将安装 Hue 步骤作为引导操作发布,并将运行 Hue 作为作业流程步骤发布。

RunJobFlowRequest runJobFlowRequest = new RunJobFlowRequest("Main", jobFlowInstancesConfig)
.withName("SDK_filtering" + System.currentTimeMillis())
.withAmiVersion("3.7.0")
.withVisibleToAllUsers(true)
.withServiceRole("EMR_DefaultRole")
.withJobFlowRole("EMR_EC2_DefaultRole")
.withBootstrapActions(
new BootstrapActionConfig("Install Hue",
new ScriptBootstrapActionConfig("s3://us-west-1.elasticmapreduce/libs/hue/install-hue", null)))
.withSteps(
newEnableDebugStep(),
newInstallHiveStep(),
newInstallPig(),
newRunHueStep()
);

关于java - AWS EMR - 使用 Java SDK 安装 HUE,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30508710/

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