When using the Elasticsearch server with the HTTP Basic Authentication protocol you must add your Elasticsearch credentials to the alfresco-global.properties configuration file.
elasticsearch.user=elastic elasticsearch.password=bob123
Additionally, for every “live-indexing” service from the Elasticsearch connector the same credentials must be configured. Use Java and the following global properties:
SPRING_ELASTICSEARCH_REST_USERNAME=elastic SPRING_ELASTICSEARCH_REST_PASSWORD=bob123
The environment variables can be passed as a command line argument when running the Spring boot application locally or they can be added to the environment service section when using Docker Compose. The example above connects to an Elasticsearch server configured with the following values:
elasticsearch:
image: elasticsearch:7.10.2
environment:
- discovery.type=single-node
- xpack.security.enabled=true
- ELASTIC_PASSWORD=bob123
You must also add these credentials to the Kibana app.
kibana:
image: kibana:7.10.1
environment:
- ELASTICSEARCH_HOSTS=http://elasticsearch:9200
- ELASTICSEARCH_USERNAME=elastic
- ELASTICSEARCH_PASSWORD=bob123