Tag: elasticsearch

ElasticSearch _bulk调用导致“套接字挂起”,尽pipe体积小

我正在使用弹性来通过node.js连接到ElasticSearch。 在使用Nodetime分析我的应用程序来尝试提高性能的过程中,我注意到一些奇怪的事情。 My ElasticSearch对“_bulk”索引的“PUT”请求经常导致“套接字挂断”。 而且,这些调用占用了大量的CPU时间。 我将每个_bulk索引要求@ 10个条目都加上索引,正如你所看到的,请求的内容长度甚至不能达到50Kb,所以很难想象这个大小是一个问题。 然而,响应时间大于60秒,CPU时间大于10+秒! 哎呀! 在尝试debugging时,我开始在前台运行ElasticSearch。 我注意到这个奇怪的错误: [2013-02-27 11:42:39,188][WARN ][index.gateway.s3 ] [Lady Mandarin] [network][1] failed to read commit point [commit-f34] java.io.IOException: Failed to get [commit-f34] at org.elasticsearch.common.blobstore.support.AbstractBlobContainer.readBlobFully(AbstractBlobContainer.java:83) at org.elasticsearch.index.gateway.blobstore.BlobStoreIndexShardGateway.buildCommitPoints(BlobStoreIndexShardGateway.java:847) at org.elasticsearch.index.gateway.blobstore.BlobStoreIndexShardGateway.doSnapshot(BlobStoreIndexShardGateway.java:188) at org.elasticsearch.index.gateway.blobstore.BlobStoreIndexShardGateway.snapshot(BlobStoreIndexShardGateway.java:160) at org.elasticsearch.index.gateway.IndexShardGatewayService$2.snapshot(IndexShardGatewayService.java:271) at org.elasticsearch.index.gateway.IndexShardGatewayService$2.snapshot(IndexShardGatewayService.java:265) at org.elasticsearch.index.engine.robin.RobinEngine.snapshot(RobinEngine.java:1090) at org.elasticsearch.index.shard.service.InternalIndexShard.snapshot(InternalIndexShard.java:496) at org.elasticsearch.index.gateway.IndexShardGatewayService.snapshot(IndexShardGatewayService.java:265) at org.elasticsearch.index.gateway.IndexShardGatewayService$SnapshotRunnable.run(IndexShardGatewayService.java:366) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) […]

ElasticSearch Nodejs Express自动化testing

如何使用Nodetesting框架实现对ElasticSearch的自动化testing? 我想实现ElasticSearch到我的nodejs项目中,以获得高效的search能力,这是使用Express框架,frisby,Socket.io等ElasticSearch nodejs实现很容易在谷歌提供,但不是它的自动化testing。 需要build议。

Elasticsearch部署在2服务器负载均衡节点js应用程序设置中

我有我的节点JS应用程序的以下生产设置: 我现在要在这个设置中集成Elasticsearch。 我的问题是关于在生产环境中部署Elasticsearch的最佳实践。 我所有的实例都是虚拟机,我知道Elasticsearch使用了大量的内存。 因此,我是否应该在自己的服务器(服务器3)上设置Elasticsearch,在服务器1和服务器2上将其设置为群集(非常类似于Mongo数据库副本集),或者将其作为单独的实例安装在每台服务器上。 select的方法有什么好处? 非常感谢!

Elasticdump中的'现在不能切换到旧模式'错误

我尝试使用elasticdump(在Node.js上)备份和恢复Elasticsearch中的json索引: [备份] elasticdump –input=http://cred:entials@myserver.com:9200/.kibana –output=kibana.json –type=data (Works) [恢复] elasticdump –output=http://cred:entials@myserver.com:9200/.kibana –input=kibana.json –type=data (给出错误) 错误是: _stream_readable.js:749 throw new Error('Cannot switch to old mode now.'); ^ Error: Cannot switch to old mode now. at emitDataEvents (_stream_readable.js:749:11) at ReadStream.Readable.pause (_stream_readable.js:740:3) at file.completeBatch (/usr/lib/node_modules/elasticdump/lib/transports/file.js:75:19) at Stream.<anonymous> (/usr/lib/node_modules/elasticdump/lib/transports/file.js:65:10) at Stream.emit (events.js:117:20) at drain (/usr/lib/node_modules/elasticdump/node_modules/through/index.js:34:23) 有谁知道发生了什么事以及如何解决?

Elasticsearch – 按优先级例外进行过滤和按名称sorting

