GithubHelp home page GithubHelp logo

Comments (6)

patricklucas avatar patricklucas commented on June 12, 2024

Can you be more specific? It likely has to do with how you are running/using the Flink Docker image.

from docker-flink.

jurek7 avatar jurek7 commented on June 12, 2024

I'd like to understand how to configure persistent directories for:

  • logs
  • job upload directories
  • working directory

What I'd need to achieve is the single node fail-over in case of machine restarts etc.
Currently it's hard to guess how to do this since I cannot find any documentation.

My questions is similar to #10

from docker-flink.

patricklucas avatar patricklucas commented on June 12, 2024

Except for logs, it's up to the platform you're using the image with. Docker Compose will be different than Kubernetes will be different from bare Docker.

As for logs, the image is configured to send all logs to stdout (for capture by the Docker daemon), so making the logs dir persistent isn't useful.

HA mode is configured in basically the same way as Flink itself; there's not a lot different when using this image, except for differences between container platforms.

from docker-flink.

jurek7 avatar jurek7 commented on June 12, 2024

I am not exactly agree about comment on different platforms because once you have reference configuration in docker-compose it's fairly easy to translate to Kubernetes configurations.

In my opinion it'd would be nice to have such reference. Please take a look on other frameworks like storm(mentioned in #10): https://hub.docker.com/_/storm/

from docker-flink.

witzatom avatar witzatom commented on June 12, 2024

A way you could do this in a docker compose is:

version: '3'
services:
jobmanager:
image: flink:${FLINK_VERSION}
expose:
- "6123"
ports:
- "8081:8081"
volumes:
- ./flink-conf.yaml:/opt/flink/conf/flink-conf.yaml
- ./log:/opt/flink/log
environment:
FLINK_ENV_JAVA_OPTS: -Dlog.file=/opt/flink/log/jobmanager
command: jobmanager

taskmanager:
image: flink:${FLINK_VERSION}
expose:
- "6121"
- "6122"
volumes:
- ./flink-conf.yaml:/opt/flink/conf/flink-conf.yaml
- ./log:/opt/flink/log
environment:
FLINK_ENV_JAVA_OPTS: -Dlog.file=/opt/flink/log/taskmanager
depends_on:
- jobmanager
command: taskmanager
links:
- "jobmanager:jobmanager"

using a custom built image with the following logback.xml - idk how to do this with log4j, but it should not be hard to change to log4j

<timestamp key="datetime" datePattern="yyyyMMdd'T'HHmmss"/>
<property name="logfile" value ="${log.file:-./log/flink}}-${datetime}.log" />

<appender name="FILE" class="ch.qos.logback.core.FileAppender">
    <file>${logfile}</file>
    <encoder>
        <pattern>%date [%level] from %logger{10} in %thread - %message%n%xException</pattern>
    </encoder>
</appender>

<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
    <encoder>
        <pattern>%date %highlight([%level]) from %highlight(%logger{10}) [%thread] - %message%n%xException</pattern>
        <!-- in %thread -->
    </encoder>
</appender>

<appender name="ASYNCFILE" class="ch.qos.logback.classic.AsyncAppender">
    <appender-ref ref="FILE"/>
</appender>

<appender name="ASYNCSTDOUT" class="ch.qos.logback.classic.AsyncAppender">
    <appender-ref ref="STDOUT"/>
</appender>

<root level="INFO">
    <appender-ref ref="ASYNCFILE"/>
    <appender-ref ref="ASYNCSTDOUT"/>
</root>

Some explanation.

  1. You set a java property log.file - it is a path and file prefix.
  2. You use that to configure logback to log to generate a file name with a timestamp marker.
  3. You mount the folder from the containers to the host.

from docker-flink.

jurek7 avatar jurek7 commented on June 12, 2024

I tried similar and I think that it's not enough to guarantee fail-over and survive machine restarts.

from docker-flink.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.