fix set maxEsStatusRetry to 60
@@ -183,7 +183,7 @@ public class FessEsClient implements Client {
protected int maxConfigSyncStatusRetry = 10;
- protected int maxEsStatusRetry = 10;
+ protected int maxEsStatusRetry = 60;
protected String clusterName = "elasticsearch";
@@ -566,6 +566,7 @@ public class FessEsClient implements Client {
protected void waitForYellowStatus(final FessConfig fessConfig) {
Exception cause = null;
+ final long startTime = System.currentTimeMillis();
for (int i = 0; i < maxEsStatusRetry; i++) {
try {
final ClusterHealthResponse response =
@@ -589,7 +590,8 @@ public class FessEsClient implements Client {
}
final String message =
"Elasticsearch (" + System.getProperty(Constants.FESS_ES_HTTP_ADDRESS)
- + ") is not available. Check the state of your Elasticsearch cluster (" + clusterName + ").";
+ + ") is not available. Check the state of your Elasticsearch cluster (" + clusterName + ") in "
+ + (System.currentTimeMillis() - startTime) + "ms.";
throw new ContainerInitFailureException(message, cause);
}
