You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Aman Tandon <am...@gmail.com> on 2015/03/03 12:21:50 UTC

How to start solr in solr cloud mode using external zookeeper ?

Hi,

I am new to solr-cloud, i have connected the zookeepers located on 3 remote
servers. All the configs are uploaded and linked successfully.

Now i am stuck to how to start solr in cloud mode using these external
zookeeper which are remotely located.

Zookeeper is installed at 3 servers and using the 2181 as client port. ON
all three server, solr server along with external zookeeper is present.

solrcloud1.com (solr + zookeper is present)
solrcloud2.com
solrcloud3.com

Now i have to start the solr by telling the solr to use the external
zookeeper. So how should I do that.

Thanks in advance.

With Regards
Aman Tandon

Re: How to start solr in solr cloud mode using external zookeeper ?

Posted by Tomoko Uchida <to...@gmail.com>.
Hi,

Did you check "SolrCloud" section in Ref Guides? You can download PDFs from
here.
http://archive.apache.org/dist/lucene/solr/ref-guide/

Or this. (It's already marked out of date, but still provides basic,
helpful information.)
https://wiki.apache.org/solr/SolrCloud

Regards,
Tomoko



2015-03-03 20:21 GMT+09:00 Aman Tandon <am...@gmail.com>:

> Hi,
>
> I am new to solr-cloud, i have connected the zookeepers located on 3 remote
> servers. All the configs are uploaded and linked successfully.
>
> Now i am stuck to how to start solr in cloud mode using these external
> zookeeper which are remotely located.
>
> Zookeeper is installed at 3 servers and using the 2181 as client port. ON
> all three server, solr server along with external zookeeper is present.
>
> solrcloud1.com (solr + zookeper is present)
> solrcloud2.com
> solrcloud3.com
>
> Now i have to start the solr by telling the solr to use the external
> zookeeper. So how should I do that.
>
> Thanks in advance.
>
> With Regards
> Aman Tandon
>

Re: How to start solr in solr cloud mode using external zookeeper ?

Posted by Aman Tandon <am...@gmail.com>.
yes it might, but I don't wants to depend on servlet container because
after few release solr will not support any servlet container. So i am
sticking with the command line utilities.

With Regards
Aman Tandon

On Fri, Mar 6, 2015 at 3:58 PM, Rajesh Hazari <ra...@gmail.com>
wrote:

> zkhost=hostnames,
> port=some port
> variables in your solr.xml should work?
> I have tested this with tomcat not with jetty, this stays with your config.
>
> Rajesh.
> On Mar 5, 2015 9:20 PM, "Aman Tandon" <am...@gmail.com> wrote:
>
> > Thanks shamik :)
> >
> > With Regards
> > Aman Tandon
> >
> > On Fri, Mar 6, 2015 at 3:30 AM, shamik <sh...@gmail.com> wrote:
> >
> > > The other way you can do that is to specify the startup parameters in
> > > solr.in.sh.
> > >
> > > Example :
> > >
> > > SOLR_MODE=solrcloud
> > >
> > > ZK_HOST="zoohost1:2181,zoohost2:2181,zoohost3:2181"
> > >
> > > SOLR_PORT=4567
> > >
> > > You can simply start solr by running "./solr start"
> > >
> > >
> > >
> > > --
> > > View this message in context:
> > >
> >
> http://lucene.472066.n3.nabble.com/How-to-start-solr-in-solr-cloud-mode-using-external-zookeeper-tp4190630p4191286.html
> > > Sent from the Solr - User mailing list archive at Nabble.com.
> > >
> >
>

Re: How to start solr in solr cloud mode using external zookeeper ?

Posted by Rajesh Hazari <ra...@gmail.com>.
zkhost=hostnames,
port=some port
variables in your solr.xml should work?
I have tested this with tomcat not with jetty, this stays with your config.

Rajesh.
On Mar 5, 2015 9:20 PM, "Aman Tandon" <am...@gmail.com> wrote:

