添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

Optimize application is throwing error while starting when it is connected to an ES cluster with xpack basic authentication is configured. It fails to connect with ES. I have deployed Optmize using helm charts and so tried with the below enviroment variables.

OPTIMIZE_ELASTICSEARCH_USERNAME
OPTIMIZE_ELASTICSEARCH_PASSWORD

Still it gives the below error

Suppressed: org.elasticsearch.client.ResponseException: method [GET], host [http://elasticsearch-master:9200], URI [/_cluster/health?master_timeout=30s&level=cluster&timeout=30s], status line [HTTP/1.1 401 Unauthorized]
{"error":{"root_cause":[{"type":"security_exception","reason":"missing authentication credentials for REST request [/_cluster/health?master_timeout=30s&level=cluster&timeout=30s]","header":{"WWW-Authenticate":"Basic realm=\"security\" charset=\"UTF-8\""}}],"type":"security_exception","reason":"missing authentication credentials for REST request [/_cluster/health?master_timeout=30s&level=cluster&timeout=30s]","header":{"WWW-Authenticate":"Basic realm=\"security\" charset=\"UTF-8\""}},"status":401}

Optimize version: 3.9.4
Camunda version: 8.1.9
ES Version: 7.17.9

According to this, you would configure your ES connection auth:

ES_SECURITY_USERNAME=abc
ES_SECURITY_PASSWORD=xyz

I hope this helps

Jonathan

Hello Jonathan,

Thanks for the reply, I have tried the same env. variables however still I got the authentication error. Please see below.

09:54:55.995 [main] INFO o.c.o.s.e.OptimizeElasticsearchClientFactory - Initializing Elasticsearch rest client…
09:54:56.725 [main] DEBUG o.c.o.u.e.ElasticsearchHighLevelRestClientBuilder - Elasticsearch username and password not provided, skipping connection credential setup.
09:54:58.126 [main] ERROR o.c.o.s.e.OptimizeElasticsearchClientFactory - Can’t connect to any Elasticsearch node [[host=http://elasticsearch-master:9200]]. Please check the connection!
org.elasticsearch.ElasticsearchStatusException: Elasticsearch exception [type=security_exception, reason=missing authentication credentials for REST request [/_cluster/health?master_timeout=30s&level=cluster&timeout=30s]]

Hello Jonathan,

Any other way that we can provide the ElasticSearch username and password to Optimize?. In the debug log we can see that since the username and password not provided the Optimize is skipping the connection credential setup.
09:54:56.725 [main] DEBUG o.c.o.u.e.ElasticsearchHighLevelRestClientBuilder - Elasticsearch username and password not provided, skipping connection credential setup.

So the variables we provided is not accepting.

Hello @krishnakumar797 ,

could you try to set any other variable to prove configuration works in general?

jonathan

Yes @jonathan.lukas , the following env. variable is working which provides the ES host name as below
OPTIMIZE_ELASTICSEARCH_HOST
OPTIMIZE_ELASTICSEARCH_HTTP_PORT
these works well.

Please see this file