Thanks,nacisimsek.I will try your suggestion.



------------------ Original ------------------
From:                                                                           
                                             "nacisimsek"                       
                                                             
<nacisim...@gmail.com&gt;;
Date:&nbsp;Thu, Jul 11, 2024 06:25 PM
To:&nbsp;"Enric Ott"<243816...@qq.com&gt;;
Cc:&nbsp;"user"<user@flink.apache.org&gt;;
Subject:&nbsp;Re: Flink reactive deployment on with kubernetes operator



Hi Enric,

You can try using persistent volume claim on your kubernetes cluster as a 
JobResultStore, instead of using a local path from your underlying host, and 
see if it works.



apiVersion: v1

kind: PersistentVolumeClaim

metadata:

&nbsp; name: flink-data-pvc

spec:

&nbsp; resources:

&nbsp;&nbsp;&nbsp; requests:

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; storage: 10Gi

&nbsp; volumeMode: Filesystem

&nbsp; accessModes:

&nbsp;&nbsp;&nbsp; - ReadWriteOnce







And edit your yaml 
(spec.podTemplate.spec.volumes.persistentVolumeClaim.claimName) to use this PVC:




apiVersion: flink.apache.org/v1beta1

kind: FlinkDeployment

metadata:

&nbsp; name: basic-reactive-example

spec:

&nbsp; image: flink:1.17

&nbsp; flinkVersion: v1_17

&nbsp; flinkConfiguration:

&nbsp;&nbsp;&nbsp; scheduler-mode: REACTIVE

&nbsp;&nbsp;&nbsp; taskmanager.numberOfTaskSlots: "2"

&nbsp;&nbsp;&nbsp; state.savepoints.dir: file:///flink-data/savepoints

&nbsp;&nbsp;&nbsp; state.checkpoints.dir: file:///flink-data/checkpoints

&nbsp;&nbsp;&nbsp; high-availability: 
org.apache.flink.kubernetes.highavailability.KubernetesHaServicesFactory

&nbsp;&nbsp;&nbsp; high-availability.storageDir: file:///flink-data/ha

&nbsp; serviceAccount: flink

&nbsp; jobManager:

&nbsp;&nbsp;&nbsp; resource:

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; memory: "2048m"

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cpu: 1

&nbsp; taskManager:

&nbsp;&nbsp;&nbsp; resource:

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; memory: "2048m"

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cpu: 1

&nbsp; podTemplate:

&nbsp;&nbsp;&nbsp; spec:

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; containers:

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - name: flink-main-container

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; volumeMounts:

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - mountPath: /flink-data

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name: 
flink-volume

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; volumes:

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - name: flink-volume

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; persistentVolumeClaim:

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; claimName: flink-data-pvc

&nbsp; job:

&nbsp;&nbsp;&nbsp; jarURI: 
local:///opt/flink/examples/streaming/StateMachineExample.jar

&nbsp;&nbsp;&nbsp; parallelism: 2

&nbsp;&nbsp;&nbsp; upgradeMode: savepoint

&nbsp;&nbsp;&nbsp; state: running

&nbsp;&nbsp;&nbsp; savepointTriggerNonce: 0

&nbsp; mode: standalone




Naci

On 11. Jul 2024, at 05:40, Enric Ott <243816...@qq.com&gt; wrote:

Hi,Community:
&nbsp; I hava encountered a problem when deploy reactive flink scheduler on 
kubernetes with flink kubernetes operator 1.6.0,the manifest and exception 
stack info listed as follows.
Any clues would be appreciated.


################################################################################
#&nbsp; Licensed to the Apache Software Foundation (ASF) under one
#&nbsp; or more contributor license agreements.&nbsp; See the NOTICE file
#&nbsp; distributed with this work for additional information
#&nbsp; regarding copyright ownership.&nbsp; The ASF licenses this file
#&nbsp; to you under the Apache License, Version 2.0 (the
#&nbsp; "License"); you may not use this file except in compliance
#&nbsp; with the License.&nbsp; You may obtain a copy of the License at
#
#&nbsp; &nbsp; &nbsp; http://www.apache.org/licenses/LICENSE-2.0
#
#&nbsp; Unless required by applicable law or agreed to in writing, software
#&nbsp; distributed under the License is distributed on an "AS IS" BASIS,
#&nbsp; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#&nbsp; See the License for the specific language governing permissions and
# limitations under the License.
################################################################################


