Flink Service Program Fails to Read Files on the NFS Disk
Issue
The Flink service program cannot read files on the NFS disk mounted to the cluster node.
Symptom
The Flink service program developed by a user needs to read the user-defined configuration file. The configuration file is stored on the NFS disk. The NFS disk is mounted to the cluster node and can be accessed by all nodes in the cluster. After the user submits the Flink program, the service code cannot access the user-defined configuration file. As a result, the service program fails to be started.
Cause Analysis
The root cause is that the permission on the root directory of the NFS disk is insufficient. As a result, the Flink program cannot access the directory after being started.
Flink tasks of MRS are running on Yarn. If Kerberos authentication is not enabled for the cluster, the user who runs the tasks on Yarn is yarn_user. If the user-defined configuration file is used after the tasks are started, yarn_user must be allowed to access the file and the parent directory of the file (parent directory of the file on the NFS, not the soft link on the cluster node). Otherwise, the program cannot obtain the file content. If Kerberos authentication is enabled for the cluster, the file permission must allow the user who submits the program to access the file.
Procedure
- Log in to the master node in the cluster as user root.
- Run the following command to check the permission on the parent directory of the user-defined configuration file:
ll <Parent directory of the file path>
- Go to the directory of the file to be accessed on the NFS disk and change the permission of the parent directory of the user-defined configuration file to 755.
chmod 755 -R /<Parent directory of the file path>
- Check whether the core or task node can access the configuration file.
- Log in to the core or task node as user root.
If Kerberos authentication is enabled for the current cluster, log in to the core node as user root.
- Run su - yarn_user to switch to user yarn_user.
If Kerberos authentication is enabled for the cluster, run the su - User who submits the job command to switch the user.
- Run the following command to check the user permission. The file path must be the absolute path of the file.
- Log in to the core or task node as user root.
Summary and Suggestions
When a user-defined configuration file needs to be accessed in the submitted task, especially when the NFS disk is mounted, you need to check whether the permission of the parent directory of the file is correct in addition to the file permission. When an NFS disk is mounted to an MRS cluster node, a soft link is created to the NFS directory. In this case, you need to check whether the directory permission on the NFS is correct.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot