Problem with elasticsearch when deploying liferay ce 7.4 in kubernetes

1.2k views Asked by At

I'm trying to deploy liferay ce 7.4 in kubernetes and I can't connect elasticsearch 7.14.0. I get the following error:

2022-03-19 20:06:29.375 ERROR [main][ElasticsearchEngineConfigurator:93] bundle com.liferay.portal.search.elasticsearch7.impl:6.0.30 (1134)[com.liferay.portal.search.elasticsearch7.internal.ElasticsearchEngineConfigurator(3789)] : The activate method has thrown an exception
java.lang.RuntimeException: org.elasticsearch.ElasticsearchException: ElasticsearchException[java.util.concurrent.ExecutionException: java.net.ConnectException: Timeout connecting to [search/10.110.10.150:9200]]; nested: ExecutionException[java.net.ConnectException: Timeout connecting to [search/10.110.10.150:9200]]; nested: ConnectException[Timeout connecting to [search/10.110.10.150:9200]];
     at org.elasticsearch.client.RestHighLevelClient.performClientRequest(RestHighLevelClient.java:2078) ~[?:?]
     at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1732) ~[?:?]
     at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:1702) ~[?:?]
     at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:1672) ~[?:?]
     at org.elasticsearch.client.ClusterClient.health(ClusterClient.java:119) ~[?:?]
     at com.liferay.portal.search.elasticsearch7.internal.search.engine.adapter.cluster.HealthClusterRequestExecutorImpl._getClusterHealthResponse(HealthClusterRequestExecutorImpl.java:112) ~[?:?]

I have verified that the elasticsearch is correctly deployed by running: kubectl port-forward search-59fcc9c4f6-brhcv 9200

My file com.liferay.portal.search.elasticsearch7.configuration.ElasticsearchConfiguration.config:

additionalConfigurations=""
additionalIndexConfigurations=""
additionalTypeMappings=""
authenticationEnabled="false"
bootstrapMlockAll="false"
clusterName="LiferayElasticsearchCluster"
discoveryZenPingUnicastHostsPort="9300-9400"
embeddedHttpPort="9200"
httpCORSAllowOrigin="/https?:\\/\\/localhost(:[0-9]+)?/"
httpCORSConfigurations=""
httpCORSEnabled="true"
httpSSLEnabled="false"
indexNamePrefix="liferay-"
indexNumberOfReplicas=""
indexNumberOfShards=""
logExceptionsOnly="true"
networkBindHost=""
networkHost=""
networkHostAddresses=[ \
  "", \
  ]
networkPublishHost=""
nodeName=""
operationMode="REMOTE"
overrideTypeMappings=""
productionModeEnabled="true"
proxyHost=""
proxyPort="0"
proxyUserName=""
remoteClusterConnectionId="RemoteElasticSearchCluster"
restClientLoggerLevel="ERROR"
sidecarDebug="false"
sidecarDebugSettings="-agentlib:jdwp\=transport\=dt_socket,address\=8001,server\=y,suspend\=y,quiet\=y"
sidecarHeartbeatInterval="10000"
sidecarHome="elasticsearch7"
sidecarHttpPort=""
sidecarJVMOptions=[ \
  "-Xms1g", \
  "-Xmx1g", \
  "-XX:+AlwaysPreTouch", \
  ]
sidecarShutdownTimeout="10000"
trackTotalHits="true"
transportTcpPort=""
truststorePath="/path/to/localhost.p12"
truststoreType="pkcs12"
username="elastic"

And my file com.liferay.portal.search.elasticsearch7.configuration.ElasticsearchConnectionConfiguration.config:

active="true"
authenticationEnabled="false"
connectionId="RemoteElasticSearchCluster"
httpSSLEnabled="false"
networkHostAddresses=[ \
  "search:9200" \
  ]
proxyHost=""
proxyPort="0"
proxyUserName=""
truststorePath="/path/to/localhost.p12"
truststoreType="pkcs12"
username="elastic"

To configure the elasticsearch connector I followed the page: http://www.liferaysavvy.com/2021/07/configure-remote-elasticsearch-cluster.html and https://liferay.dev/blogs/-/blogs/deploying-liferay-7-3-in-kubernetes

Someone could help me? Thanks in advance.

0

There are 0 answers