Hello folks. It’s about almost two weeks since I a...
# troubleshooting
a
Hello folks. It’s about almost two weeks since I am struggling to run a simple program and I explained enough about the issues. It sounds like that code is fine but I can not get results. Anyway, my main goal is to get data through a Kafka connector with Flink Table API in JSON format and run a query and print all data (i.e. select * from my_table). I have already studied the Table API mechanism but still cannot run the query and see the results. I want to send a very sample data through a Kafka producer and after running query through Table API, print the results in the terminal/console. So, can you please show me a sample project containing a docker file and source codes (whatever Java/Python/Scala) with a good documentation that I could run it easily on my laptop? (I forgot to introduce myself: I am a software developer with more than 10 years experiences of Java EE system development. My expertise is ORM and Object-Oriented systems). I do appreciate your assistance. Best, Amir.
d
Hey, I have replied to this problem in the original thread. It should be because there is no enough resource in your Flink cluster. I guess the TaskManagers have been shutdown for some reason. Please double check that.
a
Hey Dian, Thank you for your message. How can I monitor TaskManagers? This is my docker container and it looks fine. Where else I should look for?
d
@Amir Hossein Sharifzadeh You can check Flink web UI: http://localhost:8081. It shows how many resources are still available in the cluster.
a
d
The number of free slots are 0 and so there is no resources available. Could you click the
Running jobs
to see if there is already a job running.
a
so how can I increase resources?
d
You can increase the number of TaskManager as following (see https://nightlies.apache.org/flink/flink-docs-release-1.16/docs/try-flink/flink-operations-playground/#step-2b-restart-job-w[…]parallelism-rescaling for more details):
Copy code
docker-compose scale taskmanager=2
Besides, you could also increase the number of task slots in one TaskManager with configuration
taskmanager.numberOfTaskSlots
.
If you change the configuration
askmanager.numberOfTaskSlots
, you need to restart the cluster to make it work.
a
Thank you very much for all explanations. flink-conf.yaml is a readonly loccaly file here /Users/amir/PycharmProjects/WalkThrough/venv/lib/python3.9/site-packages/pyflink/conf/flink-conf.yaml. I am going to change it and down and up docker again. See what happens.
d
I meant the flink-conf.yaml used by the docker-compose to startup the Flink cluster. I guess it should be this file https://github.com/apache/flink-playgrounds/blob/master/operations-playground/conf/flink-conf.yaml instead of the flink-conf.yaml installed in PyFlink.
To make the above example to work, I guess you could just run
docker-compose scale taskmanager=5
to add more TaskManagers. You could also cancel the existing job running in the cluster to release the resources.
a
ALL RIGHT. Thank you so much Dian and other people. You made my day! It works now! Awsome!
👏 1