Lital Ron
12/31/2023, 1:41 PMCaused by: org.apache.flink.core.fs.UnsupportedFileSystemSchemeException: Could not find a file system implementation for scheme 'abfs'. The scheme is directly supported by Flink through the following plugin(s): flink-fs-azure-hadoop. Please ensure that each plugin resides within its own subfolder within the plugins directory. See https://nightlies.apache.org/flink/flink-docs-stable/docs/deployment/filesystems/plugins/ for more information. If you want to use a Hadoop file system for that scheme, please add the scheme to the configuration fs.allowed-fallback-filesystems. For a full list of supported file systems, please see https://nightlies.apache.org/flink/flink-docs-stable/ops/filesystems/.Martijn Visser
12/31/2023, 2:08 PMMartijn Visser
12/31/2023, 2:08 PMLital Ron
12/31/2023, 2:08 PMMartijn Visser
12/31/2023, 2:09 PMMartijn Visser
12/31/2023, 2:09 PMLital Ron
12/31/2023, 2:11 PMMartijn Visser
12/31/2023, 2:12 PMMartijn Visser
12/31/2023, 2:12 PMLital Ron
12/31/2023, 2:12 PMMartijn Visser
12/31/2023, 2:12 PMMartijn Visser
12/31/2023, 2:13 PMMartijn Visser
12/31/2023, 2:15 PMLital Ron
12/31/2023, 2:15 PMLital Ron
01/01/2024, 12:16 PMMartijn Visser
01/01/2024, 7:57 PMLital Ron
01/02/2024, 9:22 AMThis is the only thing I put in the config
val accountName = account_name
val accountKey = account_key
val props = new Properties
props.put(s"fs.azure.account.key.$accountName.dfs.core.windows.net", accountKey)
val conf = ConfigurationUtils.createConfiguration(props)
FileSystem.initialize(conf, null)
val env = StreamExecutionEnvironment.getExecutionEnvironmentLital Ron
01/02/2024, 9:23 AMFileSink
.forBulkFormat(
new Path(s"abfs://$containerName@$accountName.dfs.core.windows.net/"),
ParquetProtoWriters.forType(classTag[A].runtimeClass.asInstanceOf[Class[A]])
)
.withBucketAssigner(EntityBucketAssigner.apply)
.withOutputFileConfig(
OutputFileConfig
.builder()
.withPartSuffix(".parquet")
.build()
)
.build()Martijn Visser
01/02/2024, 9:41 AMMartijn Visser
01/02/2024, 9:41 AMMartijn Visser
01/02/2024, 9:42 AMval accountName = <account_name>
val accountKey = <account_key>
val props = new Properties
props.put(s"fs.azure.account.key.$accountName.dfs.core.windows.net", accountKey)This won't work either way, because it's a plugin, so it has a separate class loader. That's also what the documentation explains on plugins
Lital Ron
01/02/2024, 9:45 AMLital Ron
01/02/2024, 9:46 AMservice:
image: my_image
ports:
- '8081:8081'
- '9999:9999'
command: 'standalone-job --job-classname com.controlup.service.Stream'
hostname: service
environment:
- |
FLINK_PROPERTIES=
jobmanager.rpc.address: service
parallelism.default: 1
metrics.reporters: prom
metrics.reporter.prom.factory.class: org.apache.flink.metrics.prometheus.PrometheusReporterFactory
metrics.reporter.prom.port: 9999
jobmanager.bind-host: 0.0.0.0
networks:
test_network:
aliases:
- service
ipv4_address: 192.124.0.5
depends_on:
- "kafka"
healthcheck:
test: [ "CMD", "./bin/flink", "list" ]
interval: 30s
timeout: 10s
retries: 4
taskmanager:
image: my_image
ports:
- '9998:9998'
depends_on:
- service
command: taskmanager
hostname: taskmanager
environment:
- |
FLINK_PROPERTIES=
jobmanager.rpc.address: service
taskmanager.memory.process.size: 2g
taskmanager.memory.managed.size: 0m
taskmanager.memory.network.max: 64m
parallelism.default: 1
metrics.reporters: prom
metrics.reporter.prom.factory.class: org.apache.flink.metrics.prometheus.PrometheusReporterFactory
metrics.reporter.prom.port: 9998
networks:
test_network:
aliases:
- taskmanager
ipv4_address: 192.124.0.6
networks:
test_network:
driver: bridge
ipam:
config:
- subnet: 192.124.0.0/16Martijn Visser
01/02/2024, 10:22 AMLital Ron
01/02/2024, 10:22 AMMartijn Visser
01/02/2024, 10:23 AMLital Ron
01/02/2024, 10:24 AMFROM flink:1.17-scala_2.12-java11
RUN mkdir /opt/flink/plugins/azure-fs-hadoop/
RUN cp /opt/flink/opt/flink-azure-fs-hadoop-*.jar /opt/flink/plugins/azure-fs-hadoop/ && chown -R flink: /opt/flink/plugins/azure-fs-hadoop/
RUN ln -fs /opt/flink/opt/flink-azure-fs-hadoop-*.jar /opt/flink/lib/.
RUN apt remove -y curl libcurl4
RUN apt update && apt -y install telnet libc-bin libc6 libexpat1 zlib1g unzip opensslMartijn Visser
01/02/2024, 10:33 AM2024-01-02 103254,175 INFO org.apache.flink.core.plugin.DefaultPluginManager [] - Plugin loader with ID not found, creating it: azure-fs-hadoopWorks like a charm here
Martijn Visser
01/02/2024, 10:34 AMversion: '3.8'
services:
jobmanager:
build: flink-init/.
ports:
- "8081:8081"
command: jobmanager
environment:
- |
FLINK_PROPERTIES=
jobmanager.rpc.address: jobmanager
taskmanager:
build: flink-init/.
depends_on:
- jobmanager
command: taskmanager
environment:
- |
FLINK_PROPERTIES=
jobmanager.rpc.address: jobmanager
taskmanager.numberOfTaskSlots: 2
sql-client:
build: flink-init/.
command: bin/sql-client.sh
depends_on:
- jobmanager
environment:
- |
FLINK_PROPERTIES=
jobmanager.rpc.address: jobmanager
rest.address: jobmanager
As my Docker Compose fileLital Ron
01/02/2024, 10:35 AMMartijn Visser
01/02/2024, 10:37 AMmy-image), I'm referring to my Dockerfile and running docker-compose up --build to build the image if I make a change to the DockerfileLital Ron
01/02/2024, 10:40 AMMartijn Visser
01/02/2024, 11:28 AMLital Ron
01/02/2024, 12:07 PMLital Ron
01/02/2024, 12:19 PMFROM flink:1.17-scala_2.12-java11
RUN mkdir /opt/flink/plugins/azure-fs-hadoop/
RUN cp /opt/flink/opt/flink-azure-fs-hadoop-*.jar /opt/flink/plugins/azure-fs-hadoop/ && chown -R flink: /opt/flink/plugins/azure-fs-hadoop/
RUN apt remove -y curl libcurl4
RUN apt update && apt -y install telnet libc-bin libc6 libexpat1 zlib1g unzip opensslMartijn Visser
01/03/2024, 9:01 AMLital Ron
01/03/2024, 9:02 AMMartijn Visser
01/03/2024, 9:03 AMLital Ron
01/03/2024, 9:03 AMMartijn Visser
01/03/2024, 9:04 AM2024-01-03 09:04:24,728 INFO org.apache.flink.core.plugin.DefaultPluginManager [] - Plugin loader with ID not found, creating it: azure-fs-hadoop
Still worksLital Ron
01/03/2024, 9:05 AMMartijn Visser
01/03/2024, 9:05 AMLital Ron
01/03/2024, 9:07 AMCaused by: org.apache.hadoop.fs.UnsupportedFileSystemException: No FileSystem for scheme "file"
The only schema I am using is abfsMartijn Visser
01/03/2024, 9:07 AMMartijn Visser
01/03/2024, 9:08 AMsetting fs.azure.data.blocks.buffer to array makes abfs use memory to cache instead of local disk so that it doesn't need localfilesystem.
Martijn Visser
01/03/2024, 9:10 AMMartijn Visser
01/03/2024, 9:10 AMLital Ron
01/03/2024, 9:13 AM