Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OPSEXP-1717 Add Elasticsearch connector to docker-compose #769

Merged
merged 6 commits into from
Sep 14, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ repos:
rev: v2.1.0
hooks:
- id: docker-compose-check
exclude: override-docker-compose.yml
- repo: https://github.com/bridgecrewio/checkov.git
rev: 2.0.1211
hooks:
Expand Down
61 changes: 61 additions & 0 deletions docker-compose/elasticsearch-override-docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
version: "2"

services:
alfresco:
environment:
JAVA_OPTS: "
-Ddb.driver=org.postgresql.Driver
-Ddb.username=alfresco
-Ddb.password=alfresco
-Ddb.url=jdbc:postgresql://postgres:5432/alfresco
-Dindex.subsystem.name=elasticsearch
-Delasticsearch.createIndexIfNotExists=true
-Delasticsearch.host=elasticsearch
-Delasticsearch.port=9200
-Dshare.host=127.0.0.1
-Dshare.port=8080
-Dalfresco.host=localhost
-Dalfresco.port=8080
-Daos.baseUrlOverwrite=http://localhost:8080/alfresco/aos
-Dmessaging.broker.url=\"failover:(nio://activemq:61616)?timeout=3000&jms.useCompression=true\"
-Ddeployment.method=DOCKER_COMPOSE
-Dtransform.service.enabled=true
-Dtransform.service.url=http://transform-router:8095
-Dsfs.url=http://shared-file-store:8099/
-DlocalTransform.core-aio.url=http://transform-core-aio:8090/
-Dcsrf.filter.enabled=false
-Ddsync.service.uris=http://localhost:9090/alfresco
-XX:MinRAMPercentage=50 -XX:MaxRAMPercentage=80
"
elasticsearch:
image: elasticsearch:7.10.1
environment:
- xpack.security.enabled=false
- discovery.type=single-node
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
cap_add:
- IPC_LOCK
ports:
- 9200:9200
- 9300:9300

search:
image: quay.io/alfresco/alfresco-elasticsearch-live-indexing:3.1.0
depends_on:
- elasticsearch
- alfresco
environment:
SPRING_ELASTICSEARCH_REST_URIS: http://elasticsearch:9200
SPRING_ACTIVEMQ_BROKERURL: nio://activemq:61616
ALFRESCO_SHAREDFILESTORE_BASEURL: http://shared-file-store:8099/alfresco/api/-default-/private/sfs/versions/1/file/

# Disable the default solr6 service
solr6:
image: alpine:latest
command: "true"
22 changes: 16 additions & 6 deletions docs/docker-compose/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ As well as the prerequisites mentioned on the [main README](/README.md#prerequis

## Configure Docker for Desktop

In order to deploy onto Docker for Desktop we need to allocate at least [13 Gb](../../docker-compose/docker-compose.yml) (preferably 16 Gb) to the Docker Engine on the "Resources" tab in Docker for Desktop's preferences pane as shown in the screenshot below. This is required because insufficient memory will cause containers to exit without warning.
In order to deploy onto Docker for Desktop we need to allocate at least [13 Gb](../../docker-compose/docker-compose.yml) (preferably 16 Gb) to the Docker Engine on the "Resources" tab in Docker for Desktop's preferences pane as shown in the screenshot below. This is required because insufficient memory will cause containers to exit without warning.

![Resources](../../docs/helm/diagrams/dfd-resources.png)

Expand All @@ -44,7 +44,15 @@ In order to deploy onto Docker for Desktop we need to allocate at least [13 Gb](
* Default username and password is ```admin```
* See [Uploading a new license](https://docs.alfresco.com/content-services/latest/admin/license/#uploadlicense) for more details

### Notes
### Search Enterprise 3.0 (Elasticsearch)

You can provision the latest Alfresco with the new search subsystem based on Elasticsearch rather than solr with:

```bash
docker-compose -f docker-compose.yml -f elasticsearch-override-docker-compose.yml up -d
```

### Troubleshooting

Make sure that exposed ports are open on your host. Check the _docker-compose.yml_ file to determine the exposed ports - refer to the ```host:container``` port definitions. You'll see they include 5432, 8080, 8083 and others.

Expand Down Expand Up @@ -299,15 +307,17 @@ docker-compose down

## Troubleshooting

If you have issues running ```docker-compose up``` after deleting a previous Docker Compose cluster, try replacing step 4 with the following command:
If you have issues running `docker-compose up` after deleting a previous Docker Compose cluster, try replacing step 4 with the following command:

```bash
docker-compose down && docker-compose build --no-cache && docker-compose up
```

If you are experiencing issues running ```docker-compose up``` on Windows environments due to unavailable or reserved ports and get errors such as:
``` bind: An attempt was made to access a socket in a way forbidden by its access permissions``` would mean that Windows winnat service has reserved
the port range that docker compose is trying to use. To remedy the issue execute the following in a terminal:
If you are experiencing issues running `docker-compose up` on Windows environments due to unavailable or reserved ports and get errors such as:

> bind: An attempt was made to access a socket in a way forbidden by its access permissions

would mean that Windows winnat service has reserved the port range that docker compose is trying to use. To remedy the issue execute the following in a terminal:

```bash
net stop winnat
Expand Down