首页 \ 问答 \ 如何在SOLR云中指定搜索者和索引器?(How to designate searcher and indexer in SOLR cloud?)

如何在SOLR云中指定搜索者和索引器?(How to designate searcher and indexer in SOLR cloud?)

我目前有一个2节点solr(4.10.3)云集群,配置为1个分片,有2个副本(带3个节点的外部zookeeper集合)。 我怎样才能设置solr cloud来使用一个框进行搜索,一个框只用于索引?

它是否像将客户端指向其特定节点一样简单?

例如,如果我们有solr01(索引器)和solr02(搜索器)。 我们将所有客户端指向solr02何时执行搜索,以及所有客户端在需要添加新数据时指向solr01。 我可以看到的主要缺点是它会减少冗余。

有没有办法配置solr cloud来自动处理?


I currently have a 2 node solr (4.10.3) cloud cluster configured as 1 shard with 2 replicas (with a 3 node external zookeeper ensemble). How can I setup solr cloud to use one box just for searching, and one box just for indexing?

Is it as simple as pointing clients to their specific nodes?

For example if we have solr01(indexer) and solr02(searcher). We point all clients to solr02 when to perform a search, and all clients to solr01 when they need to add new data. The main downside that I can see to this is that it would reduce redundancy.

Is there some way to configure solr cloud to do handle this automatically?


原文:https://stackoverflow.com/questions/29933072
更新时间:2021-07-15 22:07

最满意答案

长度运算符来看规则很简单:

除非给出__len元方法,否则仅在表是序列时定义表t的长度,即,对于某些非负整数n ,其正数字键的集合等于{1..n} 。 在这种情况下, n是它的长度。

在你的例子中:

local myTab = {1,2,3,nil,5,nil,7}

#mytab未定义,因为myTab不是序列,有或没有myTab["test"] = try

local myT = {123,456,789}

myT是一个序列,长度为3 ,有或没有myT["test"] = 10


The rule is simple, from the length operator:

Unless a __len metamethod is given, the length of a table t is only defined if the table is a sequence, that is, the set of its positive numeric keys is equal to {1..n} for some non-negative integer n. In that case, n is its length.

In your example:

local myTab = {1,2,3,nil,5,nil,7}

#mytab is undefined because myTab isn't a sequence, with or without myTab["test"] = try.

local myT = {123,456,789}

myT is a sequence, and the length is 3, with or without myT["test"] = 10

相关问答

更多
  • 下面是一个应该做你想要的功能。 function gen_table(str, existing) local root = existing or {} local tbl = root for p in string.gmatch(str, "[^.]+") do local new = tbl[p] or {} tbl[p] = new tbl = new end return root end 用法: local t = gen_table("x.y.z ...
  • Lua来自Sol,一种专为石油工程师设计的语言,没有在计算机程序设计方面进行正规培训。 没有接受过计算机训练的人认为开始从零开始算起来很奇怪。 通过采用基于1的阵列和字符串索引,Lua设计师避免了混淆其第一批客户和赞助商的期望。 虽然我一开始也发现他们很奇怪,但我已经学会了喜欢基于0的数组。 但是我可以通过Lua的1 ipairs得到,特别是通过使用Lua的通用循环和ipairs操作符,我通常可以避免担心数组如何被索引。 Lua is descended from Sol, a language desig ...
  • 你可以使用loadstring来创建一个你可以执行的lua块。 eventData = [[ months = { 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December', } ]] loadstring(eventData)( ...
  • 更改此功能以满足您的需求,并使用堆栈顶部的表调用它。 void luaAccess(lua_State * L)// call this function with the table on the top of the stack { lua_pushnil(L); while(lua_next(L, -2)) { switch(lua_type(L, -2)) { ...
  • 你必须使用luaL_dostring https://www.lua.org/manual/5.1/manual.html#luaL_dostring 如果你正在使用Lua 5.1,请确保正确定义了luaL_dostring 。 请参阅: http : //lua-users.org/lists/lua-l/2006-04/msg00218.html 在Lua 5.1中, luaL_dostring被定义为luaL_loadstring(L, s) || lua_pcall(L, 0, 0, 0) luaL ...
  • 从长度运算符来看,规则很简单: 除非给出__len元方法,否则仅在表是序列时定义表t的长度,即,对于某些非负整数n ,其正数字键的集合等于{1..n} 。 在这种情况下, n是它的长度。 在你的例子中: local myTab = {1,2,3,nil,5,nil,7} #mytab未定义,因为myTab不是序列,有或没有myTab["test"] = try 。 local myT = {123,456,789} myT是一个序列,长度为3 ,有或没有myT["test"] = 10 The rule ...
  • 在大多数GC中,当没有对象引用时会收集对象。 将参考链的顶部设置为零可删除对子级的引用。 如果这是唯一的参考,那么孩子们将被收集。 In most GC an object will be collected when there are no references to it. Setting the top of your reference chain to nil removes a reference to the children. If that was the only reference ...
  • lua_getfield是你可以自己做的一系列命令的语法糖: lua_pushstring(L, variablename); lua_gettable(L -1 - 1); //The second minus one represents the fact that your table is actually one index below the top now. 您将密钥推入堆栈,然后使用lua_gettable访问它。 无论它是什么类型的钥匙都是如此。 您必须回答的唯一问题是如何实际获得该密 ...
  • 通过设计, require缓存返回值。 因此,如果使用相同的字符串调用require ,则不会再次执行该脚本。 它只会返回先前返回的值。 require是用于加载模块。 模块不应该根据其他全局状态更改其返回值。 您可能正在寻找的功能是dofile 。 这将始终加载并执行该文件(但它没有require的路径搜索属性)。 或者,您可以使用loadfile将文件作为函数加载,然后执行该函数以随时重新生成表。 也: 我在表中的变量有问题。 表中没有“变量”。 或者至少不是你的意思。 期望对变量进行更改以影响其他值, ...
  • 也许这有助于您了解如何遍历数据: for k,v in ipairs(coordTable[1].loc) do for i,w in ipairs(v) do print(k,i,w) end end 或者,如果每个子表中总是有三个数字: for k,v in ipairs(coordTable[1].loc) do print(v[1],v[2],v[3]) end 要直接获取第二个子表中的三个数字,请使用 print(coordTable[1].loc[2] ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)