Simon Lawrence
03/21/2023, 9:58 AMkingsathurthi
03/21/2023, 10:17 AMSimon Lawrence
03/21/2023, 10:31 AMkingsathurthi
03/21/2023, 12:32 PMSimon Lawrence
03/21/2023, 12:41 PMkingsathurthi
03/21/2023, 2:53 PMSimon Lawrence
03/21/2023, 4:24 PMSimon Lawrence
03/21/2023, 4:52 PM$ ./bin/start-zookeeper-quorum.sh
Starting zookeeper daemon on host localhost.
Make sure the application jar file is on the classpath.
$ cp ./examples/streaming/TopSpeedWindowing.jar lib/
Then, we can launch the first JobManager (Do this in foreground mode for visibility and ease of killing it) :
$ ./bin/standalone-job.sh start-foreground --job-classname org.apache.flink.streaming.examples.windowing.TopSpeedWindowing
This JobManager will be launched in application mode, and will start the job straight away.
Start a taskmanager to make sure the job actually gets run.
$ ./bin/taskmanager.sh start-foreground
We can launch a second JobManager which will act as a failover JobManager as follows:
$ ./bin/standalone-job.sh start-foreground --job-classname org.apache.flink.streaming.examples.windowing.TopSpeedWindowing -D rest.port=8082
You should now be able to access the web ui on both localhost:8081 and localhost:8082
You should see that the first job manager is running the job due to the line of logging containing: Starting execution of job 'CarTopSpeedWindowingExample'
You shouldn’t see that logging in the second job manager, as it should be in a standby state.
You should see the output in the taskmanager to prove that the job is flowing.
Kill the first JobManager using ^+C.
You should see that the second JobManager now logs out Starting execution of job 'CarTopSpeedWindowingExample'
On localhost:8082 you should see that the job has restarted.
It should continue to run using the same taskmanager which you can check in stdout in the console.Simon Lawrence
03/21/2023, 4:54 PM