-
Notifications
You must be signed in to change notification settings - Fork 58
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
Update example to demonstrate using Hostname? #5
Comments
I confirmed that if you set the
You get this stack trace when you try to create a collection, or otherwise communicate around the cluster:
|
If I jump on on of the Solrs, I can do
|
Much messing around with |
That's what the ports are for. For example, this line https://github.com/docker-solr/docker-solr-examples/blob/master/docker-compose/docker-compose.yml#L16 has:
which opens port 8981 on the host, to forward to port 8983 on the container named "solr1". So, if you want to run your JDBC tool on the host, just tell it to talk to Solr on http://ip-of-host:8981/. Or am I missing some other requirements of your JDBC access? |
Thanks @makuk66 for weighing in. Your are correctly right on the "run your JDBC tool" instruction! However, what I am finding is that with the Docker setup, if I provide a However, you can do it externally! What I can't quite figure out is how to make the ip-of-host be an accessible ip from the external to the Host perspective AND internal to the host! I can get one or the other. I've thought about trying to modify the Is that clearer? |
If I recall correctly, the SOLR_HOST variable is used to determine the address of the node when it registers with ZooKeeper; in which case changing that seems unwise.
Are you running on MacOS or Linux? Some details differ. On MacOS you can do:
I'm still not clear what you are actually trying to do. You want to use JDBC -- where is your DB running; on the host or in a container or somewhere else? And how are you using JDBC? Are you wanting to push into Solr from the host (in which case, use the forwarded ports), or do you want to push into Solr from the containers (in which case, use the container name |
Okay, I think when I say "JDBC" I'm confusing things, my apologies! So, I am trying to use the Solr JDBC driver (https://lucene.apache.org/solr/guide/8_4/solr-jdbc-apache-zeppelin.html) in Zeppelin with my Solr Cloud setup. I should have said "solrcloud-aware" client ;-) I figured out how to make the DNS name the same from both inside the container and from outside:
This is some hackery, as when the container tries to access Not sure if this is something more generalizable... |
so smart! |
hello, when I used this config and adding a collection, it appeared time out exception because of connection to hostname:other_node_port failure. OR connect refused 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 and now I can connect the solrCloud with solrJ. Thanks. |
I tried out the demo at https://github.com/docker-solr/docker-solr-examples/blob/master/docker-compose/docker-compose.yml hoping it would help me with my
SOLR_HOST
difficulties.The issue with Docker is that the hosts are all internal to the network, not externally accessible. Which means features like the JDBC access to Solr fail, because the Solr client can't access those internal addresses from an external location.
I was hoping this example could demonstrate how to use a SOLR_HOST property to use the externally addressable address.
The text was updated successfully, but these errors were encountered: