HDDS-1518. Use /etc/ozone for configuration inside docker-compose.

Contributed by Elek, Marton.

(cherry picked from commit ac814f15b1)
This commit is contained in:
Anu Engineer 2019-05-16 15:02:43 +02:00
parent fc758b4be6
commit 527b43b604
3 changed files with 7 additions and 3 deletions

View File

@ -36,7 +36,9 @@ RUN chown hadoop /opt
ADD scripts /opt/ ADD scripts /opt/
ADD scripts/krb5.conf /etc/ ADD scripts/krb5.conf /etc/
RUN yum install -y krb5-workstation 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 WORKDIR /opt/hadoop
VOLUME /data VOLUME /data

View File

@ -36,7 +36,7 @@ class Simple(object):
self.known_formats = ['xml', 'properties', 'yaml', 'yml', 'env', "sh", "cfg", 'conf'] self.known_formats = ['xml', 'properties', 'yaml', 'yml', 'env', "sh", "cfg", 'conf']
self.output_dir = self.args.destination self.output_dir = self.args.destination
self.excluded_envs = ['HADOOP_CONF_DIR']
self.configurables = {} self.configurables = {}
def destination_file_path(self, name, extension): def destination_file_path(self, name, extension):
@ -51,6 +51,8 @@ class Simple(object):
def process_envs(self): def process_envs(self):
"""Process environment variables""" """Process environment variables"""
for key in os.environ.keys(): for key in os.environ.keys():
if key in self.excluded_envs:
continue
pattern = re.compile("[_\\.]") pattern = re.compile("[_\\.]")
parts = pattern.split(key) parts = pattern.split(key)
extension = None extension = None

View File

@ -99,7 +99,7 @@ fi
#To avoid docker volume permission problems #To avoid docker volume permission problems
sudo chmod o+rwx /data 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 if [ -n "$ENSURE_NAMENODE_DIR" ]; then
CLUSTERID_OPTS="" CLUSTERID_OPTS=""