cancel
Showing results for 
Search instead for 
Did you mean: 

how to config custom solr port while alfresco 6.2 installation using docker-compose.yml

Aswani_Juvva
Confirmed Champ
Confirmed Champ

Hi,

I want to change the default port of solr 8983 to custom port. I have tried to change this in docker.compose.yml file but it didn't work. 

services:
alfresco:

build:
dockerfile: ./DockerFile
context: ./configs-to-override/alfresco
mem_limit: 1500m
environment:
JAVA_OPTS: "
-Ddb.driver=org.postgresql.Driver
-Ddb.username=alfresco
-Ddb.password=alfresco
-Ddb.url=jdbcSmiley Tongueostgresql://postgres:5454/alfresco
-Dsolr.host=solr6
-Dsolr.port=8983


solr6:
image: alfresco/alfresco-search-services:1.4.0
mem_limit: 2g
environment:
#Solr needs to know how to register itself with Alfresco
- SOLR_ALFRESCO_HOST=alfresco
- SOLR_ALFRESCO_PORT=7080
#Alfresco needs to know how to call solr
- SOLR_SOLR_HOST=solr6
- SOLR_SOLR_PORT=8983
#Create the default alfresco and archive cores
- SOLR_CREATE_ALFRESCO_DEFAULTS=alfresco,archive
#HTTP by default
- ALFRESCO_SECURE_COMMS=none
- "SOLR_JAVA_MEM=-Xms2g -Xmx2g"
ports:
- 8083:8983 #Browser port

2 REPLIES 2

abhinavmishra14
World-Class Innovator
World-Class Innovator

Changing solr port needs similar type of approach as provided in this post: https://javaworld-abhinav.blogspot.com/2020/07/change-alfresco-share-proxy-and-db.html

Port 8983 is default port for alfresco-search-service and it is exposed within the image. So even if you change the 'ports' configuration in docker-compose.yml, you would notice that solr6 still runs on 8983 port and alfresco will fail to connect to solr6 if 'solr.port' value is updated to anything else. Below log indicates the port for solr6 at startup.

INFO  (main) [   ] o.a.s.s.SolrDispatchFilter / __| ___| |_ _   Starting in standalone mode on port 8983

You can either use docker-compose.yml file to add an environment variable which alfresco-search-service's jetty server uses or update the startup script or update shared.properties with help of DockerFile. 

To change the solr port you need to follow these instructions:

- Update following properties in 'JAVA_OPTS' section under 'alfresco' service defintion. E.g. 9999 is your custom port.

 -Dsolr.port=9999

- Update following variable in 'environment' section under 'solr6' service defintion. E.g. 9999 is your custom port.

#Alfresco needs to know how to call solr
- SOLR_SOLR_PORT=9999

- Add following variable in 'environment' section under 'solr6' service defintion. E.g. 9999 is your custom port.

 #Solr jetty port, to start solr6 on port 9999
 - SOLR_PORT=9999

- Update port number in 'ports' section under 'solr6' service defintion. E.g. 9999 is your custom port.

ports:
  - 8083:9999 
~Abhinav
(ACSCE, AWS SAA, Azure Admin)

Hi Abhinav,

I am using distribution zip way, my custom solr port is 9983.

But somewhere when I start, it is still picking 8983 from somewhere. not able to start service.

we stopped service for our custom port (some other app using solr6 on 8983 already , their service running)

Error binding ShutdownMonitor to port 8983: java.net.BindException: Address already in use: NET_Bind

  • port changed in alfresco-global.properties file
  • port changed in solr.in.cmd file
  • port changed in solrcore.properties file

let me know if anything else remain. it is not starting.

we are using alfresco-7.3.1 distribution zip on windows 10 with postgres db

Thanks

Ghanshyam