Accessing Solr collections at different ports

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Accessing Solr collections at different ports

Salmaan Rashid Syed
Hi Solr Users,

I am using Solr 7.6 in cloud mode with external zookeeper installed at ports 2181, 2182, 2183. Currently we have only one server allocated for Solr. We are planning to move to multiple servers for better sharing, replication etc in near future.

Now the issue is that, our organisation has data indexed for different clients as separate collections. We want to uniquely access, update and index each collection separately so that each individual client has access to their respective collections at their respective ports. Eg:— Collection1 at port 8983, Collection2 at port 8984, Collection3 at port 8985 etc.

I have two options I guess, one is to run Solr in cloud mode with 4 nodes (max as limited by Solr) at 4 different ports. I don’t know how to go beyond 4 nodes/ports in this case.

The other option is to run Solr as service and create multiple copies of Solr folder within the Server folder and access each Solr at different port with its own collection as shown by https://www.youtube.com/watch?v=wmQFwK2sujE <https://www.youtube.com/watch?v=wmQFwK2sujE>

I am really confused as to which is the better path to choose. Please help me out.

Thanks.

Regards,
Salmaan
Reply | Threaded
Open this post in threaded view
|

Re: Accessing Solr collections at different ports

Shawn Heisey-2
On 5/2/2019 11:47 PM, Salmaan Rashid Syed wrote:
> I am using Solr 7.6 in cloud mode with external zookeeper installed at ports 2181, 2182, 2183. Currently we have only one server allocated for Solr. We are planning to move to multiple servers for better sharing, replication etc in near future.
>
> Now the issue is that, our organisation has data indexed for different clients as separate collections. We want to uniquely access, update and index each collection separately so that each individual client has access to their respective collections at their respective ports. Eg:— Collection1 at port 8983, Collection2 at port 8984, Collection3 at port 8985 etc.

This is not something you can do with a single instance of Solr.

> I have two options I guess, one is to run Solr in cloud mode with 4 nodes (max as limited by Solr) at 4 different ports. I don’t know how to go beyond 4 nodes/ports in this case.

There are no limits to the number of nodes.  I know people are running
SolrCloud clusters with hundreds of nodes.  And there might be some out
there with thousands ... although if those exist, they're really pushing
the limits.

> The other option is to run Solr as service and create multiple copies of Solr folder within the Server folder and access each Solr at different port with its own collection as shown by https://www.youtube.com/watch?v=wmQFwK2sujE <https://www.youtube.com/watch?v=wmQFwK2sujE>

If you have multiple Solr nodes in a single cluster, you can access any
collection from any node.  This will probably present a security problem
for you.  Even if the receiving node doesn't have any of the
collection's data, SolrCloud will proxy the connection over to the nodes
that DO have that data.

If you give each Solr node (instance) a different chroot on its zkHost
string, then each one would be a completely separate cluster from all
the others, and you can run them all in one zookeeper ensemble.  Each
one would have zkHost strings that look something like this:

zk1.example.com:2181,zk2.example.com:2181,zk3.example.com/solr1
zk1.example.com:2181,zk2.example.com:2181,zk3.example.com/solr2
zk1.example.com:2181,zk2.example.com:2181,zk3.example.com/solr3
zk1.example.com:2181,zk2.example.com:2181,zk3.example.com/solr4

You'll need to find the section in the documentation that talks about
creating a chroot in ZK.

I think that would give you what you're after.

It's probably easiest to set up each Solr instance in its own directory,
not try to run multiple services out of one installation directory.  The
entire extracted archive is less than 200MB ... tiny by modern standards.

Thanks,
Shawn
Reply | Threaded
Open this post in threaded view
|

Re: Accessing Solr collections at different ports

Erick Erickson
In reply to this post by Salmaan Rashid Syed
This is not true. You can run as many separate JVMs on a single physical machine as you have available ports. There’s no capability to address a Solr _collection_ in the _same_ JVM by a different port though.

But what you didn’t mention is having separate collections per client. A single Solr instance (defined by a running JVM) can host a number of different collections. So you have URLS like
<a href="http://some_sever:port/solr/collection1/query">http://some_sever:port/solr/collection1/query
<a href="http://some_sever:port/solr/collection2/query">http://some_sever:port/solr/collection2/query

Now you restrict the URLs available to client1 to collection1, client2 to collection2 etc.

Best,
Erick

> On May 3, 2019, at 1:47 AM, Salmaan Rashid Syed <[hidden email]> wrote:
>
> Solr in cloud mode with 4 nodes (max as limited by Solr) at 4 different ports