Kubernetes build ES cluster (use cephfs for storage)

1. Cluster planning

  1. Use cephfs to achieve distributed storage and data persistence
  2. At least three master nodes of the ES cluster are required to prevent split-brain.
  3. Since the master needs to ensure that the host name is fixed and unique during the configuration process, the StatefulSet controller is used to build the master
  4. The node node requires a fixed host name, a fixed physical node, and a local PV on the physical node, so a StatefulSet is required.
  5. Kibana is a stateless service and uses deployment.

Link to the original text of this article: https://blog.csdn.net/xzk9381/article/details/109570974

Two, modify the elasticsearch mirror

In order to achieve unified storage of data by each node of ES and distinguish each node according to the directory name, a directory named after the container host name needs to be created in the container, and the directory is soft-linked with the directory where ES stores the data. When loading the data volume, the directory named after the host name is actually mounted.

And when deploying elasticsearch, it is recommended to configure memlock: true, which requires the system to configure ulimit. Therefore, the image needs to be modified to make it execute automatically in the container.

The contents of the Dockerfile are as follows:

FROM docker.elastic.co/elasticsearch/elasticsearch:7.3.0

MAINTAINER [email protected]

COPY run.sh /
RUN chmod 755 /run.sh

CMD ["/run.sh"]

Guess you like

Origin blog.csdn.net/xzk9381/article/details/109570974