我试图通过我在solr云中的java应用程序动态地创建核心,其中包含两个碎片。
CloudSolrServer cloudSolrServer = new CloudSolrServer("localhost:9983", new LBHttpSolrServer ("http://localhost:8983/solr"));
CoreAdminRequest.Create req = new CoreAdminRequest.Create() {
private static final long serialVersionUID = -8825247378713661625L;
@Override public SolrParams getParams() {
ModifiableSolrParams modifiableSolrParams = (ModifiableSolrParams) super.getParams();
modifiableSolrParams.set("collection.configName", "mycore");
return modifiableSolrParams;
}
};
req.setInstanceDir("/solr/master/mycorepath");
req.setCollection("mycore");
CoreAdminResponse res = req.process(cloudSolrServer.getLbServer());但是,我得到了错误:指定的配置在动物园管理员:mycore中不存在。
当我签入solr管理控制台时,我发现集合"mycore“不是完全createdi.e没有文件夹符号,也没有名为"mycore”的配置。
我该如何解决这个问题?在2片solr云(solr 4.1.0)中动态创建核心的标准方法是什么?
发布于 2014-01-17 09:43:02
我已经用solr4.4成功地创建了集合,它有两个碎片,没有副本,使用集合api
CloudSolrServer cs = new CloudSolrServer("localhost:9983");
CollectionAdminResponse res=CollectionAdminRequest.createCollection("testCollection", 2, 1, 1, "127.0.1.1:7574_solr,127.0.1.1:8983_solr", "myconf", null, cs);这将使用compositeID路由器创建一个集合。
myconf是在集群启动期间上传给动物园管理员的配置名称。
发布于 2013-07-23 20:32:27
我也在使用Solr 4.1.0,在创建内核时遇到了一些困难。我只使用一个碎片,但我回答了另一个类似于here.的问题
https://stackoverflow.com/questions/16185523
复制相似问题