我试图按优先级例外进行过滤和名称sorting,这意味着即使结果按字母顺序sorting,我也希望首先出现一个特定的名称。 例如 – 这是我的基本查询 { "from": 0, "size": 500, "min_score": 0.15, "query": { "filtered": { "filter": { "bool": { "must": [ { "exists": { "field": "brand.id" } } ] } } } }, "sort": [ { "brand.names.1.raw": "asc" } ] } 简而言之,我希望这个数组[“百事可乐”,“可口可乐”,“可口可乐”]按照“可口可乐”的优先顺序进行sorting,从而将其sorting为“可口可乐” ,“可口可乐”,“百事可乐”] 现在它按字母顺序sorting。 我想到了一些可行的想法: 通过“匹配”增加一个“应该”。 但后来我有sorting“_score”的问题,它打破了我的字母sorting,虽然我首先按“_score”和品牌名称sorting。 添加到“bool”中的示例:“should”:[{“match”:{“brand.id”:{“query”:34709,“boost”:20}}} 我尝试了“聚合”,以便第一个查询(桶)将“匹配”具体的品牌名称和sortingalphabeticaly里面,第二个查询将按字母sorting只。 但我完全搞砸了。 我必须使用过滤 – >filter,我不能使用脚本查询。 谢谢。 更新这里是一个文件的例子,以及它如何sorting。 […]

从节点请求Elasticsearch超时

我正在设置一个简单的Node.js REST服务来与Elasticsearch接口,使用官方的Javascript客户端。 我在本地运行此代码,但群集位于远程。 当我通过浏览器,使用_head插件,我可以连接ES和查询没有问题。 但是,通过Javascript客户端这样做超时了所有请求。 我设置了ElasticSearch对象,但是发送任何请求都不起作用。 我不认为这是一个networking问题,因为我可以通过浏览器访问ES。 这就是我要求的东西,一个非常基本的东西: var elasticsearch = require("elasticsearch"); var es = new elasticsearch.Client({ host: "https://my-address:9200/", // also tried without protocol part and trailing slashes log: "error", sniffOnStart: true }); es.get({ index: "things", type: "someThing", id: "42" }).then(doSomeStuff, handleStuffFailed); 这会失败,错误信息Errror: Request timeout after 30000ms. 我在这里错过了什么? 我读过客户端文档,这看起来像客户端的基本“你好世界”。

在Heroku上为新的Firebase设置ElasticSearch上的Flashlight

我的目标是将Firebase与ElasticSearch连接起来,以便在iOS应用中search用户名时可以实现“like”查询。 从我读到的这个是最好的解决scheme,我想早点解决这个问题,以便可扩展而不是蛮横的。 为了实现这一点,我试图将Firebase开发人员为我们提供的手电筒应用程序部署到Heroku上,但是我很困惑如何去做。 请纠正我错在哪里,我对Heroku生态系统,ElasticSearch和nodejs相当陌生。 我目前有一个Heroku账户,并且在我的电脑(Mac)上安装了toolbelt和nodejs / npm。 我运行了以下命令: git clone https://github.com/firebase/flashlight cd flashlight heroku login heroku create heroku addons:add bonsai heroku config (我能用heroku config命令成功获得我的盆景url) 下一步是 heroku config:set FB_NAME=<instance> FB_TOKEN="<token>" 但是我不太了解FB_NAME(我的猜测是Firebase应用程序名称,不过是应用程序名称,还是由于新的Firebase安装程序不再是app_name.firebaseio.com , app_name-abc123.firebaseio.com )和什么是FB_TOKEN? (是我下载的plist中的一个关键或东西?)

无法使用Firebase和ElasticSearch(使用手电筒)进行正确的path监控或查询

我正在尝试整合ElasticSearch和Firebase。 我正在使用来自Firebase的Flashlight集成来完成所有工作。 我已经将代码部署到了Heroku,如上面链接的Github repo中所述。 它的工作原理是当我插入查询objet到/search/request/我得到一个/search/response结果。 但结果有点乱,不正确。 但我无法弄清楚什么是错的。 这是config.js中定义要监视的path的内容: /** Paths to Monitor * * Each path can have these keys: * {string} path: [required] the Firebase path to be monitored, for example, `users/profiles` * would monitor https://<instance>.firebaseio.com/users/profiles * {string} index: [required] the name of the ES index to write data into * {string} type: [required] […]

如何获得弹性search玩MongoDb和node.js?

我对mongodb和node.js都比较陌生,但是最近一切都为我工作,直到我到了需要将全文search添加到我的网站的地步。 从我的研究中,我发现Elasticsearch将是一个很好的select,但我无法弄清楚如何使它与node.js和mongodb一起工作。 我正在使用Heroku和MongoLab来托pipe我的应用程序。 这是我的问题。 我如何托pipeElasticsearch? 如何使我的所有mongo数据可用于弹性search使用河stream还是手动插入和删除所有数据? 我发现了这条河,但我不太清楚如何自动发生这种情况,以及如何托pipe它。 如何从node.js查询Elasticsearch? 有没有允许这个包? 编辑: 问题2真的是我正在努力。 我还包括了问题1和问题3,以帮助那些对这个主题感兴趣并且来自谷歌的人。

如何更新elasticsearch字段types

我需要更新弹性search字段types整数长我试过以下的方式,它不工作 curl -XPUT 'http://localhost:9200/testwork/_mapping/message?ignore_conflicts=true' -d ' { "message" : { "properties" : { "status" : {"type" : "long"} } } } ' 如果尝试不使用ignore_conflicts参数,则会出现错误 {"error":"MergeMappingException[Merge failed with failures {[mapper [status] of different type, current_type [integer], merged_type [long]]}]","status":400} 但是在使用ignore_conflicts参数得到响应的时候没有得到错误 {"acknowledged":true} 但types没有改变状态字段。 请帮我做这个