Hi everyone, I'm currently facing an issue with my...
# troubleshooting
s
Hi everyone, I'm currently facing an issue with my Dockerized Apache flink Application that uses Iceberg for table management and hive metastore for metadata storage. When I started the application I encountered the following error. I'm getting an error like Hadoop_Home and hadoop.home.dir are unset but when I checked they have been set already
m
How did you set the Hadoop home?
s
This is the dockerfile which I used to the build the flink image. Then in docker in the flink-CLI I have added the path to hadoop_home variable as /opt/flink/conf/hadoop
m
you are missing the an environment variable called HADOOP_HOME that contains path to the hadoop home.
I am not sure that this is the best practice but I usually use a containerized multi-stage build, and copy the hadoop home like this:
Copy code
FROM apache/hadoop:3.3.6 AS hadoop

FROM flink:1.18.1-scala_2.12-java11

ENV HADOOP_HOME /opt/hadoop

COPY --from=hadoop --chown=flink:flink /opt/hadoop $HADOOP_HOME/
RUN rm $HADOOP_HOME/share/hadoop/common/lib/slf4j-reload4j-1.7.36.jar
I delete slf4j-reload4j-1.7.36.jar because SLF for should only load one jar file.
I also user the following HADOOP_CLASSPATH if needed:
Copy code
- name: HADOOP_CLASSPATH
              value: /opt/hadoop/etc/hadoop:/opt/hadoop/share/hadoop/common/lib/*:/opt/hadoop/share/hadoop/common/*:/opt/hadoop/share/hadoop/hdfs:/opt/hadoop/share/hadoop/hdfs/lib/*:/opt/hadoop/share/hadoop/hdfs/*:/opt/hadoop/share/hadoop/mapreduce/*:/opt/hadoop/share/hadoop/yarn:/opt/hadoop/share/hadoop/yarn/lib/*:/opt/hadoop/share/hadoop/yarn/*
I am not sure which version of flink that you're using, but be sure clone the flink git project and make sure that you're using the correct hadoop version.
s
Thanks for the help, I'll let you know if there are any errors .
πŸ‘ 1