我正在尝试连接到已配置为使用Kerberos进行身份验证的配置单元播放器.当我不想使用keytab文件时,即当程序在身份验证过程中提示我输入密码时,这对我有用.当我更改配置以使用keytab时,我得到一个包含此语句的长堆栈跟踪:
Additional pre-authentication required (25) - Need to use PA-ENC-TIMESTAMP/PA-PK-AS-REQ
Run Code Online (Sandbox Code Playgroud)
谁能就我做错了什么提出任何建议?
我的问题的上下文,如果这是相关的,我想从mapreduce作业访问hive Metastore,当然,mapreduce作业无法回答提示.
我的程序看起来像这样:
package com.test;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
public class HiveJDBC {
public static void main(String[] args) throws Exception {
Class.forName("org.apache.hive.jdbc.HiveDriver");
System.setProperty("java.security.auth.login.config","gss-jaas.conf");
System.setProperty("sun.security.jgss.debug","true");
System.setProperty("javax.security.auth.useSubjectCredsOnly","false");
System.setProperty("java.security.krb5.conf","krb5.conf");
Connection con = DriverManager.getConnection("jdbc:hive2://some.machine:10000/default;principal=hive/some.machine@MY_REALM");
// Do stuff with the connection
}
}
Run Code Online (Sandbox Code Playgroud)
我的gss-jaas.conf文件如下所示:
com.sun.security.jgss.initiate {
com.sun.security.auth.module.Krb5LoginModule required
useKeyTab=true
useTicketCache=false
principal="my-account@MY_REALM"
doNotPrompt=true
keyTab="path-to-my-keytab-file"
debug=true;
};
Run Code Online (Sandbox Code Playgroud)
我的krb5.conf文件看起来像这样
[libdefaults]
default_realm = MY_REALM
dns_lookup_realm = false
dns_lookup_kdc = false
ticket_lifetime = 24h
renew_lifetime …Run Code Online (Sandbox Code Playgroud) 有人可以解释为什么这会在JDK 1.6中编译,但在JDK 1.7中没有我收到错误消息:
java:示例不是抽象的,并且不会覆盖java.lang.Comparable中的抽象方法compareTo(java.lang.Object)?
import java.util.concurrent.*;
public class Example implements ScheduledFuture
{
@Override public long getDelay(TimeUnit unit){ return 0; }
@Override public int compareTo(Delayed o) { return 0; }
@Override public boolean cancel(boolean mayInterruptIfRunning) { return false; }
@Override public boolean isCancelled() { return false; }
@Override public boolean isDone() { return false; }
@Override public Object get() throws InterruptedException, ExecutionException { return null; }
@Override public Object get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { return null; } …Run Code Online (Sandbox Code Playgroud) 据我了解,使用 Files.walkFileTree 遍历文件树时处理异常的常用方法是在访问者实现中实现一些 try/catch 逻辑,例如,只是默默地忽略任何 AccessDeniedExceptions 并继续处理其他文件。但我认为我发现了一种情况,调用从访问者代码外部抛出异常,这使得很难对此采取任何措施。效果就是整个文件遍历崩溃。是的,它是在遍历 Linux 上特殊的 /proc 文件系统时发生的。
在同一路径上使用旧的 Java API File.list(..) 不会崩溃,它只是默默地返回一个空列表。
我的问题是,有没有办法保证像这样的权限问题不会中断整个文件遍历?
对于这个特定的目录,我的用户似乎是该文件夹及其所有内容的所有者,如下所示:
thomas.larsson@anonymized $ sudo ls -la /proc/2662/map_files
total 0
dr-x------ 2 thomas.larsson thomas 0 mar 4 09:44 .
dr-xr-xr-x 9 thomas.larsson thomas 0 mar 4 09:11 ..
lr-------- 1 thomas.larsson thomas 64 mar 4 12:39 7f67499df000-7f67499ea000 -> /lib/x86_64-linux-gnu/libnss_files-2.19.so
...
Run Code Online (Sandbox Code Playgroud)
这让我觉得我无法在 preVisitDirectory 方法中执行任何操作,例如检查 PosixFileAttributes 以确定我是否可以读取此目录。
这是一个为我重现问题的 junit 片段
package com.apa;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import java.nio.file.*;
import java.nio.file.attribute.BasicFileAttributes;
public class Example { …Run Code Online (Sandbox Code Playgroud) 我们有一个oozie工作流,其shell操作需要比Yarn默认提供的map任务更多的内存.
我们怎样才能给它更多的记忆?
我们尝试将以下配置添加到操作中:
<configuration>
<property>
<name>mapreduce.map.memory.mb</name>
<value>6144</value> <!-- for example -->
</property>
</configuration>
Run Code Online (Sandbox Code Playgroud)
我们都将其设置为内联(在workflow.xml中)配置和jobXml.两者都没有任何影响.