在我的ElasticSearch集群中的一个节点上,我得到以下奇怪的响应:
命令:
curl -X GET 'http://localhost:9200'
响应:
{"OK":{}}
不知道该怎么办?有没有人遇到过这个?
这是我打电话时得到的(我用xxx替换了IP')
curl -XGET localhost:9200/_nodes/jvm?human\&pretty
{
"cluster_name" : "elasticsearch",
"nodes" : {
"dtUV63D4RBq9JXw_o03-eg" : {
"name" : "elasticsearch1",
"transport_address" : "inet[xxx/xxx:9300]",
"host" : "elasticsearch1",
"ip" : "xxx",
"version" : "1.3.2",
"build" : "dee175d",
"http_address" : "inet[/xxx:9200]",
"jvm" : {
"pid" : 1471,
"version" : "1.7.0_65",
"vm_name" : "OpenJDK 64-Bit Server VM",
"vm_version" : "24.65-b04",
"vm_vendor" : "Oracle Corporation",
"start_time" : "2014-11-19T14:50:10.408Z",
"start_time_in_millis" : 1416408610408,
"mem" : {
"heap_init" : "4gb",
"heap_init_in_bytes" : 4294967296,
"heap_max" : "3.9gb",
"heap_max_in_bytes" : 4277534720,
"non_heap_init" : "23.1mb",
"non_heap_init_in_bytes" : 24313856,
"non_heap_max" : "214mb",
"non_heap_max_in_bytes" : 224395264,
"direct_max" : "3.9gb",
"direct_max_in_bytes" : 4277534720
},
"gc_collectors" : [ "ParNew", "ConcurrentMarkSweep" ],
"memory_pools" : [ "Code Cache", "Par Eden Space", "Par Survivor Space", "CMS Old Gen", "CMS Perm Gen" ]
}
},
"8eGVx6IGQ8qiFTc4rnaG3A" : {
"name" : "elasticsearch2",
"transport_address" : "inet[/xxx:9300]",
"host" : "elasticsearch2",
"ip" : "xxx",
"version" : "1.3.2",
"build" : "dee175d",
"http_address" : "inet[/xxx:9200]",
"jvm" : {
"pid" : 1476,
"version" : "1.7.0_65",
"vm_name" : "OpenJDK 64-Bit Server VM",
"vm_version" : "24.65-b04",
"vm_vendor" : "Oracle Corporation",
"start_time" : "2014-11-19T14:54:33.909Z",
"start_time_in_millis" : 1416408873909,
"mem" : {
"heap_init" : "4gb",
"heap_init_in_bytes" : 4294967296,
"heap_max" : "3.9gb",
"heap_max_in_bytes" : 4277534720,
"non_heap_init" : "23.1mb",
"non_heap_init_in_bytes" : 24313856,
"non_heap_max" : "214mb",
"non_heap_max_in_bytes" : 224395264,
"direct_max" : "3.9gb",
"direct_max_in_bytes" : 4277534720
},
"gc_collectors" : [ "ParNew", "ConcurrentMarkSweep" ],
"memory_pools" : [ "Code Cache", "Par Eden Space", "Par Survivor Space", "CMS Old Gen", "CMS Perm Gen" ]
}
}
}
}
答案 0 :(得分:7)
单独的Elasticsearch 1.3.2无法产生这样的响应 - 生产源代码中根本没有"OK"
字符串。所以,我猜有人在这个节点上安装了一个插件拦截了一些调用并用这个消息替换它们。
其中一个插件是elasticsearch-http-basic插件,它确实向未经授权的用户instead of a full response显示{"OK":{}}
。您可以通过在给出响应的节点上执行以下命令来验证此插件和其他插件的存在:
curl "localhost:9200/_nodes/plugins?pretty"