Skip to main content

Flink Standalone Server Deployment (Cross-Version Upgrade)

1. Image Pull

On the Flink nodes, pull the target version of the application image according to the architecture (Offline package download).

docker pull registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-flink:1.19.720

2. Clean Job Execution Records

Before performing the cross-version upgrade, you need to clear the job states from the old version. Execute the following commands to enter the container and clean the data:

1. Enter the Container

docker exec -it $(docker ps | grep mingdaoyun-flink | awk '{print $1}') bash

2. Backup and Clean Data

# Backup and clear the job list data of the old version
mv /data/flink/zookeeper /data/flink/zookeeper.backup-$(date +%Y%m%d%H%M%S)

3. Modify Configuration

Edit the flink.yaml configuration file to update the flink service image version tag to the target version:

# Example configuration snippet
flink:
image: registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-flink:1.19.720

Execute the following script to redeploy the service:

1. Stop the Current Service

docker stack rm flink

2. Start New Version Service

Wait until the docker ps command no longer outputs Flink-related containers, then deploy:

docker stack deploy -c flink.yaml flink

5. Republish Tasks

After the upgrade is completed, manually reopen/re-publish the tasks in the task synchronization list. Only then will the synchronization tasks resume normal operation.