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

How can I connect remote solrCloud with solrJ? #9

Open
zhangddjs opened this issue Jun 17, 2020 · 6 comments
Open

How can I connect remote solrCloud with solrJ? #9

zhangddjs opened this issue Jun 17, 2020 · 6 comments
Labels

Comments

@zhangddjs
Copy link

When I try to connect solrCloud with solrJ using host ip, I found that the livenodes' ip is always the containers' ip, obviously, unreachable.
How can I connect solrCloud from a remote java client?

@dsmiley
Copy link
Contributor

dsmiley commented Jun 17, 2020

I believe you have to set the SOLR_HOST env var to a client accessible hostname, and this should wind up in livenodes in ZK.

@zhangddjs
Copy link
Author

okay~ I set the Solr_Host and DNS, then it succeed.

solr4:
    image: solr:7.5
    container_name: solr4
    ports:
     - "30008:30008"
    environment:
      - ZK_HOST=solr-zk1:2181,solr-zk2:2181,solr-zk3:2181
      - SOLR_PORT=30008
      - SOLR_HOST=dev.covfefe.com
    extra_hosts:
      - dev.covfefe.com:10.100.13.173
    networks:
      - solr-cloud
    depends_on:
      - solr-zk1
      - solr-zk2
      - solr-zk3

@jasi110
Copy link

jasi110 commented Jul 22, 2020

I'm new to this and have been trying to do similar with no luck. How did you know the IP to enter on the right of the extra_hosts statement before the containers come up? That IP is the container IP, right? Then you need to add the dev.covfefe.com host to the network outside of the containers so that your solrj host can resolve it?
Thanks.

@zhangddjs
Copy link
Author

Nope, that IP is the host's IP, not the container's.

@jasi110
Copy link

jasi110 commented Jul 23, 2020

It’s working for me now.
Thank you so much!

@zhangddjs
Copy link
Author

wel~~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants