遇到以上错误的解决办法:
Settings settings = Settings.settingsBuilder().put("cluster.name",clusterName).put("client.transport.sniff", true).build();
client = TransportClient.builder().settings(settings).build().addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName(address), port));
但是切记!!!!!!!!!!!!!!!!!!!!!
clusterName必须与elasticsearch.yml中的 cluster.name 相同!!!!!!