Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Support Questions

Find answers, ask questions, and share your expertise
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!

Which directories should be mounted in docker to persist flows?

avatar
Explorer

After having lost all my test work I decided it is time to investigate how to persist data in NiFi when running it in a docker image. I use the official image. This is what I managed to gather so far:

 

services:
  nifi:
    container_name: nifi
    image: apache/nifi:latest
    ports:
      - "8443:8443"
      - "16543:16543"
    volumes:
      - "C:/nifi/data:/data"
      - "C:/nifi/state:/opt/nifi/nifi-current/state"
      - "C:/nifi/database:/opt/nifi/nifi-current/database_repository"
      - "C:/nifi/flowfile:/opt/nifi/nifi-current/flowfile_repository"
      - "C:/nifi/content:/opt/nifi/nifi-current/content_repository"
      - "C:/nifi/provenance:/opt/nifi/nifi-current/provenance_repository"

 

When stopping/staring the container everything is OK (login credentials and content)

When removing the container, the credentials are persisted but the content is gone.

 

I presume that there is yet another directory that I should mount in order to have the data saved there. Which one is it?

 

1 REPLY 1

avatar
Frequent Visitor

Flow definitions are saved in the `conf` dir and at least 2 different approaches can be mentioned to backup it: the first by manually `docker cp`its contents and mount them later as a volume at your next run, while the second leveraging the mount bind option of docker to automatically synchronize the `conf` dir contents with your local dir.