Versions
V100R002C70SPC20*
V100R002C80SPC20*
Symptom
After a client is successfully installed, an error message "IllegalConfigurationException: Error while parsing YAML configuration file:"security.cookie" is displayed when you run a command (for example, yarn-session.sh) on the client.
[root@xxx-xxx-xxx-10 bin]# yarn-session.sh
2018-10-24 15:34,788 | ERROR | [main] | Error while trying to split key and value in configuration file /opt/flinkclient/Flink/flink/conf/flink-conf.yaml:77: "security.cookie: " | org.apache.flink.configuration.GlobalConfiguration (GlobalConfiguration.java:160)
Exception in thread "main" org.apache.flink.configuration.IllegalConfigurationException: Error while parsing YAML configuration file :77: "security.cookie: "
at org.apache.flink.configuration.GlobalConfiguration.loadYAMLResource(GlobalConfiguration.java:161)
at org.apache.flink.configuration.GlobalConfiguration.loadConfiguration(GlobalConfiguration.java:112)
at org.apache.flink.configuration.GlobalConfiguration.loadConfiguration(GlobalConfiguration.java:79)
at org.apache.flink.yarn.cli.FlinkYarnSessionCli.main(FlinkYarnSessionCli.java:482)
[root@xxx-xxx-xxx-10 bin]#Possible Causes
In a secure cluster environment, Flink requires security authentication. The security authentication is not configured on the current client.
Fault Locating
- Flink uses following authentication modes:
- Kerberos authentication: Is used between Flink YARN client and YARN ResourceManager, JobManager and ZooKeeper, JobManager and HDFS, TaskManager and HDFS, Kafka and TaskManager, as well as TaskManager and ZooKeeper.
- Security cookie authentication: Is used between Flink YARN client and JobManager, JobManager and TaskManager, as well as TaskManager and TaskManager.
- Internal authentication mechanism of YARN: Is used between YARN Resource Manager and Application Master (AM).
- If a secure mode is used, you must configure the Kerberos authentication and security cookie authentication. As shown in the logs, it is found that the security.cookie configuration in the configuration file is incorrect andthe security configuration is not performed.
Solution
- Invoke the generate_keystore.sh script provided by FusionInsight to generate Security Cookie, flink.keystore, and flink.truststore.
2. Enable Security Cookie, and set security.enable to true. Then, check whether security cookie is successfully configured, as shown in the following figure