[Elasticsearch] 1.0.0 릴리즈 이후... 변경된 것중 하나..
Elastic/Elasticsearch 2014. 2. 14. 17:27elasticsearch 1.0.0 에서 이전에 사용하던 API 의 return 값과 다른 것들이 좀 보입니다.
사용하시면서 기존 구조만 믿고 그냥 쓰시면 큰 낭패를 보실 수도 있을 듯 하내요.
아마도 _cat (http://www.elasticsearch.org/blog/introducing-cat-api/) 기능이 들어 가면서 영향을 받은 것들이 좀 되구요.
settings, add document, get document 등도 조금씩 달라진게 있습니다.
그냥 참고들 하세요.
대표적으로 많이 바뀐 API 하나 맛보기로 보여 드립니다.
아래는 제가 쓰고 있는 책의 예제로 클러스터 구성하던걸 띄워 본거라.. 좀 길게 나오내요.. 그래서 중복된 것들은 삭제 했습니다.. ^^;
$ curl -XGET 'http://localhost:9200/_nodes?pretty=true'
{
"cluster_name" : "cluster_node",
"nodes" : {
"-Rr1fhFpTy2tYjQk9qWSQw" : {
"name" : "node2",
"transport_address" : "inet[/127.0.0.1:9301]",
"host" : "jeong-ui-MacBook-Pro.local",
"ip" : "192.168.0.117",
"version" : "1.0.0",
"build" : "a46900e",
"http_address" : "inet[localhost/127.0.0.1:9201]",
"attributes" : {
"master" : "true"
},
"settings" : {
"index" : {
"mapper" : {
"dynamic" : "true"
},
"number_of_replicas" : "0",
"number_of_shards" : "5",
"refresh_interval" : "1s"
},
"gateway" : {
"type" : "local"
},
"pidfile" : "es.pid",
"network" : {
"host" : "localhost"
},
"node" : {
"data" : "true",
"master" : "true",
"name" : "node2"
},
"http" : {
"port" : "9201",
"enabled" : "true"
},
"transport" : {
"tcp" : {
"compress" : "true",
"port" : "9301"
}
},
"name" : "node2",
"action" : {
"disable_shutdown" : "true",
"auto_create_index" : "true"
},
"path" : {
"logs" : "/Users/hwjeong/server/app/elasticsearch/node2/logs",
"home" : "/Users/hwjeong/server/app/elasticsearch/node2"
},
"cluster" : {
"name" : "cluster_node"
},
"discovery" : {
"zen" : {
"minimum_master_nodes" : "2",
"ping" : {
"unicast" : {
"hosts" : [ "localhost:9300", "localhost:9301", "localhost:9302" ]
},
"multicast" : {
"enabled" : "false"
}
}
}
},
"foreground" : "yes"
},
"os" : {
"refresh_interval" : 1000,
"available_processors" : 8,
"cpu" : {
"vendor" : "Intel",
"model" : "MacBookPro10,1",
"mhz" : 2400,
"total_cores" : 8,
"total_sockets" : 8,
"cores_per_socket" : 16,
"cache_size_in_bytes" : 256
},
"mem" : {
"total_in_bytes" : 8589934592
},
"swap" : {
"total_in_bytes" : 5368709120
}
},
"process" : {
"refresh_interval" : 1000,
"id" : 2447,
"max_file_descriptors" : 10240,
"mlockall" : false
},
"jvm" : {
"pid" : 2447,
"version" : "1.6.0_65",
"vm_name" : "Java HotSpot(TM) 64-Bit Server VM",
"vm_version" : "20.65-b04-462",
"vm_vendor" : "Apple Inc.",
"start_time" : 1392355185303,
"mem" : {
"heap_init_in_bytes" : 268435456,
"heap_max_in_bytes" : 1060372480,
"non_heap_init_in_bytes" : 24317952,
"non_heap_max_in_bytes" : 136314880,
"direct_max_in_bytes" : 1060372480
},
"gc_collectors" : [ "ParNew", "ConcurrentMarkSweep" ],
"memory_pools" : [ "Code Cache", "Par Eden Space", "Par Survivor Space", "CMS Old Gen", "CMS Perm Gen" ]
},
"thread_pool" : {
"generic" : {
"type" : "cached",
"keep_alive" : "30s"
},
"index" : {
"type" : "fixed",
"min" : 8,
"max" : 8,
"queue_size" : "200"
},
"get" : {
"type" : "fixed",
"min" : 8,
"max" : 8,
"queue_size" : "1k"
},
"snapshot" : {
"type" : "scaling",
"min" : 1,
"max" : 4,
"keep_alive" : "5m"
},
"merge" : {
"type" : "scaling",
"min" : 1,
"max" : 4,
"keep_alive" : "5m"
},
"suggest" : {
"type" : "fixed",
"min" : 8,
"max" : 8,
"queue_size" : "1k"
},
"bulk" : {
"type" : "fixed",
"min" : 8,
"max" : 8,
"queue_size" : "50"
},
"optimize" : {
"type" : "fixed",
"min" : 1,
"max" : 1
},
"warmer" : {
"type" : "scaling",
"min" : 1,
"max" : 4,
"keep_alive" : "5m"
},
"flush" : {
"type" : "scaling",
"min" : 1,
"max" : 4,
"keep_alive" : "5m"
},
"search" : {
"type" : "fixed",
"min" : 24,
"max" : 24,
"queue_size" : "1k"
},
"percolate" : {
"type" : "fixed",
"min" : 8,
"max" : 8,
"queue_size" : "1k"
},
"management" : {
"type" : "scaling",
"min" : 1,
"max" : 5,
"keep_alive" : "5m"
},
"refresh" : {
"type" : "scaling",
"min" : 1,
"max" : 4,
"keep_alive" : "5m"
}
},
"network" : {
"refresh_interval" : 5000,
"primary_interface" : {
"address" : "192.168.0.117",
"name" : "en0",
"mac_address" : "28:CF:E9:14:C5:C9"
}
},
"transport" : {
"bound_address" : "inet[/127.0.0.1:9301]",
"publish_address" : "inet[/127.0.0.1:9301]"
},
"http" : {
"bound_address" : "inet[/127.0.0.1:9201]",
"publish_address" : "inet[/127.0.0.1:9201]",
"max_content_length_in_bytes" : 104857600
},
"plugins" : [ ]
},
.................. 요기 부터 클러스터 노드 정보들로 중복 입니다.
}
}
}