Elasticsearch
[elasticsearch] java api의 Settings관련 프로퍼티 설정
'김용환'
2015. 4. 2. 10:55
예제
Settings settings = ImmutableSettings.settingsBuilder().put("cluster.name", "elasticsearch").put("client.transport.sniff", false).build();
TransportClient client = new TransportClient(settings).addTransportAddress(
new InetSocketTransportAddress("es001.in.google.com", 9300));
Settings에 사용할 수 있는 프로퍼티는 다음과 같다.
- client.transport.diff : 디폴트는 false이다. true로 설정하면 클라이언트는 연결 직후 다른 노드의 주소를 얻어올 수 있다.
- client.transport.ignore_cluster_name : 디폴트는 false이다. true로 설정하면 클러스터 이름이 올바른지에 대한 체크(validation)을 하지 않는다. 클라이언트가 지정한 클러스터의 이름과 서버의 클러스터 이름이 다른 경우에 경고가 나온다.
- client.transport.ping_timeout : 5s가 디폴트이다.
- client.transport.nodes_sampler_interval : 디폴트는 5s이다. ping/sample에 대한 주기를 의미한다.
참조
http://www.elastic.co/guide/en/elasticsearch/client/java-api/current/client.html