Settings settings = Settings.builder()
.put("client.transport.ignore_cluster_name", false)
.put("client.transport.sniff", true)
.put("cluster.name", "TESTCULSTER").build();
TransportClient client = new PreBuiltTransportClient(settings)
.addTransportAddress(new TransportAddress(InetAddress.getByName("127.0.0.1"), 9300));
// ClusterAdminClient clusterAdminClient = client.admin().cluster();
ClusterHealthResponse healths = client.admin().cluster().prepareHealth().get();
String clusterName = healths.getClusterName();
System.out.println(clusterName);
我在纠错这个错误 线程“main”中的异常NoNodeAvailableException [没有配置的节点可用:[{#transport#-1} {zJ52yLDcR82UUQ7j-oxm6w} {127.0.0.1} {127.0.0.1:9300}]]
答案 0 :(得分:0)
您想通过Java连接到elasticsearch,对吧?
curl
select TO_CHAR(Table1), Column1, column2
from a
where Table1 between to_date(:beg_awd_date,'DD-MON-YYYY') AND
to_date(:end_awd_date,'DD-MON-YYYY')
order by column1