> Thanks shamik :)
>
> With Regards
> Aman Tandon
>
> On Fri, Mar 6, 2015 at 3:30 AM, shamik <sh...@gmail.com> wrote:
>
> > The other way you can do that is to specify the startup parameters in
> > solr.in.sh.
> >
> > Example :
> >
> > SOLR_MODE=solrcloud
> >
> > ZK_HOST="zoohost1:2181,zoohost2:2181,zoohost3:2181"
> >
> > SOLR_PORT=4567
> >
> > You can simply start solr by running "./solr start"
> >
> >
> >
> > --
> > View this message in context:
> >
> http://lucene.472066.n3.nabble.com/How-to-start-solr-in-solr-cloud-mode-using-external-zookeeper-tp4190630p4191286.html
> > Sent from the Solr - User mailing list archive at Nabble.com.
> >
>

Re: How to start solr in solr cloud mode using external zookeeper ?

Posted by Aman Tandon <am...@gmail.com>.
Thanks shamik :)

With Regards
Aman Tandon

On Fri, Mar 6, 2015 at 3:30 AM, shamik <sh...@gmail.com> wrote:

> The other way you can do that is to specify the startup parameters in
> solr.in.sh.
>
> Example :
>
> SOLR_MODE=solrcloud
>
> ZK_HOST="zoohost1:2181,zoohost2:2181,zoohost3:2181"
>
> SOLR_PORT=4567
>
> You can simply start solr by running "./solr start"
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/How-to-start-solr-in-solr-cloud-mode-using-external-zookeeper-tp4190630p4191286.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Re: How to start solr in solr cloud mode using external zookeeper ?

Posted by shamik <sh...@gmail.com>.
The other way you can do that is to specify the startup parameters in
solr.in.sh. 

Example :

SOLR_MODE=solrcloud

ZK_HOST="zoohost1:2181,zoohost2:2181,zoohost3:2181"

SOLR_PORT=4567

You can simply start solr by running "./solr start"



--
View this message in context: http://lucene.472066.n3.nabble.com/How-to-start-solr-in-solr-cloud-mode-using-external-zookeeper-tp4190630p4191286.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: How to start solr in solr cloud mode using external zookeeper ?

Posted by Aman Tandon <am...@gmail.com>.
Thanks Erick.

So for the other audience who got stuck in same situation. Here is the
solution.

If you are able to run the remote/local zookeeper ensemble, then you can
create the Solr Cluster by the following method.

Suppose you have an zookeeper ensemble of 3 zookeeper server running on
three different machines which has the IP addresses as :192.168.11.12,
192.168.101.12, 192.168.101.92 and these machines are using the zookeeper
client port as 2181 for every machine (as mentioned in zoo.cfg) and in my
case I am using the solr-5.0.0 version

Now go to the bin directory of your extracted solr tar/zip file and run
this command for each solr server of your SolrCloud cluster.

./solr start -c -z 192.168.11.12:2181,192.168.101.12:2181,
192.168.101.92:2181 -p 4567

-p -> for specifying the another port number other than 8983 in my case it
is 4567
-c -> to start server in cloud mode
-z -> to specifying the zookeeper host address

With Regards
Aman Tandon

On Wed, Mar 4, 2015 at 5:18 AM, Erick Erickson <er...@gmail.com>
wrote:

