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 rulinma <ru...@gmail.com> on 2014/03/26 10:14:32 UTC

MergingSolrIndexes not supported by SolrCloud?why?

MergingSolrIndexes:

http://192.168.22.32:8080/solr/admin/cores?action=mergeindexes&core=collection_cms2&indexDir=/home/solr/mrl/data/index

I use it in local that supported well, but in solrCloud(3 machine) that not
work well.
can anyone give me some advice. thanks.



--
View this message in context: http://lucene.472066.n3.nabble.com/MergingSolrIndexes-not-supported-by-SolrCloud-why-tp4127111.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: MergingSolrIndexes not supported by SolrCloud?why?

Posted by rulinma <ru...@gmail.com>.
I think that maybe my problem with cluster. I will adjust to test again. 3X!



--
View this message in context: http://lucene.472066.n3.nabble.com/MergingSolrIndexes-not-supported-by-SolrCloud-why-tp4127111p4128113.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: MergingSolrIndexes not supported by SolrCloud?why?

Posted by rulinma <ru...@gmail.com>.
I make it. I make a mistake.



--
View this message in context: http://lucene.472066.n3.nabble.com/MergingSolrIndexes-not-supported-by-SolrCloud-why-tp4127111p4128351.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: MergingSolrIndexes not supported by SolrCloud?why?

Posted by rulinma <ru...@gmail.com>.
I also write java code , that not work well .
 public static void merge() {
    final HttpSolrServer server = new
HttpSolrServer("http://solr2:8983/solr");
    try {
      CoreAdminRequest.MergeIndexes mergeRequest = new
CoreAdminRequest.MergeIndexes();
      mergeRequest.setCoreName("collection3");
      // mergeRequest.setIndexDirs(Arrays.asList(dir.getPath().toString() +
"/data/index"));
      mergeRequest.setIndexDirs(Arrays
         
.asList("hdfs://solr1:8020/user/solr/outdir/results/part-00000/data/index"));
      CoreAdminResponse rs = mergeRequest.process(server);
      System.out.println(rs);
    } catch (SolrServerException e) {
      e.printStackTrace();
    } catch (IOException e) {
      e.printStackTrace();
    } finally {
      System.out.println("end.");
    }
  }

who can give explain.

But I use in one machine, that is true work well, cloudera can give more
explain? or anyone else? thanks.



--
View this message in context: http://lucene.472066.n3.nabble.com/MergingSolrIndexes-not-supported-by-SolrCloud-why-tp4127111p4127597.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: MergingSolrIndexes not supported by SolrCloud?why?

Posted by rulinma <ru...@gmail.com>.
I use hdfs to test, that not work.
I tried: 
  (1) ******/indexDir=hdfs://ip/solr/sample/data/index
  (2) ******/indexDir=/solr/sample/data/index
not work well.

I also try:
  (3) ******/srcCore=sample
not work well.

can give me some success sample.
3x!

I insert data, hdfs appear index files, that is ok, but mergeindex is not
work well.
solr 4.4 and cloudear hdfs.






--
View this message in context: http://lucene.472066.n3.nabble.com/MergingSolrIndexes-not-supported-by-SolrCloud-why-tp4127111p4127350.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: MergingSolrIndexes not supported by SolrCloud?why?

Posted by Mark Miller <ma...@gmail.com>.
FWIW, you can use merge like this if you run on HDFS rather than local filesystem.

-- 
Mark 

On March 26, 2014 at 12:34:39 PM, Shawn Heisey (solr@elyograg.org) wrote:

On 3/26/2014 3:14 AM, rulinma wrote:  
> MergingSolrIndexes:  
>  
> http://192.168.22.32:8080/solr/admin/cores?action=mergeindexes&core=collection_cms2&indexDir=/home/solr/mrl/data/index  
>  
> I use it in local that supported well, but in solrCloud(3 machine) that not  
> work well.  
> can anyone give me some advice. thanks.  

There are two reasons that it doesn't work in SolrCloud:  

1) The indexes that you are merging must be on the same host. With  
SolrCloud this is not guaranteed, and normally will NOT be the case.  

2) Once the indexes are merged, the SolrCloud clusterstate in zookeeper  
will be wrong.  

I don't know whether the first problem can be overcome without copying  
one of the shards before merging.  

Assuming you can overcome the first problem, or it's not a problem  
because they are already on the same host, overcoming the second would  
require a merge option on the Collections API. I do not see any  
evidence in the reference guide that this exists right now.  

Thanks,  
Shawn  


Re: MergingSolrIndexes not supported by SolrCloud?why?

Posted by Shawn Heisey <so...@elyograg.org>.
On 3/26/2014 3:14 AM, rulinma wrote:
> MergingSolrIndexes:
>
> http://192.168.22.32:8080/solr/admin/cores?action=mergeindexes&core=collection_cms2&indexDir=/home/solr/mrl/data/index
>
> I use it in local that supported well, but in solrCloud(3 machine) that not
> work well.
> can anyone give me some advice. thanks.

There are two reasons that it doesn't work in SolrCloud:

1) The indexes that you are merging must be on the same host.  With 
SolrCloud this is not guaranteed, and normally will NOT be the case.

2) Once the indexes are merged, the SolrCloud clusterstate in zookeeper 
will be wrong.

I don't know whether the first problem can be overcome without copying 
one of the shards before merging.

Assuming you can overcome the first problem, or it's not a problem 
because they are already on the same host, overcoming the second would 
require a merge option on the Collections API.  I do not see any 
evidence in the reference guide that this exists right now.

Thanks,
Shawn