On 10/23/2023 8:18 AM, David Filip wrote:
In theory I guess I could bind Solr only to the Ethernet network (it currently
binds to 0.0.0.0, a.k.a. all network interfaces), but then I would need to set
up a separate proxy from my WiFi network to each of the Solr servers, which I
would rather not do. So is it possible to control which network interface Solr
binds to for inter-server communication, while leaving other network interfaces
open to queries?
See this section from the stock solr.xml file:
<solrcloud>
<str name="host">${host:}</str>
<int name="hostPort">${solr.port.advertise:0}</int>
<str name="hostContext">${hostContext:solr}</str>
These define how each Solr node registers itself in the clusterstate
info that can be found in ZK. They reference Java system properties.
This controls how each Solr server is reached by the others.
With that, you can use "-Dhost=1.2.3.4" and "-DhostPort=8983" on the
Solr commandline. This is probably easiest by adding a line like the
following to solr.in.sh, which is found in /etc/default if the service
installer script was used. If you're on Windows, then it would be
solr.in.cmd and it would look different:
SOLR_ADDL_ARGS="-Dhost=1.2.3.4 -DhostPort=8983"
Don't change the hostContext. Many parts of Solr are hardcoded to use
/solr and if you ask Jetty to change that, you'll have a lot of problems
that require quite a bit of manual surgery to fix. This is legacy stuff
left over from much older versions where it was actually possible to
change the context without breaking things.
Alternately you could just edit the solr.xml, but it is cleaner to use
the system properties. If you edit the file directly, then every server
would have a different solr.xml config.
Thanks,
Shawn