diff --git a/src/main/assemblies/files/fess.in.sh b/src/main/assemblies/files/fess.in.sh index 5e0218f1e..1ff14d673 100755 --- a/src/main/assemblies/files/fess.in.sh +++ b/src/main/assemblies/files/fess.in.sh @@ -15,7 +15,6 @@ fi # External elasticsearch cluster #ES_HTTP_URL=http://localhost:9200 -#ES_TRANSPORT_URL=localhost:9300 #FESS_DICTIONARY_PATH=/var/lib/elasticsearch/config/ # SSL truststore for certificate validation over https diff --git a/src/main/java/org/codelibs/fess/es/client/FessEsClient.java b/src/main/java/org/codelibs/fess/es/client/FessEsClient.java index 130a0a7cf..dce3b844d 100644 --- a/src/main/java/org/codelibs/fess/es/client/FessEsClient.java +++ b/src/main/java/org/codelibs/fess/es/client/FessEsClient.java @@ -184,6 +184,8 @@ public class FessEsClient implements Client { protected int maxEsStatusRetry = 10; + protected String clusterName = "elasticsearch"; + public void addIndexConfig(final String path) { indexConfigList.add(path); } @@ -230,7 +232,7 @@ public class FessEsClient implements Client { if (StringUtil.isBlank(httpAddress)) { if (runner == null) { runner = new ElasticsearchClusterRunner(); - final Configs config = newConfigs().clusterName(fessConfig.getElasticsearchClusterName()).numOfNode(1).useLogger(); + final Configs config = newConfigs().clusterName(clusterName).numOfNode(1).useLogger(); final String esDir = System.getProperty("fess.es.dir"); if (esDir != null) { config.basePath(esDir); @@ -586,8 +588,7 @@ 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 (" + fessConfig.getElasticsearchClusterName() - + ")."; + + ") is not available. Check the state of your Elasticsearch cluster (" + clusterName + ")."; throw new ContainerInitFailureException(message, cause); } @@ -1174,6 +1175,10 @@ public class FessEsClient implements Client { T build(R response, H hit); } + public void setClusterName(String clusterName) { + this.clusterName = clusterName; + } + // // Elasticsearch Client // @@ -1499,5 +1504,4 @@ public class FessEsClient implements Client { public void fieldCaps(final FieldCapabilitiesRequest request, final ActionListener listener) { client.fieldCaps(request, listener); } - } diff --git a/src/main/java/org/codelibs/fess/mylasta/direction/FessConfig.java b/src/main/java/org/codelibs/fess/mylasta/direction/FessConfig.java index 7b7e80226..80d44b504 100644 --- a/src/main/java/org/codelibs/fess/mylasta/direction/FessConfig.java +++ b/src/main/java/org/codelibs/fess/mylasta/direction/FessConfig.java @@ -25,21 +25,9 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction /** The key of the configuration. e.g. Fess */ String DOMAIN_TITLE = "domain.title"; - /** The key of the configuration. e.g. elasticsearch */ - String ELASTICSEARCH_CLUSTER_NAME = "elasticsearch.cluster.name"; - /** The key of the configuration. e.g. http://localhost:9201 */ String ELASTICSEARCH_HTTP_URL = "elasticsearch.http.url"; - /** The key of the configuration. e.g. false */ - String ELASTICSEARCH_TRANSPORT_SNIFF = "elasticsearch.transport.sniff"; - - /** The key of the configuration. e.g. 1m */ - String ELASTICSEARCH_TRANSPORT_ping_timeout = "elasticsearch.transport.ping_timeout"; - - /** The key of the configuration. e.g. 5s */ - String ELASTICSEARCH_TRANSPORT_nodes_sampler_interval = "elasticsearch.transport.nodes_sampler_interval"; - /** The key of the configuration. e.g. aes */ String APP_CIPHER_ALGORISM = "app.cipher.algorism"; @@ -1442,48 +1430,13 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction String getDomainTitle(); /** - * Get the value for the key 'elasticsearch.cluster.name'.
- * The value is, e.g. elasticsearch
+ * Get the value for the key 'elasticsearch.http.url'.
+ * The value is, e.g. http://localhost:9201
* comment: Elasticsearch * @return The value of found property. (NotNull: if not found, exception but basically no way) */ - String getElasticsearchClusterName(); - - /** - * Get the value for the key 'elasticsearch.http.url'.
- * The value is, e.g. http://localhost:9201
- * @return The value of found property. (NotNull: if not found, exception but basically no way) - */ String getElasticsearchHttpUrl(); - /** - * Get the value for the key 'elasticsearch.transport.sniff'.
- * The value is, e.g. false
- * @return The value of found property. (NotNull: if not found, exception but basically no way) - */ - String getElasticsearchTransportSniff(); - - /** - * Is the property for the key 'elasticsearch.transport.sniff' true?
- * The value is, e.g. false
- * @return The determination, true or false. (if not found, exception but basically no way) - */ - boolean isElasticsearchTransportSniff(); - - /** - * Get the value for the key 'elasticsearch.transport.ping_timeout'.
- * The value is, e.g. 1m
- * @return The value of found property. (NotNull: if not found, exception but basically no way) - */ - String getElasticsearchTransportPingTimeout(); - - /** - * Get the value for the key 'elasticsearch.transport.nodes_sampler_interval'.
- * The value is, e.g. 5s
- * @return The value of found property. (NotNull: if not found, exception but basically no way) - */ - String getElasticsearchTransportNodesSamplerInterval(); - /** * Get the value for the key 'app.cipher.algorism'.
* The value is, e.g. aes
@@ -5924,30 +5877,10 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction return get(FessConfig.DOMAIN_TITLE); } - public String getElasticsearchClusterName() { - return get(FessConfig.ELASTICSEARCH_CLUSTER_NAME); - } - public String getElasticsearchHttpUrl() { return get(FessConfig.ELASTICSEARCH_HTTP_URL); } - public String getElasticsearchTransportSniff() { - return get(FessConfig.ELASTICSEARCH_TRANSPORT_SNIFF); - } - - public boolean isElasticsearchTransportSniff() { - return is(FessConfig.ELASTICSEARCH_TRANSPORT_SNIFF); - } - - public String getElasticsearchTransportPingTimeout() { - return get(FessConfig.ELASTICSEARCH_TRANSPORT_ping_timeout); - } - - public String getElasticsearchTransportNodesSamplerInterval() { - return get(FessConfig.ELASTICSEARCH_TRANSPORT_nodes_sampler_interval); - } - public String getAppCipherAlgorism() { return get(FessConfig.APP_CIPHER_ALGORISM); } @@ -8292,11 +8225,7 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction protected java.util.Map prepareGeneratedDefaultMap() { java.util.Map defaultMap = super.prepareGeneratedDefaultMap(); defaultMap.put(FessConfig.DOMAIN_TITLE, "Fess"); - defaultMap.put(FessConfig.ELASTICSEARCH_CLUSTER_NAME, "elasticsearch"); defaultMap.put(FessConfig.ELASTICSEARCH_HTTP_URL, "http://localhost:9201"); - defaultMap.put(FessConfig.ELASTICSEARCH_TRANSPORT_SNIFF, "false"); - defaultMap.put(FessConfig.ELASTICSEARCH_TRANSPORT_ping_timeout, "1m"); - defaultMap.put(FessConfig.ELASTICSEARCH_TRANSPORT_nodes_sampler_interval, "5s"); defaultMap.put(FessConfig.APP_CIPHER_ALGORISM, "aes"); defaultMap.put(FessConfig.APP_CIPHER_KEY, "___change__me___"); defaultMap.put(FessConfig.APP_DIGEST_ALGORISM, "sha256"); diff --git a/src/main/resources/fess_config.properties b/src/main/resources/fess_config.properties index 1114d4694..37c3e6ab1 100644 --- a/src/main/resources/fess_config.properties +++ b/src/main/resources/fess_config.properties @@ -8,6 +8,9 @@ # The title of domain the application for logging domain.title = Fess +# Elasticsearch +elasticsearch.http.url=http://localhost:9201 + # Cryptographer app.cipher.algorism=aes app.cipher.key=___change__me___ diff --git a/src/packaging/common/env/fess b/src/packaging/common/env/fess index d952f0791..f24577776 100644 --- a/src/packaging/common/env/fess +++ b/src/packaging/common/env/fess @@ -18,5 +18,4 @@ ES_HOME=/usr/share/elasticsearch/ # Elasticsearch URL ES_HTTP_URL=http://localhost:9200 -ES_TRANSPORT_URL=localhost:9300 diff --git a/src/packaging/deb/init.d/fess b/src/packaging/deb/init.d/fess index 48be37f26..3ae7191cd 100755 --- a/src/packaging/deb/init.d/fess +++ b/src/packaging/deb/init.d/fess @@ -116,7 +116,6 @@ export FESS_VAR_PATH export FESS_DICTIONARY_PATH export ES_HOME export ES_HTTP_URL -export ES_TRANSPORT_URL export FESS_JAVA_OPTS # Check DAEMON exists diff --git a/src/packaging/rpm/init.d/fess b/src/packaging/rpm/init.d/fess index dc95fb9f6..de31d659c 100644 --- a/src/packaging/rpm/init.d/fess +++ b/src/packaging/rpm/init.d/fess @@ -56,7 +56,6 @@ export FESS_DICTIONARY_PATH export FESS_HEAP_SIZE export ES_HOME export ES_HTTP_URL -export ES_TRANSPORT_URL export FESS_JAVA_OPTS export JAVA_HOME