> Have you seen this page?:
>
> https://cwiki.apache.org/confluence/display/solr/Solr+Start+Script+Reference
>
> This is really "the new way"....
>
> Best,
> Erick
>
> On Tue, Mar 3, 2015 at 7:18 AM, Aman Tandon <am...@gmail.com>
> wrote:
> > Thanks Shawn, also thanks for sharing info about chroot.
> >
> > I am trying to implement the solr cloud with solr-5.0.0.
> >
> > I also checked the documentations https://wiki.apache.org/solr/SolrCloud
> ,
> > the method shown there is using start.jar. But after few update start.jar
> > (jetty) will not work. So I want to go through the way which will work as
> > it is even after upgrade.
> >
> > So how could i start it from bin directory with all these parameters of
> > external zookeeper or any other best way which you can suggest.
> >
> > With Regards
> > Aman Tandon
> >
> > On Tue, Mar 3, 2015 at 8:09 PM, Shawn Heisey <ap...@elyograg.org>
> wrote:
> >
> >> On 3/3/2015 4:21 AM, Aman Tandon wrote:
> >> > I am new to solr-cloud, i have connected the zookeepers located on 3
> >> remote
> >> > servers. All the configs are uploaded and linked successfully.
> >> >
> >> > Now i am stuck to how to start solr in cloud mode using these external
> >> > zookeeper which are remotely located.
> >> >
> >> > Zookeeper is installed at 3 servers and using the 2181 as client
> port. ON
> >> > all three server, solr server along with external zookeeper is
> present.
> >> >
> >> > solrcloud1.com (solr + zookeper is present)
> >> > solrcloud2.com
> >> > solrcloud3.com
> >> >
> >> > Now i have to start the solr by telling the solr to use the external
> >> > zookeeper. So how should I do that.
> >>
> >> You simply tell Solr about all your zookeeper servers on startup, using
> >> the zkHost property.  Here's the format of that property:
> >>
> >> server1:port,server2:port,server3:port/solr1
> >>
> >> The /solr1 part (the ZK chroot) is optional, but I recommend it ... it
> >> can be just about any text you like, starting with a forward slash.
> >> What this does is put all of SolrCloud's information inside a path in
> >> zookeeper, sort of like a filesystem.  With no chroot, that information
> >> is placed at the "root" of zookeeper.  If you want to use a zookeeper
> >> ensemble for multiple applications, you're going to need a chroot.  Even
> >> when multiple applications are not required, I recommend it to keep the
> >> zookeeper root clean.
> >>
> >> You can see some examples of zkHost values in the javadoc for SolrJ:
> >>
> >>
> >>
> http://lucene.apache.org/solr/5_0_0/solr-solrj/org/apache/solr/client/solrj/impl/CloudSolrClient.html#CloudSolrClient%28java.lang.String%29
> >>
> >> Thanks,
> >> Shawn
> >>
> >>
>

Re: How to start solr in solr cloud mode using external zookeeper ?

Posted by Erick Erickson <er...@gmail.com>.
Have you seen this page?:
https://cwiki.apache.org/confluence/display/solr/Solr+Start+Script+Reference

This is really "the new way"....

Best,
Erick

On Tue, Mar 3, 2015 at 7:18 AM, Aman Tandon <am...@gmail.com> wrote:
> Thanks Shawn, also thanks for sharing info about chroot.
>
> I am trying to implement the solr cloud with solr-5.0.0.
>
> I also checked the documentations https://wiki.apache.org/solr/SolrCloud,
> the method shown there is using start.jar. But after few update start.jar
> (jetty) will not work. So I want to go through the way which will work as
> it is even after upgrade.
>
> So how could i start it from bin directory with all these parameters of
> external zookeeper or any other best way which you can suggest.
>
> With Regards
> Aman Tandon
>
> On Tue, Mar 3, 2015 at 8:09 PM, Shawn Heisey <ap...@elyograg.org> wrote:
>
>> On 3/3/2015 4:21 AM, Aman Tandon wrote:
>> > I am new to solr-cloud, i have connected the zookeepers located on 3
>> remote
>> > servers. All the configs are uploaded and linked successfully.
>> >
>> > Now i am stuck to how to start solr in cloud mode using these external
>> > zookeeper which are remotely located.
>> >
>> > Zookeeper is installed at 3 servers and using the 2181 as client port. ON
>> > all three server, solr server along with external zookeeper is present.
>> >
>> > solrcloud1.com (solr + zookeper is present)
>> > solrcloud2.com
>> > solrcloud3.com
>> >
>> > Now i have to start the solr by telling the solr to use the external
>> > zookeeper. So how should I do that.
>>
>> You simply tell Solr about all your zookeeper servers on startup, using
>> the zkHost property.  Here's the format of that property:
>>
>> server1:port,server2:port,server3:port/solr1
>>
>> The /solr1 part (the ZK chroot) is optional, but I recommend it ... it
>> can be just about any text you like, starting with a forward slash.
>> What this does is put all of SolrCloud's information inside a path in
>> zookeeper, sort of like a filesystem.  With no chroot, that information
>> is placed at the "root" of zookeeper.  If you want to use a zookeeper
>> ensemble for multiple applications, you're going to need a chroot.  Even
>> when multiple applications are not required, I recommend it to keep the
>> zookeeper root clean.
>>
>> You can see some examples of zkHost values in the javadoc for SolrJ:
>>
>>
>> http://lucene.apache.org/solr/5_0_0/solr-solrj/org/apache/solr/client/solrj/impl/CloudSolrClient.html#CloudSolrClient%28java.lang.String%29
>>
>> Thanks,
>> Shawn
>>
>>

