[sysadmin@es01 config]$ cat  elasticsearch.yml |grep -v "^#" 
cluster.name: yqh
node.name: node-1
node.attr.rack: r1
path.data: /nldata/elasticsearch-5.3.1/data/
path.logs: /nldata/elasticsearch-5.3.1/logs
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
network.host: 192.168.0.71
http.port: 9200
http.cors.enabled: true
http.cors.allow-origin: "*"
discovery.zen.ping.unicast.hosts: ["192.168.0.71", "192.168.0.72", "192.168.0.73"]
discovery.zen.minimum_master_nodes: 3
gateway.recover_after_nodes: 3

 查看集群状态

[sysadmin@es01 config]$ curl  -XGET 'http://192.168.0.72:9200/_cat/nodes'                  
192.168.0.72 60 97 11 0.80 0.75 0.64 mdi * node-2
192.168.0.73 54 96 19 2.18 1.39 1.18 mdi - node-3
192.168.0.71 60 95 11 1.08 1.13 1.07 mdi - node-1
[sysadmin@es01 config]$ curl  -XGET 'http://192.168.0.72:9200/_cat/nodes?v'
ip           heap.percent ram.percent cpu load_1m load_5m load_15m node.role master name
192.168.0.72           59          97  12    0.97    0.79     0.65 mdi       *      node-2
192.168.0.73           53          96  21    1.85    1.34     1.17 mdi       -      node-3
192.168.0.71           62          95  11    0.99    1.11     1.06 mdi       -      node-1
[sysadmin@es01 config]$ curl  -XGET 'http://192.168.0.72:9200/_cluster/state/nodes?pretty'
{
  "cluster_name" : "yqh",
  "nodes" : {
    "Vzij6BWbSEavfNfc5_UUjg" : {
      "name" : "node-2",
      "ephemeral_id" : "XVSqEh2cQfGr0aOsaRPLZQ",
      "transport_address" : "192.168.0.72:9300",
      "attributes" : {
        "rack" : "r2"
      }
    },
    "eGRmV1QiTjGqAgFBvyEJFw" : {
      "name" : "node-3",
      "ephemeral_id" : "IT5JbvbXRVu8uHUnXG3LGA",
      "transport_address" : "192.168.0.73:9300",
      "attributes" : {
        "rack" : "r3"
      }
    },
    "XT22r0bHQAC77ceS6RucHw" : {
      "name" : "node-1",
      "ephemeral_id" : "viL7JioKQAGPsX1ezaYjmA",
      "transport_address" : "192.168.0.71:9300",
      "attributes" : {
        "rack" : "r1"
      }
    }
  }
}