Flink uses the following three authentication modes:
Authentication Mode |
Description |
Configuration Method |
---|---|---|
Kerberos authentication |
Currently, only keytab authentication mode is supported. |
|
Security cookie authentication |
- |
|
Internal authentication of Yarn |
This authentication mode does not need to be configured by the user. |
- |
One Flink cluster supports only one user. One user can create multiple Flink clusters.
Flink uses following encrypted transmission modes:
Configuration about SSL encrypted transmission is mandatory while configuration about encryption of Yarn and Hadoop is not required.
To configure SSL encrypted transmission, configure the following parameters in the flink-conf.yaml file on the client:
Parameter |
Example Value |
Description |
---|---|---|
security.ssl.enabled |
true |
Enable SSL. |
akka.ssl.enabled |
true |
Enable Akka SSL. |
blob.service.ssl.enabled |
true |
Enable SSL for the Blob channel. |
taskmanager.data.ssl.enabled |
true |
Enable SSL transmissions between TaskManagers. |
security.ssl.algorithms |
TLS_DHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_DHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 |
Configure the SSL encryption algorithm. |
For versions earlier than MRS 3.x, see Table 3.
Parameter |
Example Value |
Description |
---|---|---|
security.ssl.internal.enabled |
true |
Enable internal SSL. |
akka.ssl.enabled |
true |
Enable Akka SSL. |
blob.service.ssl.enabled |
true |
Enable SSL for the Blob channel. |
taskmanager.data.ssl.enabled |
true |
Enable SSL transmissions between TaskManagers. |
security.ssl.algorithms |
TLS_RSA_WITH_AES128CBC_SHA256 |
Configure the SSL encryption algorithm. |
Parameter |
Example Value |
Description |
---|---|---|
security.ssl.rest.enabled |
true |
Enable external SSL. If this parameter is set to true, set the related parameters by referring to Table 4. |
security.ssl.rest.keystore |
${path}/flink.keystore |
Path for storing the keystore. |
security.ssl.rest.keystore-password |
- |
A user-defined password of keystore. |
security.ssl.rest.key-password |
- |
A user-defined password of the SSL key. |
security.ssl.rest.truststore |
${path}/flink.truststore |
Path for storing the truststore. |
security.ssl.rest.truststore-password |
- |
A user-defined password of truststore. |
Enabling SSL for data transmission between TaskManagers may pose great impact on the system performance.
Parameter |
Example Value |
Description |
---|---|---|
security.ssl.keystore |
${path}/flink.keystore |
Path for storing the keystore. flink.keystore indicates the name of the keystore file generated by the generate_keystore.sh* tool. |
security.ssl.keystore-password |
- |
A user-defined password of keystore. |
security.ssl.key-password |
- |
A user-defined password of the SSL key. |
security.ssl.truststore |
${path}/flink.truststore |
Path for storing the truststore. flink.truststore indicates the name of the truststore file generated by the generate_keystore.sh* tool. |
security.ssl.truststore-password |
- |
A user-defined password of truststore. |
For versions earlier than MRS 3.x, the generate_keystore.sh command is generated automatically, and the configuration items in Table 6 are set by default. You can also configure them manually.
Parameter |
Example Value |
Description |
---|---|---|
security.ssl.internal.keystore |
${path}/flink.keystore |
Path for storing the keystore. flink.keystore indicates the name of the keystore file generated by the generate_keystore.sh* tool. |
security.ssl.internal.keystore-password |
- |
A user-defined password of keystore. |
security.ssl.internal.key-password |
- |
A user-defined password of the SSL key. |
security.ssl.internal.truststore |
${path}/flink.truststore |
Path for storing the truststore. flink.truststore indicates the name of the truststore file generated by the generate_keystore.sh* tool. |
security.ssl.internal.truststore-password |
- |
A user-defined password of truststore. |
For versions earlier than MRS 3.x, if SSL for external connections is enabled, that is, security.ssl.rest.enabled is set to true, you need to configure the parameters listed in Table 7.
Parameter |
Example Value |
Description |
---|---|---|
security.ssl.rest.enabled |
true |
Enable external SSL. If this parameter is set to true, set the related parameters by referring to Table 7. |
security.ssl.rest.keystore |
${path}/flink.keystore |
Path for storing the keystore. |
security.ssl.rest.keystore-password |
- |
A user-defined password of keystore. |
security.ssl.rest.key-password |
- |
A user-defined password of the SSL key. |
security.ssl.rest.truststore |
${path}/flink.truststore |
Path for storing the truststore. |
security.ssl.rest.truststore-password |
- |
A user-defined password of truststore. |
./bin/yarn-session.sh -t ssl/
./bin/flink run -yt ssl/ -ys 3 -m yarn-cluster -c org.apache.flink.examples.java.wordcount.WordCount /opt/client/Flink/flink/examples/batch/WordCount.jar
For versions earlier than MRS 3.x, the user who submits the job must have the permission to read the keystore and truststore files.
Either of the following methods can be used to execute applications. The -t or -yt option does not need to be added to transmit the keystore and truststore files.
./bin/yarn-session.sh
./bin/flink run -ys 3 -m yarn-cluster -c org.apache.flink.examples.java.wordcount.WordCount /opt/client/Flink/flink/examples/batch/WordCount.jar