首页 \ 问答 \ 如何使用Solr 5.5中的旧版本的schema.xml重建主从多核(How to rebuild master-slave multi-core with schema.xml from old verison in Solr 5.5)

如何使用Solr 5.5中的旧版本的schema.xml重建主从多核(How to rebuild master-slave multi-core with schema.xml from old verison in Solr 5.5)

我在1个主服务器上构建了2个内核,在旧版本的Solr中构建了2个从服务器。 主服务器和从服务器都使用solrcore.properties来指示其角色。 例如对于奴隶(注意:对于主人,我只是反转真/假),它是:

enable.master=false
enable.slave=true
#define master url
MASTER_CORE_URL=192.168.1.222:8983/corea_SE
POLL_TIME=00:00:60

在solrconfig.xml中,我定义了角色详细信息,例如:

<requestHandler name="/replication" class="solr.ReplicationHandler" >
    <!-- Use solrcore.properties to switch the role for node -->
    <lst name="master">
       <str name="enable">${enable.master:false}</str>
       <str name="replicateAfter">startup</str>
       <str name="replicateAfter">commit</str>
       <str name="confFiles">schema.xml,stopwords.txt</str>
    </lst>
    <lst name="slave">
        <str name="enable">${enable.slave:false}</str>
        <str name="masterUrl">http://${MASTER_CORE_URL}/${solr.core.name}/replication</str>
        <str name="pollInterval">${POLL_TIME}</str>
     </lst>
</requestHandler>

我想在Solr 5.5中重建这个结构,但我在Solr 5.5下载包或Apache Solr参考指南中都没有找到这样的示例或说明。 Solr 5.5甚至没有schema.xml或master-slave的任何示例。 我怎样才能做到这一点? 有没有可以帮助我的文件或网址?


I've built 2 cores with schema.xml on 1 master and 2 slaves in old-version Solr. Both master and slave use solrcore.properties to indicate their roles. e.g. for slave (note:for master, I just reverse the true/false), it's:

enable.master=false
enable.slave=true
#define master url
MASTER_CORE_URL=192.168.1.222:8983/corea_SE
POLL_TIME=00:00:60

and in solrconfig.xml, I define the roles detail, e.g:

<requestHandler name="/replication" class="solr.ReplicationHandler" >
    <!-- Use solrcore.properties to switch the role for node -->
    <lst name="master">
       <str name="enable">${enable.master:false}</str>
       <str name="replicateAfter">startup</str>
       <str name="replicateAfter">commit</str>
       <str name="confFiles">schema.xml,stopwords.txt</str>
    </lst>
    <lst name="slave">
        <str name="enable">${enable.slave:false}</str>
        <str name="masterUrl">http://${MASTER_CORE_URL}/${solr.core.name}/replication</str>
        <str name="pollInterval">${POLL_TIME}</str>
     </lst>
</requestHandler>

I want to rebuild this construction in Solr 5.5 but I find no such example or instructions in either Solr 5.5 download pack or Apache Solr Reference Guide. Solr 5.5 doesn't even have any examples with schema.xml or master-slave. How can I do this? Is there any doc or url that can help me?


原文:https://stackoverflow.com/questions/36254855
更新时间:2023-07-17 16:07

最满意答案

QAbstractItemModel::rowCountQAbstractItemModel::columnCount的接口允许视图向模型询问顶级行/列的数量,以及询问特定节点具有的子节点数。 前者通过传入无效 parent节点来完成,而后者通过传递特定节点的QModelIndex作为parent节点来完成。

即使视图传递了有效的parent (即它要求另一个节点的子节点数),您的TableModel::rowCount的实现总是返回1 。 由于这应该是一个“表”模型(不是树模型),您应该更改rowCountcolumnCount ,如下所示:

class TableModel : public QAbstractTableModel {
    // .....
    int rowCount(const QModelIndex &parent) const override {
        if(parent.isValid()) return 0; //no children
        return 1;
    }
    int columnCount(const QModelIndex &parent) const override {
        if(parent.isValid()) return 0; //no children
        return 2;
    }
    //....
}

ModelTest通过从模型中获取根索引(0,0)的第一个子 QModelIndex ,然后向该子项询问其父 ModelTest来检测此类错误。 报告的父级应该等于根索引(显然,这在您的代码中失败,因为您没有维护任何这些关系)...


QAbstractItemModel::rowCount and QAbstractItemModel::columnCount's interface allows the view to ask the model for the number of top-level rows/columns as well as asking for the number of children a specific node has. The former is done by passing in an invalid parent, while the latter is done by passing the specific node's QModelIndex as the parent parameter.

Your TableModel::rowCount's implementation always returns 1 even when the view passes a valid parent (i.e. It is asking for the number of the children of another node). Since this is supposed to be a "Table" model (not a tree model), You should change your rowCount and columnCount as follows:

class TableModel : public QAbstractTableModel {
    // .....
    int rowCount(const QModelIndex &parent) const override {
        if(parent.isValid()) return 0; //no children
        return 1;
    }
    int columnCount(const QModelIndex &parent) const override {
        if(parent.isValid()) return 0; //no children
        return 2;
    }
    //....
}

ModelTest detects such mistakes by getting the first child QModelIndex for the root index (0,0) from your model and then asking this child about its parent. The reported parent should equal the root index (obviously, this fails in your code since you are not maintaining any of these relationships)...

相关问答

更多
  • 在目前的PrimeFaces 3.x版本中这是不可能的。 只有当您使用mode="advanced"而不是mode="simple"时才有可能。 至于尝试使用label属性,此属性仅用作与输入组件关联的验证错误消息中的标签。 如果您的label="Browse"尝试,在出现required="true"验证错误的情况下,消息将显示为“需要浏览”而不是“formId:inputId is required”。 更新:自PrimeFaces 5.x以来,您可以添加skinSimple="true"以使mode= ...
  • 将!define和!路径行移出SetUp页面并移到父页面上。 Move the !define and !path lines out of the SetUp page and onto the parent page.
  • QAbstractItemModel::rowCount和QAbstractItemModel::columnCount的接口允许视图向模型询问顶级行/列的数量,以及询问特定节点具有的子节点数。 前者通过传入无效 parent节点来完成,而后者通过传递特定节点的QModelIndex作为parent节点来完成。 即使视图传递了有效的parent (即它要求另一个节点的子节点数),您的TableModel::rowCount的实现总是返回1 。 由于这应该是一个“表”模型(不是树模型),您应该更改rowCou ...
  • 你必须以相反的方式定义缩写。 你这样做会将“目标”扩展为“tgt”。 要做正确的事情,首先在缓冲区中键入要扩展的缩写 。 在你的情况下,这将是“目标”。 然后,在单词后面的点处,键入Cx ag 。 这将提示您输入要输入“tgt”的缩写。 Etvoilà:如果打开了abbrev-mode ,输入tgt现在会扩展为“target”。 还有其他方法可以定义缩写,例如通过Mx define-global-abbrev ,因此最好查看文档 。 删除缩写后的空格的问题是Emacs将在扩展缩写后插入它。 因此,击中空间基 ...
  • 我有与Tarnschaf- SchemaUpdate.Create(...)完全相同的问题,并且有问题的sql是drop table "tablename" cascade ,导致上面提到的相同的“表不存在”错误。 事实证明,其中一个项目提到了一个不在同一地点的与Nhibernate相关的组件。 我不确定为什么在解决方案清理和重建时没有显示。 从项目中删除所有引用并重新添加它们解决了问题(对我而言)。 只要发布此信息以防别人帮助其他人。 Nhibernate异常没有什么帮助。 I had the exact ...
  • 对于具有多行模式(x)的列可以是一个数组,因为可以有多个高频值。 默认情况下,我们将首先使用:mode [0]。 For a column having several rows mode(x) can be an array as there can be multiple values with high frequency. We will take the first one by default always using: mode[0] at the end.
  • 你的计划没问题。 在您的方案中切换恢复模式之间没有风险。 上次备份后,您的数据库将处于完全模式。 如果只需要10%的数据,只有一个注释,创建新数据库(大小合适),复制有效数据,重命名或删除旧数据库,重命名新数据库以替换旧数据库的速度不会更快。 答案取决于数据库复杂性,环境工作负载等。但它可以节省大量的批量删除时间,重建表以消除碎片和数据库缩减。 所以值得考虑。 Your plan is fine. There is no risk in switching between recovery modes in ...
  • 我认为这是因为“$ 1”.toUpperCase()在replaceAll之前运行。 由于“$ 1”字面上没有任何大写字母,因此与“$ 1”仅相同。 然后,当replaceAll运行时,模式下划线后跟小写字母被替换为小写字母。 I think it is because "$1".toUpperCase() runs before replaceAll. Since "$1" literally does not have any letter to uppercase, it is the same as ...
  • 你在使用代码覆盖吗? 如果是这样,请尝试禁用它并运行。 它可能会奏效。 有关详细信息,请访问: http : //social.msdn.microsoft.com/Forums/en-US/aba3d58f-f19f-4742-b960-8ac2be29bb88/unit-test-passes-when-in-debug-but-fails-当运行 Thank you for your response. I've identified the reason: it's due to a false p ...
  • 我很想说“写你自己的”,这就是我所做的。 另一方面,您可能希望重用我编写的内容: test_util.hpp和test_util.cpp 。 可以直接将cpp文件中的一个定义内联到hpp文件中。 麻省理工学院的lisence。 我也将它粘贴到下面的答案中。 这使您可以编写如下测试文件: #include "test_util.hpp" bool test_one() { bool ok = true; CHECK_EQUAL(1, 1); return ok; } int m ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。