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 Furkan KAMACI <fu...@gmail.com> on 2014/02/11 12:49:36 UTC

How to Learn Linked Configuration for SolrCloud at Zookeeper

Hi;

I've written a code that I can update a file to Zookeeper for SlorCloud.
Currently I have many configurations at Zookeeper for SolrCloud. I want to
update synonyms.txt file so I should know the currently linked
configuration (I will update the synonyms.txt file under appropriate
configuration folder) How can I learn it?

Thanks;
Furkan KAMACI

Re: How to Learn Linked Configuration for SolrCloud at Zookeeper

Posted by Furkan KAMACI <fu...@gmail.com>.
Hi;

OK, I've checked the source code and implemented that:

   public String readConfigName(SolrZkClient zkClient, String collection)
throws KeeperException, InterruptedException {

      String configName = null;

      String path = ZkStateReader.COLLECTIONS_ZKNODE + "/" + collection;

      LOGGER.info("Load collection config from:" + path);
      byte[] data = zkClient.getData(path, null, null, true);

      if (data != null) {
         ZkNodeProps props = ZkNodeProps.load(data);
         configName = props.getStr(CONFIGNAME_PROP);
      }

      if (configName != null && !zkClient.exists(CONFIGS_ZKNODE + "/" +
configName, true)) {
         LOGGER.error("Specified config does not exist in ZooKeeper:" +
configName);
         throw new ZooKeeperException(SolrException.ErrorCode.SERVER_ERROR,
"Specified config does not exist in ZooKeeper:" + configName);
      }
      return configName;
   }

So, I can get the linked configuration name.

Thanks;
Furkan KAMACI


2014-02-11 13:57 GMT+02:00 Furkan KAMACI <fu...@gmail.com>:

> I am looking it for a particular collection.
>
>
> 2014-02-11 13:55 GMT+02:00 Alan Woodward <al...@flax.co.uk>:
>
> For a particular collection or core?  There should be a
>> collection.configName property specified for the core or collection which
>> tells you which ZK config directory is being used.
>>
>> Alan Woodward
>> www.flax.co.uk
>>
>>
>> On 11 Feb 2014, at 11:49, Furkan KAMACI wrote:
>>
>> > Hi;
>> >
>> > I've written a code that I can update a file to Zookeeper for SlorCloud.
>> > Currently I have many configurations at Zookeeper for SolrCloud. I want
>> to
>> > update synonyms.txt file so I should know the currently linked
>> > configuration (I will update the synonyms.txt file under appropriate
>> > configuration folder) How can I learn it?
>> >
>> > Thanks;
>> > Furkan KAMACI
>>
>>
>

Re: How to Learn Linked Configuration for SolrCloud at Zookeeper

Posted by Furkan KAMACI <fu...@gmail.com>.
I am looking it for a particular collection.


2014-02-11 13:55 GMT+02:00 Alan Woodward <al...@flax.co.uk>:

> For a particular collection or core?  There should be a
> collection.configName property specified for the core or collection which
> tells you which ZK config directory is being used.
>
> Alan Woodward
> www.flax.co.uk
>
>
> On 11 Feb 2014, at 11:49, Furkan KAMACI wrote:
>
> > Hi;
> >
> > I've written a code that I can update a file to Zookeeper for SlorCloud.
> > Currently I have many configurations at Zookeeper for SolrCloud. I want
> to
> > update synonyms.txt file so I should know the currently linked
> > configuration (I will update the synonyms.txt file under appropriate
> > configuration folder) How can I learn it?
> >
> > Thanks;
> > Furkan KAMACI
>
>

Re: How to Learn Linked Configuration for SolrCloud at Zookeeper

Posted by Alan Woodward <al...@flax.co.uk>.
For a particular collection or core?  There should be a collection.configName property specified for the core or collection which tells you which ZK config directory is being used.

Alan Woodward
www.flax.co.uk


On 11 Feb 2014, at 11:49, Furkan KAMACI wrote:

> Hi;
> 
> I've written a code that I can update a file to Zookeeper for SlorCloud.
> Currently I have many configurations at Zookeeper for SolrCloud. I want to
> update synonyms.txt file so I should know the currently linked
> configuration (I will update the synonyms.txt file under appropriate
> configuration folder) How can I learn it?
> 
> Thanks;
> Furkan KAMACI