diff --git a/Dockerfile b/Dockerfile index d06cb82ef5a..21299dfa477 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,7 +36,9 @@ RUN chown hadoop /opt ADD scripts /opt/ ADD scripts/krb5.conf /etc/ RUN yum install -y krb5-workstation - +RUN mkdir -p /etc/hadoop && mkdir -p /var/log/hadoop && chmod 1777 /etc/hadoop && chmod 1777 /var/log/hadoop +ENV HADOOP_LOG_DIR=/var/log/hadoop +ENV HADOOP_CONF_DIR=/etc/hadoop WORKDIR /opt/hadoop VOLUME /data diff --git a/scripts/envtoconf.py b/scripts/envtoconf.py index ad2e176570b..0e2c3686276 100755 --- a/scripts/envtoconf.py +++ b/scripts/envtoconf.py @@ -36,7 +36,7 @@ class Simple(object): self.known_formats = ['xml', 'properties', 'yaml', 'yml', 'env', "sh", "cfg", 'conf'] self.output_dir = self.args.destination - + self.excluded_envs = ['HADOOP_CONF_DIR'] self.configurables = {} def destination_file_path(self, name, extension): @@ -51,6 +51,8 @@ class Simple(object): def process_envs(self): """Process environment variables""" for key in os.environ.keys(): + if key in self.excluded_envs: + continue pattern = re.compile("[_\\.]") parts = pattern.split(key) extension = None diff --git a/scripts/starter.sh b/scripts/starter.sh index 7688ce7d7fb..13286076f2e 100755 --- a/scripts/starter.sh +++ b/scripts/starter.sh @@ -99,7 +99,7 @@ fi #To avoid docker volume permission problems sudo chmod o+rwx /data -"$DIR"/envtoconf.py --destination /opt/hadoop/etc/hadoop +"$DIR"/envtoconf.py --destination "${HADOOP_CONF_DIR:-/opt/hadoop/etc/hadoop}" if [ -n "$ENSURE_NAMENODE_DIR" ]; then CLUSTERID_OPTS=""