apiVersion: flink.apache.org/v1beta1
kind: FlinkDeployment
metadata:
&nbsp; name: basic-reactive-example
spec:
&nbsp; image: flink:1.17
&nbsp; flinkVersion: v1_17
&nbsp; flinkConfiguration:
&nbsp; &nbsp; scheduler-mode: REACTIVE
&nbsp; &nbsp; taskmanager.numberOfTaskSlots: "2"
&nbsp; &nbsp; state.savepoints.dir: file:///flink-data/savepoints
&nbsp; &nbsp; state.checkpoints.dir: file:///flink-data/checkpoints
&nbsp; &nbsp; high-availability: 
org.apache.flink.kubernetes.highavailability.KubernetesHaServicesFactory
&nbsp; &nbsp; high-availability.storageDir: file:///flink-data/ha
&nbsp; serviceAccount: flink
&nbsp; jobManager:
&nbsp; &nbsp; resource:
&nbsp; &nbsp; &nbsp; memory: "2048m"
&nbsp; &nbsp; &nbsp; cpu: 1
&nbsp; taskManager:
&nbsp; &nbsp; resource:
&nbsp; &nbsp; &nbsp; memory: "2048m"
&nbsp; &nbsp; &nbsp; cpu: 1
&nbsp; podTemplate:
&nbsp; &nbsp; spec:
&nbsp; &nbsp; &nbsp; containers:
&nbsp; &nbsp; &nbsp; &nbsp; - name: flink-main-container
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; volumeMounts:
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; - mountPath: /flink-data
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; name: flink-volume
&nbsp; &nbsp; &nbsp; volumes:
&nbsp; &nbsp; &nbsp; - name: flink-volume
&nbsp; &nbsp; &nbsp; &nbsp; hostPath:
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # directory location on host
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; path: 
/run/desktop/mnt/host/c/Users/24381/Documents/
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # this field is optional
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; type: DirectoryOrCreate
&nbsp; job:
&nbsp; &nbsp; jarURI: 
local:///opt/flink/examples/streaming/StateMachineExample.jar
&nbsp; &nbsp; parallelism: 2
&nbsp; &nbsp; upgradeMode: savepoint
&nbsp; &nbsp; state: running
&nbsp; &nbsp; savepointTriggerNonce: 0
&nbsp; mode: standalone





ERROR org.apache.flink.runtime.entrypoint.ClusterEntrypoint&nbsp; &nbsp; &nbsp; 
&nbsp; [] - Fatal error occurred in the cluster entrypoint.
java.util.concurrent.CompletionException: java.lang.IllegalStateException: The 
base directory of the JobResultStore isn't accessible. No dirty JobResults can 
be restored.
        at java.util.concurrent.CompletableFuture.encodeThrowable(Unknown 
Source) ~[?:?]
        at java.util.concurrent.CompletableFuture.completeThrowable(Unknown 
Source) [?:?]
        at java.util.concurrent.CompletableFuture$AsyncSupply.run(Unknown 
Source) [?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) 
[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) 
[?:?]
        at java.lang.Thread.run(Unknown Source) [?:?]
Caused by: java.lang.IllegalStateException: The base directory of the 
JobResultStore isn't accessible. No dirty JobResults can be restored.
        at 
org.apache.flink.util.Preconditions.checkState(Preconditions.java:193) 
~[flink-dist-1.17.1.jar:1.17.1]
        at 
org.apache.flink.runtime.highavailability.FileSystemJobResultStore.getDirtyResultsInternal(FileSystemJobResultStore.java:199)
 ~[flink-dist-1.17.1.jar:1.17.1]
        at 
org.apache.flink.runtime.highavailability.AbstractThreadsafeJobResultStore.withReadLock(AbstractThreadsafeJobResultStore.java:118)
 ~[flink-dist-1.17.1.jar:1.17.1]
        at 
org.apache.flink.runtime.highavailability.AbstractThreadsafeJobResultStore.getDirtyResults(AbstractThreadsafeJobResultStore.java:100)
 ~[flink-dist-1.17.1.jar:1.17.1]
        at 
org.apache.flink.runtime.dispatcher.runner.SessionDispatcherLeaderProcess.getDirtyJobResults(SessionDispatcherLeaderProcess.java:194)
 ~[flink-dist-1.17.1.jar:1.17.1]
        at 
org.apache.flink.runtime.dispatcher.runner.AbstractDispatcherLeaderProcess.supplyUnsynchronizedIfRunning(AbstractDispatcherLeaderProcess.java:198)
 ~[flink-dist-1.17.1.jar:1.17.1]
        at 
org.apache.flink.runtime.dispatcher.runner.SessionDispatcherLeaderProcess.getDirtyJobResultsIfRunning(SessionDispatcherLeaderProcess.java:188)
 ~[flink-dist-1.17.1.jar:1.17.1]
        ... 4 more

Reply via email to