Re: How to start solr in solr cloud mode using external zookeeper ?

Posted by Aman Tandon <am...@gmail.com>.
Thanks Shawn, also thanks for sharing info about chroot.

I am trying to implement the solr cloud with solr-5.0.0.

I also checked the documentations https://wiki.apache.org/solr/SolrCloud,
the method shown there is using start.jar. But after few update start.jar
(jetty) will not work. So I want to go through the way which will work as
it is even after upgrade.

So how could i start it from bin directory with all these parameters of
external zookeeper or any other best way which you can suggest.

With Regards
Aman Tandon

On Tue, Mar 3, 2015 at 8:09 PM, Shawn Heisey <ap...@elyograg.org> wrote:

> On 3/3/2015 4:21 AM, Aman Tandon wrote:
> > I am new to solr-cloud, i have connected the zookeepers located on 3
> remote
> > servers. All the configs are uploaded and linked successfully.
> >
> > Now i am stuck to how to start solr in cloud mode using these external
> > zookeeper which are remotely located.
> >
> > Zookeeper is installed at 3 servers and using the 2181 as client port. ON
> > all three server, solr server along with external zookeeper is present.
> >
> > solrcloud1.com (solr + zookeper is present)
> > solrcloud2.com
> > solrcloud3.com
> >
> > Now i have to start the solr by telling the solr to use the external
> > zookeeper. So how should I do that.
>
> You simply tell Solr about all your zookeeper servers on startup, using
> the zkHost property.  Here's the format of that property:
>
> server1:port,server2:port,server3:port/solr1
>
> The /solr1 part (the ZK chroot) is optional, but I recommend it ... it
> can be just about any text you like, starting with a forward slash.
> What this does is put all of SolrCloud's information inside a path in
> zookeeper, sort of like a filesystem.  With no chroot, that information
> is placed at the "root" of zookeeper.  If you want to use a zookeeper
> ensemble for multiple applications, you're going to need a chroot.  Even
> when multiple applications are not required, I recommend it to keep the
> zookeeper root clean.
>
> You can see some examples of zkHost values in the javadoc for SolrJ:
>
>
> http://lucene.apache.org/solr/5_0_0/solr-solrj/org/apache/solr/client/solrj/impl/CloudSolrClient.html#CloudSolrClient%28java.lang.String%29
>
> Thanks,
> Shawn
>
>

Re: How to start solr in solr cloud mode using external zookeeper ?

Posted by Shawn Heisey <ap...@elyograg.org>.
On 3/3/2015 4:21 AM, Aman Tandon wrote:
> I am new to solr-cloud, i have connected the zookeepers located on 3 remote
> servers. All the configs are uploaded and linked successfully.
> 
> Now i am stuck to how to start solr in cloud mode using these external
> zookeeper which are remotely located.
> 
> Zookeeper is installed at 3 servers and using the 2181 as client port. ON
> all three server, solr server along with external zookeeper is present.
> 
> solrcloud1.com (solr + zookeper is present)
> solrcloud2.com
> solrcloud3.com
> 
> Now i have to start the solr by telling the solr to use the external
> zookeeper. So how should I do that.

You simply tell Solr about all your zookeeper servers on startup, using
the zkHost property.  Here's the format of that property:

server1:port,server2:port,server3:port/solr1

The /solr1 part (the ZK chroot) is optional, but I recommend it ... it
can be just about any text you like, starting with a forward slash.
What this does is put all of SolrCloud's information inside a path in
zookeeper, sort of like a filesystem.  With no chroot, that information
is placed at the "root" of zookeeper.  If you want to use a zookeeper
ensemble for multiple applications, you're going to need a chroot.  Even
when multiple applications are not required, I recommend it to keep the
zookeeper root clean.

You can see some examples of zkHost values in the javadoc for SolrJ:

http://lucene.apache.org/solr/5_0_0/solr-solrj/org/apache/solr/client/solrj/impl/CloudSolrClient.html#CloudSolrClient%28java.lang.String%29

Thanks,
Shawn