Elasticsearch无法在AWS kubernetes集群上启动

时间:2018-08-24 19:10:12

标签: elasticsearch kubernetes amazon-eks

我正在运行kubernetes 1.10的AWS EKS上运行kubernetes集群。 我正在按照本指南在我的集群中部署elasticsearch elasticsearch Kubernetes

我第一次部署它时,一切正常。现在,当我重新部署它时,出现以下错误。

ERROR: [2] bootstrap checks failed
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
[2018-08-24T18:07:28,448][INFO ][o.e.n.Node               ] [es-master-6987757898-5pzz9] stopping ...
[2018-08-24T18:07:28,534][INFO ][o.e.n.Node               ] [es-master-6987757898-5pzz9] stopped
[2018-08-24T18:07:28,534][INFO ][o.e.n.Node               ] [es-master-6987757898-5pzz9] closing ...
[2018-08-24T18:07:28,555][INFO ][o.e.n.Node               ] [es-master-6987757898-5pzz9] closed

这是我的部署文件。

apiVersion: apps/v1beta1
kind: Deployment
metadata:
  name: es-master
  labels:
    component: elasticsearch
    role: master
spec:
  replicas: 3
  template:
    metadata:
      labels:
        component: elasticsearch
        role: master
    spec:
      initContainers:
      - name: init-sysctl
        image: busybox:1.27.2
        command:
        - sysctl
        - -w
        - vm.max_map_count=262144
        securityContext:
          privileged: true
      containers:
      - name: es-master
        image: quay.io/pires/docker-elasticsearch-kubernetes:6.3.2
        env:
        - name: NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: NODE_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        - name: CLUSTER_NAME
          value: myesdb
        - name: NUMBER_OF_MASTERS
          value: "2"
        - name: NODE_MASTER
          value: "true"
        - name: NODE_INGEST
          value: "false"
        - name: NODE_DATA
          value: "false"
        - name: HTTP_ENABLE
          value: "false"
        - name: ES_JAVA_OPTS
          value: -Xms512m -Xmx512m
        - name: NETWORK_HOST
          value: "0.0.0.0"
        - name: PROCESSORS
          valueFrom:
            resourceFieldRef:
              resource: limits.cpu
        resources:
          requests:
            cpu: 0.25
          limits:
            cpu: 1
        ports:
        - containerPort: 9300
          name: transport
        livenessProbe:
          tcpSocket:
            port: transport
          initialDelaySeconds: 20
          periodSeconds: 10
        volumeMounts:
        - name: storage
          mountPath: /data
      volumes:
          - emptyDir:
              medium: ""
            name: "storage"

我看到很多帖子都在谈论增加价值,但是我不确定该怎么做。任何帮助,将不胜感激。

3 个答案:

答案 0 :(得分:0)

更新文件'/etc/docker/daemon.json'中的default-ulimit参数

  "default-ulimits": {
    "nofile": {
      "Name": "nofile",
      "Soft": 65536,
      "Hard": 65536
    }
  }

并重新启动Docker守护程序。

答案 1 :(得分:0)

只想附加到this issue

如果通过eksctl创建EKS集群,则可以附加到NodeGroup创建yaml:

 preBootstrapCommand:
      - "sed -i -e 's/1024:4096/65536:65536/g' /etc/sysconfig/docker"
      - "systemctl restart docker"

这将通过修复docker daemon配置解决新创建的集群的问题。

答案 2 :(得分:0)

这是使用EKS设置EFK堆栈对我唯一有效的方法。将此添加到import pandas as pd import numpy as np import io df = pd.DataFrame(np.random.randint(0,100,size=(4,4))) buffer = io.BytesIO() df.to_pickle(buffer) print(buffer.closed) 下的节点组创建YAML文件中。然后创建您的节点组并在其上应用ES容器。

nodeGroups: