File tree 1 file changed +11
-1
lines changed
launcher/src/main/java/com/dtstack/flink/sql/launcher
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,12 @@ public class ClusterClientFactory {
60
60
61
61
private static final String HA_CLUSTER_ID = "high-availability.cluster-id" ;
62
62
63
+ private static final String HIGH_AVAILABILITY = "high-availability" ;
64
+
65
+ private static final String NODE = "NONE" ;
66
+
67
+ private static final String ZOOKEEPER = "zookeeper" ;
68
+
63
69
private static final String HADOOP_CONF = "fs.hdfs.hadoopconf" ;
64
70
65
71
public static ClusterClient createClusterClient (Options launcherOptions ) throws Exception {
@@ -96,6 +102,8 @@ public static ClusterClient createYarnSessionClient(Options launcherOptions) {
96
102
97
103
if (StringUtils .isNotBlank (yarnConfDir )) {
98
104
try {
105
+ boolean isHighAvailability ;
106
+
99
107
config .setString (HADOOP_CONF , yarnConfDir );
100
108
FileSystem .initialize (config );
101
109
@@ -123,7 +131,9 @@ public static ClusterClient createYarnSessionClient(Options launcherOptions) {
123
131
throw new RuntimeException ("No flink session found on yarn cluster." );
124
132
}
125
133
126
- if (config .getString (HA_CLUSTER_ID , null ) == null ) {
134
+ isHighAvailability = config .getString (HIGH_AVAILABILITY , NODE ).equals (ZOOKEEPER );
135
+
136
+ if (isHighAvailability && config .getString (HA_CLUSTER_ID , null ) == null ) {
127
137
config .setString (HA_CLUSTER_ID , applicationId .toString ());
128
138
}
129
139
You can’t perform that action at this time.
0 commit comments