第一个问题 :Java API:NoNodeAvailableException: No node available
I assume that you are setting the ES server on a remote host? In that case you will need to bind the publish address to the host's public IP address.
In your ES host edit /etc/elasticsearch/elasticsearch.yml
and add its public IP after network.publish_host:
Set the address other nodes will use to communicate with this node. If not set, it is automatically derived. It must point to an actual IP address.
network.publish_host: 192.168.0.1
And in your code connect to this host on port 9300. Note that you need the IP and not the domain name (at least according to my experience on Amazon EC2)
ElasticSearch Java API:NoNodeAvailableException: No node available
后台启动elasticSearch
./elasticsearch start