Hi Team, We are using Flink (1.18) version on our...
# troubleshooting
v
Hi Team, We are using Flink (1.18) version on our flink standalone cluster over kubernetes. Job manager has been deployed on "Application mode" and HA is disabled (high-availability.type: NONE), under these configuration parameters we are able to start multiple jobs (using env.executeAsync()) of a single application. Note: We have also setup checkpoint on a s3 instance with RETAIN_ON_CANCELLATION mode (plus other required settings). Lets say now we start two jobs of the same application (ex: Jobidxxx1, jobidxxx2) and they are currently running on the k8s env. If we have to perform Flink minor upgrade (or) upgrade of our application with minor changes, in that case we will stop the Job Manager and Task Managers instances and perform the necessary up-gradation then when we start both Job Manager and Task Managers instance. On startup we expect the job's to be restored back from the last checkpoint, but the job restoration is not happening on Job manager startup. Please let us know if this is an bug (or) its the general behavior of flink under application mode of deployment. Additional information: If we enable HA (using Zookeeper) on Application mode, we are able to startup only one job (i.e., per-job behavior). When we perform Flink minor upgrade (or) upgrade of our application with minor changes, the checkpoint restoration is working properly on Job Manager & Task Managers restart process. It seems checkpoint restoration and HA are inter-related, but why checkpoint restoration doesn't work when HA is disabled. Please let us know if anyone has experienced similar issues or if have any suggestions, it will be highly appreciated. Thanks in advance for your assistance. Note: Same is logged as an issue on JIRA. https://issues.apache.org/jira/browse/FLINK-34009
m
How are you restarting the job after the upgrade? In general there isn’t really enough information on how you are doing this to help out on this topic
v
We are scale down the jobmanager and taskmanager pods and then update our deployment yaml file (to change the image version). After updating the pods are scaled up to its original replica definition.
m
Are you using the Kubernetes Operator ?
v
nope... we are using it in standalone more...
*mode
m
I don’t think you’re performing an upgrade
v
I can share the yaml's for reference....
Let me redact some of the information on the yaml filess (service yaml, job manager yaml - deployment and task manager yaml - deployment yaml)
Also we create a customised docker image using redhat-ubi, java17 and over that we lay the flink 1.18.0 image...
m
v
@Martijn Visser Sorry for the deplay in my response. Please find the attached yaml files which we use for flink deployment on k8s. Note: As its a redact version, so please consider these yaml files for reference and its not suitable for deployment and testing. Its just to give an idea on our deployment process. Also the image used on the deployment is a custom image built using the flink-1.18.0-bin-scala_2.12.tgz file downloaded from "https://archive.apache.org/dist/flink/flink-1.18.0/flink-1.18.0-bin-scala_2.12.tgz".
Dockerfile to build this custom image..
Copy code
FROM <REDHAT-UBI + JAVA17 custom image>

USER root

RUN echo '[INFO] Upgrading & installing packages ...' \
    && microdnf update -y \
    && microdnf install -y findutils shadow-utils wget \
    && echo "===> clean up ..."  \
    && microdnf clean all && rm -rf /tmp/*

RUN adduser -d /home/flink -U flink -u 1000


ENV FLINK_INSTALL_PATH /opt
ENV FLINK_HOME $FLINK_INSTALL_PATH/flink
ENV FLINK_LIB_DIR $FLINK_HOME/lib
ENV PATH $PATH:$FLINK_HOME/bin
ENV FLINK_VERSION  1.18.0
ENV HADOOP_VERSION 24
ENV SCALA_VERSION 2.12

ENV TAR flink-${FLINK_VERSION}-bin-scala_${SCALA_VERSION}.tgz
ENV TAR_URL https://archive.apache.org/dist/flink/flink-${FLINK_VERSION}/${TAR}

#download flink
RUN set -x \
         && wget ${TAR_URL}

#tar and rename flink
RUN set -x \
        && mkdir ${FLINK_HOME}\
        && tar zxvf ${TAR} -C ${FLINK_HOME} \
        && mv ${FLINK_HOME}/flink-${FLINK_VERSION}/*  ${FLINK_HOME} \
        && rm -rf ${FLINK_HOME}/flink-${FLINK_VERSION} \
        && rm -rf ${TAR} \
        && mkdir -p /opt/flink/plugins/s3-fs-hadoop \
        && chmod -R 777 /opt/flink/plugins/s3-fs-hadoop \
        && mkdir -p /opt/flink/plugins/s3-fs-presto \
        && chmod -R 777 /opt/flink/plugins/s3-fs-presto \
        && cp ${FLINK_HOME}/opt/flink-s3-fs-hadoop-${FLINK_VERSION}.jar ${FLINK_HOME}/plugins/s3-fs-hadoop/flink-s3-fs-hadoop-${FLINK_VERSION}.jar \
        && cp ${FLINK_HOME}/opt/flink-s3-fs-presto-${FLINK_VERSION}.jar ${FLINK_HOME}/plugins/s3-fs-presto/flink-s3-fs-presto-${FLINK_VERSION}.jar \
        && rm -rf ${FLINK_HOME}/opt/flink-python_${SCALA_VERSION}-${FLINK_VERSION}.jar \
        && rm -rf ${FLINK_HOME}/examples/streaming/Twitter.jar \
        && rm ${FLINK_HOME}/lib/log4j-*.jar

COPY  log4j-*.jar ${FLINK_HOME}/lib/       

RUN mkdir -p $FLINK_HOME/log
RUN set -x && \
    chown -R flink:flink $FLINK_HOME

USER flink
@Martijn Visser The suggestion which you provided to use Kubernetes Operator, is this option available only when you deploy on the kubernetes native mode (or) this can be used on standalone deployment process over k8s? The document shared doesnt provide this information. So please clarify. https://apache-flink.slack.com/archives/C03G7LJTS2G/p1704818030781389?thread_ts=1704774871.016469&cid=C03G7LJTS2G
@Martijn Visser Please revert back to me if you need any further information.
Attached jobmanager deployment file, which didnt get uploaded properly before...
@Martijn Visser Please confirm if Flink on Application mode of deployment without HA (NONE) and executing multiple jobs (via executeAsync), on upgrade (on jobmanager restart) can the Job manager recover from the previous checkpoint state (or) this is not a supported functionality on App mode? This clarification would be helpful. So that we can confirm if its an configuration issue on our end. Thanks in advance.
May our assumption is incorrect and your clarifications will be helpful.
n
@Vijayakumar Ranganathan have you build flink cluster in kube environment (for task manager) with multi pods/nodes? And zk cluster for job manager?