刚入门 ES , 在java 使用ES,访问后报错:None of the configured nodes are available 。
这是我的ES配置:
cluster.name: kaven
node.name: master
network.host: 127.0.0.1
http.port: 9200
transport.tcp.port: 9300
这是我的java代码 :
InetSocketTransportAddress node = new InetSocketTransportAddress(InetAddress.getByName("localhost"), 9300);
Settings settings = Settings.builder()
.put("cluster.name", "kaven").put("node.name", "master").build();
TransportClient client = new PreBuiltTransportClient(settings);
client.addTransportAddress(node);
这是我的ES配置:
cluster.name: kaven
node.name: master
network.host: 127.0.0.1
http.port: 9200
transport.tcp.port: 9300
这是我的java代码 :
InetSocketTransportAddress node = new InetSocketTransportAddress(InetAddress.getByName("localhost"), 9300);
Settings settings = Settings.builder()
.put("cluster.name", "kaven").put("node.name", "master").build();
TransportClient client = new PreBuiltTransportClient(settings);
client.addTransportAddress(node);
0 个回复