I'm putting this out there for comment.

Right now I'm in ZKControllers and changed register as follows:


public void register(SolrCore core, boolean forcePropsUpdate) throws
IOException,....

and at line 479 I've added this

 SolrRequestHandler requestHandler = core.getRequestHandler("/replication");
    boolean master = false;
    if(requestHandler != null && requestHandler instanceof ReplicationHandler){
        ReplicationHandler replicationHandler = 
(ReplicationHandler)requestHandler;
        master = replicationHandler.isMaster();
    }
    props.put("replication.master", master);


I also modified CoreContainer and ReplicationHandler to support what I
have above.  Does this seem a reasonable way to approach this?


Also to provide some history, I need this so I can programatically
determine which servers are masters and slaves and subsequently which
should be written to (for updates) and which should be queried.


On Tue, Oct 4, 2011 at 10:26 AM, Jamie Johnson <jej2...@gmail.com> wrote:
> Ok, so I am pretty sure this information is not available.  What is
> the most appropriate way to add information like this to ZK?  I can
> obviously look for the system properties enable.master and
> enable.slave, but that won't be fool proof since someone could put
> this in the config file instead and not as a system property.  Is
> there a way to determine this quickly programatically without having
> to go through all of the request handlers in the solrCore?
>
> On Mon, Oct 3, 2011 at 5:52 PM, Jamie Johnson <jej2...@gmail.com> wrote:
>> Is it possible to determine if a solr instance is a master or a slave
>> in replication terms based on the information that is placed in ZK in
>> SolrCloud?
>>
>

Reply via email to