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 Jamie Johnson <je...@gmail.com> on 2011/09/29 19:59:00 UTC

Automate startup/shutdown of SolrCloud Shards

I am trying to automate the startup/shutdown of SolrCloud shards and
have noticed that there is a bit of a timing issue where if the server
which is to bootstrap ZK with the configs does not complete it's
process (i.e. there is no data at the Conf yet) the other servers will
fail to start.  An obvious solution is to just start the solr instance
responsible for bootstraping first, is there some way that folks are
handling this now?

Re: Automate startup/shutdown of SolrCloud Shards

Posted by Jamie Johnson <je...@gmail.com>.
Something like this would be excellent.  Right now I am starting up
the main server and then doing a wget to see if the server has started
successfully before firing off any secondary servers.  If we could do
what you're saying then everything is much cleaner to do.

On Mon, Oct 3, 2011 at 1:20 AM, Mark Miller <ma...@gmail.com> wrote:
> I could use an easier way to do this myself:
> https://issues.apache.org/jira/browse/SOLR-2805
>
> I'm going to add a main method to ZkController that will make this simpler -
> I've got an early version that works something like: java -classpath .:*
> org.apache.solr.cloud.ZkController 127.0.0.1:9983 127.0.0.1 8983 solr
> /home/mark/workspace/SolrCloud/solr/example/solr/conf conf1
>
>
> On Fri, Sep 30, 2011 at 3:13 PM, Mark Miller <ma...@gmail.com> wrote:
>
>>
>> On Sep 29, 2011, at 1:59 PM, Jamie Johnson wrote:
>>
>> > I am trying to automate the startup/shutdown of SolrCloud shards and
>> > have noticed that there is a bit of a timing issue where if the server
>> > which is to bootstrap ZK with the configs does not complete it's
>> > process (i.e. there is no data at the Conf yet) the other servers will
>> > fail to start.  An obvious solution is to just start the solr instance
>> > responsible for bootstraping first, is there some way that folks are
>> > handling this now?
>>
>>
>> That's pretty much the deal - you have to get the configs in there for the
>> other shards to use as step one.
>>
>> Normally you would do this by starting one shard first, pointing to the
>> configs. Then start the other shards.
>>
>> Other options:
>>
>> use the zk cmd line program to manually create the config nodes and upload
>> the files
>> use the GUI program out there to do the same
>> use the zk library to write up something that does it
>>
>> write a simple java program (you'll need the solr libs on the classpath)
>> that does it with ZkController
>>
>> eg
>>
>> ZkController  zkController = new ZkController(zkAddress,
>>          zkClientTimeout, zkConnectTimeout, "localhost", "8983", "solr")
>> zkController.uploadConfigDir(directory, configName);
>> zkController.close();
>>
>> - Mark Miller
>> lucidimagination.com
>> 2011.lucene-eurocon.org | Oct 17-20 | Barcelona
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>
>
> --
> - Mark
>
> http://www.lucidimagination.com
>

Re: Automate startup/shutdown of SolrCloud Shards

Posted by Mark Miller <ma...@gmail.com>.
I could use an easier way to do this myself:
https://issues.apache.org/jira/browse/SOLR-2805

I'm going to add a main method to ZkController that will make this simpler -
I've got an early version that works something like: java -classpath .:*
org.apache.solr.cloud.ZkController 127.0.0.1:9983 127.0.0.1 8983 solr
/home/mark/workspace/SolrCloud/solr/example/solr/conf conf1


On Fri, Sep 30, 2011 at 3:13 PM, Mark Miller <ma...@gmail.com> wrote:

>
> On Sep 29, 2011, at 1:59 PM, Jamie Johnson wrote:
>
> > I am trying to automate the startup/shutdown of SolrCloud shards and
> > have noticed that there is a bit of a timing issue where if the server
> > which is to bootstrap ZK with the configs does not complete it's
> > process (i.e. there is no data at the Conf yet) the other servers will
> > fail to start.  An obvious solution is to just start the solr instance
> > responsible for bootstraping first, is there some way that folks are
> > handling this now?
>
>
> That's pretty much the deal - you have to get the configs in there for the
> other shards to use as step one.
>
> Normally you would do this by starting one shard first, pointing to the
> configs. Then start the other shards.
>
> Other options:
>
> use the zk cmd line program to manually create the config nodes and upload
> the files
> use the GUI program out there to do the same
> use the zk library to write up something that does it
>
> write a simple java program (you'll need the solr libs on the classpath)
> that does it with ZkController
>
> eg
>
> ZkController  zkController = new ZkController(zkAddress,
>          zkClientTimeout, zkConnectTimeout, "localhost", "8983", "solr")
> zkController.uploadConfigDir(directory, configName);
> zkController.close();
>
> - Mark Miller
> lucidimagination.com
> 2011.lucene-eurocon.org | Oct 17-20 | Barcelona
>
>
>
>
>
>
>
>
>
>
>


-- 
- Mark

http://www.lucidimagination.com

Re: Automate startup/shutdown of SolrCloud Shards

Posted by Mark Miller <ma...@gmail.com>.
On Sep 29, 2011, at 1:59 PM, Jamie Johnson wrote:

> I am trying to automate the startup/shutdown of SolrCloud shards and
> have noticed that there is a bit of a timing issue where if the server
> which is to bootstrap ZK with the configs does not complete it's
> process (i.e. there is no data at the Conf yet) the other servers will
> fail to start.  An obvious solution is to just start the solr instance
> responsible for bootstraping first, is there some way that folks are
> handling this now?


That's pretty much the deal - you have to get the configs in there for the other shards to use as step one.

Normally you would do this by starting one shard first, pointing to the configs. Then start the other shards.

Other options:

use the zk cmd line program to manually create the config nodes and upload the files
use the GUI program out there to do the same
use the zk library to write up something that does it

write a simple java program (you'll need the solr libs on the classpath) that does it with ZkController

eg

ZkController  zkController = new ZkController(zkAddress,
          zkClientTimeout, zkConnectTimeout, "localhost", "8983", "solr")
zkController.uploadConfigDir(directory, configName);
zkController.close();

- Mark Miller
lucidimagination.com
2011.lucene-eurocon.org | Oct 17-20 | Barcelona