Search code examples
apache-flink

how to make apache flink uploaded jar file store in nfs path in kuberntes


I am using apache flink v1.10.0 in kubernetes v1.15.2, now I can successfully run the flink jobs and save the history tasks. Now the problem is my uploaded jar was stored in apache flink's pod. Because the pods host storage only have very small 40GB, already used 30GB +. Now I want the uploaded jar could stored in NFS. I already mounted the PV in current taskmanager's pod's /opt/data directory, but the file did not store in NFS.

What should I write the config to make uploaded jar file store in NFS and free my host space? This is current I am config:

web.upload.dir: /opt/flink/data/jars

I am tried using this but failed:

web.upload.dir: file:///opt/flink/data/jars

but the checkpoint store like this worked:

env.setStateBackend(new FsStateBackend("file:///opt/flink/data"));

so what should I do? Thanks. This is the file currently store:

enter image description here


Solution

  • I think there is a problem with your directory names.

    You have created a PV at: /opt/data. But your config defines the dir path at: /opt/flink/data/jars. Changing the config path to /opt/data/jars might work.

    N.B. The user running Flink should have write access to the folder.

    Here's what you can do to debug:

    1. You can check the /opt/flink/data/jars directory. Or,
    2. You can check for one of the following log messages (info level):
    Using directory <dir_name> for web frontend JAR file uploads.
    

    or

    Created directory <dir_name> for web frontend JAR file uploads.
    

    or

    Jar upload directory <dir_name> cannot be created or is not writable.