Configure Collection Verbosity
Under Docker Compose Client
Viewing the Current Configuration
To view the current configuration file in all Task Manager instances, use the following command:
for name in `docker ps --format "{{.Names}}" | grep datorios-roei-cluster-1-taskmanager`; do
echo $name
docker exec $name cat /datorios/probes.config
echo
done
This command performs the following steps:
- Lists all Docker container names matching the pattern
datorios-roei-cluster-1-taskmanager
. - Prints the container name for each Task Manager instance.
- Executes the
cat /datorios/probes.config
command inside each container to display the configuration file contents. - Adds an empty line for better readability between outputs.
Changing the Config File in All Task Manager Instances
To modify the configuration file in all Task Manager instances (e.g., disabling state probes), use the following command:
for name in `docker ps --format "{{.Names}}" | grep datorios-roei-cluster-1-taskmanager`; do
docker exec $name sed -i 's/STATES=true/STATES=false/g' /datorios/probes.config
done
This command performs the following steps:
- Lists all Docker container names matching the pattern
datorios-roei-cluster-1-taskmanager
. - Executes the
sed
command inside each container to update theprobes.config
file, changing the value ofSTATES
fromtrue
tofalse
.
Verifying the Applied Config in Task Manager Logs
To verify that the configuration has been applied by checking the Task Manager logs, use the following command:
for name in `docker ps --format "{{.Names}}" | grep datorios-roei-cluster-1-taskmanager`; do
echo $name
docker logs $name 2>&1 | grep Reloading
echo
done
This command performs the following steps:
- Lists all Docker container names matching the pattern
datorios-roei-cluster-1-taskmanager
. - Prints the container name for each Task Manager instance.
- Searches the logs of each container for entries containing the word "Reloading", indicating the configuration has been reloaded.
- Adds an empty line for better readability between outputs.
Under K8S Operator
Adding a Lifecycle Hook for Configuration
To modify the configuration for Task Manager instances in Kubernetes, update the deployment-flink.yaml
file with a postStart
lifecycle hook under taskManager
:
lifecycle:
postStart:
exec:
command:
- /bin/sh
- -c
- sed -i 's/WINDOWS=true/WINDOWS=false/g' /datorios/probes.config
Full Section Example:
taskManager:
resource:
memory: "2048m"
cpu: 1
podTemplate:
spec:
containers:
- name: flink-main-container
image: public.ecr.aws/v3p0m7u7/metro-flink-public:1.17.2
lifecycle:
postStart:
exec:
command:
- /bin/sh
- -c
- sed -i 's/WINDOWS=true/WINDOWS=false/g' /datorios/probes.config
Notes:
- This hook will apply the configuration when the Task Manager launches. No further runtime changes are needed.
- You do not need to delete the deployment; reapplying it will recreate the configuration.
Probes You Can Enable/Disable
There are three types of probes you can configure in the probes.config
file:
- WINDOWS
- STATES
- RECORDS
Set each probe to true
or false
to enable or disable its collection.
These commands and configurations allow you to effectively manage and verify the verbosity settings for your Task Manager instances.