We have a clustered system of Solr (two instances running in two servers) where the quorum is being maintained using zookeeper. We can access Solr by either hitting the direct server URLs or a blanket load balancer URL. We need to whitelist a few IPs accessing these three URLs
I've already tried the steps mentioned here: Restricting IP addresses for Jetty and Solr
and here: http://lucene.472066.n3.nabble.com/How-To-Secure-Solr-by-IP-Address-td4304491.html
The problem with the first approach is that I can't add multiple IPs for whitelisting
The problem with the second approach is although it allows multiple IPs in a string array to be whitelisted, when we are accessing Solr with the load balancer URL, it is not identifying the whitelisted IPs. Only if we hit individual server URLs it's working fine
Also, I tried calling the addWhite method, but that also didn't work and Solr failed to startup.
<New id="IPAccessHandler"
class="org.eclipse.jetty.server.handler.IPAccessHandler">
<Set name="white">
<Array type="String">
<Item>127.0.0.1</Item>
<Item>-.-.-.-|/solr/techproducts/select</Item>
</Array>
</Set>
<Set name="whiteListByPath">false</Set>
<Set name="handler">
<New id="Contexts"
class="org.eclipse.jetty.server.handler.ContextHandlerCollection"/>
</Set>
</New>
This doesn't work with load balancer
<New class="org.eclipse.jetty.server.handler.IPAccessHandler">
<Call name="addWhite">
<Arg>xxx.xxx.xxx.xxx</Arg>
</Call>
<Set name="handler">
<!-- here's where you put what was there before: -->
<New id="Contexts" class="org.eclipse.jetty.server.handler.ContextHandlerCollection"/>
</Set>
</New>
This doesn't allow multiple IPs to be passed as parameter for whitelisting