diff --git common/src/java/org/apache/hadoop/hive/conf/HiveConf.java common/src/java/org/apache/hadoop/hive/conf/HiveConf.java index 598684e..45f907d 100644 --- common/src/java/org/apache/hadoop/hive/conf/HiveConf.java +++ common/src/java/org/apache/hadoop/hive/conf/HiveConf.java @@ -2843,9 +2843,10 @@ private static void populateLlapDaemonVarsSet(Set llapDaemonVarsSetLocal LLAP_DAEMON_RPC_NUM_HANDLERS("hive.llap.daemon.rpc.num.handlers", 5, "Number of RPC handlers for LLAP daemon.", "llap.daemon.rpc.num.handlers"), LLAP_DAEMON_WORK_DIRS("hive.llap.daemon.work.dirs", "", - "Working directories for the daemon. Needs to be set for a secure cluster, since LLAP may\n" + - "not have access to the default YARN working directories. yarn.nodemanager.local-dirs is\n" + - "used if this is not set", "llap.daemon.work.dirs"), + "Working directories for the daemon. This should not be set if running as a YARN\n" + + "application via Slider. It must be set when not running via Slider on YARN. If the value\n" + + "is set when running as a Slider YARN application, the specified value will be used.", + "llap.daemon.work.dirs"), LLAP_DAEMON_YARN_SHUFFLE_PORT("hive.llap.daemon.yarn.shuffle.port", 15551, "YARN shuffle port for LLAP-daemon-hosted shuffle.", "llap.daemon.yarn.shuffle.port"), LLAP_DAEMON_YARN_CONTAINER_MB("hive.llap.daemon.yarn.container.mb", -1, diff --git llap-common/pom.xml llap-common/pom.xml index 2ce41ed..31f4e9b 100644 --- llap-common/pom.xml +++ llap-common/pom.xml @@ -47,6 +47,11 @@ + org.apache.commons + commons-lang3 + ${commons-lang3.version} + + org.apache.hadoop hadoop-common ${hadoop.version} diff --git llap-common/src/java/org/apache/hadoop/hive/llap/LlapUtil.java llap-common/src/java/org/apache/hadoop/hive/llap/LlapUtil.java index 298be76..0c04d9d 100644 --- llap-common/src/java/org/apache/hadoop/hive/llap/LlapUtil.java +++ llap-common/src/java/org/apache/hadoop/hive/llap/LlapUtil.java @@ -20,6 +20,7 @@ import java.util.Map; import java.util.regex.Pattern; +import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.hive.conf.HiveConf; @@ -32,10 +33,25 @@ public class LlapUtil { private static final Logger LOG = LoggerFactory.getLogger(LlapUtil.class); - public static String getDaemonLocalDirList(Configuration conf) { + public static String getDaemonLocalDirString(Configuration conf, String workDirsEnvString) { String localDirList = HiveConf.getVar(conf, ConfVars.LLAP_DAEMON_WORK_DIRS); - if (localDirList != null && !localDirList.isEmpty()) return localDirList; - return conf.get("yarn.nodemanager.local-dirs"); + if (localDirList != null && !localDirList.isEmpty()) { + LOG.info("Local dirs from Configuration: {}", localDirList); + if (!localDirList.equalsIgnoreCase("useYarnEnvDirs") && + !StringUtils.isBlank(localDirList)) { + LOG.info("Using local dirs from Configuration"); + return localDirList; + } + } + // Fallback to picking up the value from environment. + if (StringUtils.isNotBlank(workDirsEnvString)) { + LOG.info("Using local dirs from environment: {}", workDirsEnvString); + return workDirsEnvString; + } else { + throw new RuntimeException( + "Cannot determined local dirs from specified configuration and env. ValueFromConf=" + + localDirList + ", ValueFromEnv=" + workDirsEnvString); + } } public static UserGroupInformation loginWithKerberos( diff --git llap-server/changes_for_non_slider_install.txt llap-server/changes_for_non_slider_install.txt new file mode 100644 index 0000000..ec20fe1 --- /dev/null +++ llap-server/changes_for_non_slider_install.txt @@ -0,0 +1,5 @@ +-- Incomplete list of changes required to run LLAP as standalone daemons outside of YARN, instead of as a Slider App +hive.llap.daemon.work.dirs - Create dirs on each node, and set to this value. +hive.llap.daemon.service.hosts - Comma separated list of hosts on which llap will run. +ApplicationConstants.Environment.CONTAINER_ID should be available in the environment for secure clusters + diff --git llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/LlapDaemon.java llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/LlapDaemon.java index 5457658..53a2295 100644 --- llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/LlapDaemon.java +++ llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/LlapDaemon.java @@ -434,7 +434,9 @@ public static void main(String[] args) throws Exception { int numExecutors = HiveConf.getIntVar(daemonConf, ConfVars.LLAP_DAEMON_NUM_EXECUTORS); - String localDirList = LlapUtil.getDaemonLocalDirList(daemonConf); + String workDirsString = System.getenv(ApplicationConstants.Environment.LOCAL_DIRS.name()); + + String localDirList = LlapUtil.getDaemonLocalDirString(daemonConf, workDirsString); String[] localDirs = (localDirList == null || localDirList.isEmpty()) ? new String[0] : StringUtils.getTrimmedStrings(localDirList); int rpcPort = HiveConf.getIntVar(daemonConf, ConfVars.LLAP_DAEMON_RPC_PORT);