Hi,

I'm trying trying to set up a single node Solr cloud cluster in docker-compose 
and create a collection on startup. 

Even though I'm using Solr 8.11.2, I'm following "Solr in Docker" instructions 
from Solr 9.1 reference guide.
(I believe that's fine and there are not many changes between 8 and 9 in that 
regard.)

Since the docker-compose file I'm working on is meant for developers' 
convenience I want to define the absolute minimum setup that gets me what I 
want. For creating collections I'm going with 3rd option of this guide:
https://solr.apache.org/guide/solr/latest/deployment-guide/solr-in-docker.html#creating-collections
Which suggests running `solr create_collection` from a separate container.

This is illustrated by this docker-compose file:
https://gist.github.com/makuk66/0812f70b77aa92230c203cec41acac64#file-docker-compose-yml-L64-L76

The problems start as soon as I change that setup to a single-node Solr cluster 
(consisting of only solr1 node) with Zookeeper embedded.
In that case, `create_collection` tries to connect to localhost:9983 (an 
address it gets from solr1 Solr I believe). That address of course is not 
reachable on the create-collection host:

> Connecting to ZooKeeper at localhost:9983 ...
> INFO  - 2023-02-05 15:20:30.865; 
> org.apache.solr.common.cloud.ConnectionManager; Waiting for client to connect 
> to ZooKeeper
> ERROR: java.util.concurrent.TimeoutException: Could not connect to ZooKeeper 
> localhost:9983 within 15000 ms

Does anyone know if there is a workaround for this problem?

Best,
Tomasz

Reply via email to