阿里云双十一优惠活动,点击链接进行购买: 一年仅需89元即可以购买服务器~。我个人服务器为2核4G配置,也更加推荐购买 2核4G三年799元 配置的服务器。
你可以跟着我的笔记 当我有一台服务器时,我做了什么 来开始维护服务器并搭建应用,将引导你使用 docker 和 k8s 搭建一个自己的服务器开发集群。

# 在 k8s 集群中部署 ES

# 通过 helm 部署

# WARNING

Elasticsearch requires some changes in the kernel of the host machine to
work as expected. If those values are not set in the underlying operating
system, the ES containers fail to boot with ERROR messages.

More information about these requirements can be found in the links below:

  https://www.elastic.co/guide/en/elasticsearch/reference/current/file-descriptors.html
  https://www.elastic.co/guide/en/elasticsearch/reference/current/vm-max-map-count.html

This chart uses a privileged initContainer to change those settings in the Kernel
by running: sysctl -w vm.max_map_count=262144 && sysctl -w fs.file-max=65536
$ sysctl -w vm.max_map_count=262144 && sysctl -w fs.file-max=65536

# 查看状态

$ kubectl get pods
es-elasticsearch-coordinating-only-54d9f9698f-5mhdx   1/1       Running            0          7h26m
es-elasticsearch-coordinating-only-54d9f9698f-xgnsb   1/1       Running            0          7h26m
es-elasticsearch-data-0                               1/1       Running            79         7h26m
es-elasticsearch-master-0                             1/1       Running            79         7h26m

# 部署成功

$ curl es-elasticsearch-coordinating-only:9200
{
  "name" : "es-elasticsearch-coordinating-only-54d9f9698f-5mhdx",
  "cluster_name" : "elastic",
  "cluster_uuid" : "_na_",
  "version" : {
    "number" : "7.7.1",
    "build_flavor" : "oss",
    "build_type" : "tar",
    "build_hash" : "ad56dce891c901a492bb1ee393f12dfff473a423",
    "build_date" : "2020-05-28T16:30:01.040088Z",
    "build_snapshot" : false,
    "lucene_version" : "8.5.1",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}
Last Updated: 6/22/2020, 7:39:06 AM