elasticsearch 接口通过 curl 调用

前言

调用接口查看信息

shell> curl http://localhost:9200/
{
  "name" : "c8f8f3ab4ce1",
  "cluster_name" : "docker-cluster",
  "cluster_uuid" : "zH5KP4ldSCCDvCQUtZlo5g",
  "version" : {
    "number" : "7.10.0",
    "build_flavor" : "default",
    "build_type" : "docker",
    "build_hash" : "51e9d6f22758d0374a0f3f5c6e8f3a7997850f96",
    "build_date" : "2020-11-09T21:30:33.964949Z",
    "build_snapshot" : false,
    "lucene_version" : "8.7.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

启用安全认证后,调用接口查看信息

shell> curl --user elastic:mypassword  http://localhost:9200/
{
  "name" : "c8f8f3ab4ce1",
  "cluster_name" : "docker-cluster",
  "cluster_uuid" : "zH5KP4ldSCCDvCQUtZlo5g",
  "version" : {
    "number" : "7.10.0",
    "build_flavor" : "default",
    "build_type" : "docker",
    "build_hash" : "51e9d6f22758d0374a0f3f5c6e8f3a7997850f96",
    "build_date" : "2020-11-09T21:30:33.964949Z",
    "build_snapshot" : false,
    "lucene_version" : "8.7.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

你可能感兴趣的:(elasticsearch,elasticsearch)