Comments (6)
Can you be more specific? It likely has to do with how you are running/using the Flink Docker image.
from docker-flink.
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.
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.
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.
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: jobmanagertaskmanager:
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.
- You set a java property log.file - it is a path and file prefix.
- You use that to configure logback to log to generate a file name with a timestamp marker.
- You mount the folder from the containers to the host.
from docker-flink.
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)
- Flink 1.7 on docker hub HOT 1
- docker-flink standalone mode
- The docker image should not run as root HOT 4
- `Error loading shared library ld-linux-x86-64.so.2` on running jar over http HOT 3
- Support configuration properties available as env vars in Docker HOT 2
- Improve GPG signature handling
- Upgrade to gosu 1.11
- Cleanup images after running tests
- Run "non-root" test as flink user, not arbitrary user HOT 6
- Request: Allow user to edit number of numberOfTaskSlots, parallelism
- Pass through JVM crash error report
- high availability configuration HOT 1
- Remove alpine image HOT 2
- taskmanager.numberOfTaskSlots always gets overwritten? HOT 3
- How can I build flink image on a Centos machine? HOT 2
- Limit on log file size of Flink container
- confusion how to configure logs
- The future of the other docker-flink repos HOT 3
- Add new image based on Java 11 HOT 7
- Kubernetes: Task manager failed to flink-jobmanager name resolution . HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-flink.