June 2017
Beginner to intermediate
404 pages
8h 22m
English
Once you have added the transport client dependency, you can initialize the client as shown here:
TransportAddress node1 = new InetSocketTransportAddress(InetAddress.getByName("node1"), 9300);TransportAddress node2 = new InetSocketTransportAddress(InetAddress.getByName("node2"), 9300);Settings setting = Settings.builder().put("cluster.name", "elasticsearch").build();TransportClient client = new PreBuiltTransportClient(settings);//Add the known nodes to the clientclient.addTransportAddress(node1);client.addTransportAddress(node2);
To initialize the client, you need the following:
Read now
Unlock full access