mirror of https://github.com/apache/druid.git
Ensure Krb auth before killing YARN apps in graceful shutdown (#9785)
This commit is contained in:
parent
9e6978609a
commit
3447934a75
|
@ -97,9 +97,8 @@ public class JobHelper
|
|||
* Dose authenticate against a secured hadoop cluster
|
||||
* In case of any bug fix make sure to fix the code at HdfsStorageAuthentication#authenticate as well.
|
||||
*
|
||||
* @param config containing the principal name and keytab path.
|
||||
*/
|
||||
public static void authenticate(HadoopDruidIndexerConfig config)
|
||||
public static void authenticate()
|
||||
{
|
||||
String principal = HadoopDruidIndexerConfig.HADOOP_KERBEROS_CONFIG.getPrincipal();
|
||||
String keytab = HadoopDruidIndexerConfig.HADOOP_KERBEROS_CONFIG.getKeytab();
|
||||
|
@ -348,7 +347,7 @@ public class JobHelper
|
|||
|
||||
public static void ensurePaths(HadoopDruidIndexerConfig config)
|
||||
{
|
||||
authenticate(config);
|
||||
authenticate();
|
||||
// config.addInputPaths() can have side-effects ( boo! :( ), so this stuff needs to be done before anything else
|
||||
try {
|
||||
Job job = Job.getInstance(
|
||||
|
|
|
@ -35,6 +35,7 @@ import org.apache.druid.indexer.HadoopDruidIndexerConfig;
|
|||
import org.apache.druid.indexer.HadoopDruidIndexerJob;
|
||||
import org.apache.druid.indexer.HadoopIngestionSpec;
|
||||
import org.apache.druid.indexer.IngestionState;
|
||||
import org.apache.druid.indexer.JobHelper;
|
||||
import org.apache.druid.indexer.MetadataStorageUpdaterJobHandler;
|
||||
import org.apache.druid.indexer.TaskMetricsGetter;
|
||||
import org.apache.druid.indexer.TaskMetricsUtils;
|
||||
|
@ -762,6 +763,8 @@ public class HadoopIndexTask extends HadoopTask implements ChatHandler
|
|||
}
|
||||
|
||||
if (jobId != null) {
|
||||
// This call to JobHelper#authenticate will be transparent if already authenticated or using inseucre Hadoop.
|
||||
JobHelper.authenticate();
|
||||
int res = ToolRunner.run(new JobClient(), new String[]{
|
||||
"-kill",
|
||||
jobId
|
||||
|
|
Loading…
Reference in New Issue