On 5/22/24 10:23, Jorge Sánchez Briantes wrote:
Due to Plesk requirements, if you need Solr and Zookeeper in the same web server, they must be installed on a Docker container. I have deployed it and I have a fresh Solr 9.6, and Zookeeper 3.9.2., running. I have readthis page <https://solr.apache.org/guide/solr/latest/ deployment-guide/solr-in-docker.html>about Solr in Docker, but It doesn't clarify me the next questions:

I don't know anything about plesk. I know what it is, but I have never actually used it.

I also don't know much about how the internals of the solr docker image work, but I am not completely clueless.

1.

    After install it, I can't open Solr admin page, neither from
    https://public_machine_ip:8983/Solr/Admin nor from ssh terminal via
    wget to https://localhost:8983/Solr/Admin. It always gets connection
    refused, but my firewall (Plesk) allow this port.

Do not expose Solr directly to the Internet.  This is just a bad idea.

Getting connection refused most likely means that the traffic made it through the firewall but that there was nothing listening on that port. As I note below, I think that on the docker host, you would reach Solr on port 32774, not 8983.

Some firewalls will block a connection with 'refused' but most just drop the traffic.

2.

    I want Solr can only be accessed by local pages. I have set
    SOLR_JETTY_HOST and SOLR_ZK_EMBEDDED_HOST variables to 127.0.0.1.,
    and I restarted both containers.

Solr 9.x defaults to only being accessible by localhost, though I think the docker container changes that to 0.0.0.0 because the way docker works means the connection will not be coming from localhost, it will be coming from the docker network that runs on the docker host. You should probably remove at least the SOLR_JETTY_HOST environment variable and let the Solr docker container handle those. I don't know if SOLR_ZK_EMBEDDED_HOST needs to be there or not. I have never used it, but I do not run Solr in docker.

If I run "docker ps" I get the next result:

solr 127.0.0.1:32774->8983/tcp

zookeeper 127.0.0.1:32771->2181/tcp,.... <some other ports>

This would seem to indicate that although Solr runs inside the container on port 8983, that it listens on the docker host on port 32774, and I *think* that on the docker host, that only listens on localhost.

It looks like docker is also forwarding port 32771 to the ZK container on port 2181. I am not sure whether Solr would need to connect to ZK on port 32771 or not. You would probably be able to connect it to the ZK container's internal address on 2181.


I am guessing that from the docker host, you would use "http://localhost:32774"; to reach the admin UI.

Thanks,
Shawn

Reply via email to