How to config Single node for Single Cluster (Standalone Cluster) ElasticSearch

后端 未结 9 617
一向
一向 2021-01-30 17:13

I installed elastic search in my local machine, I want to configure it as the only one single node in the cluster(Standalone Server). it means whenever I create a new index, it

相关标签:
9条回答
  • 2021-01-30 17:31

    I wanted to do this without having to write/overwrite an elasticsearch.yml in my container. Here it is without a config file

    Set an environment variable prior to starting elasticsearch:

    discovery.type=single-node

    https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html

    0 讨论(0)
  • 2021-01-30 17:35

    All of these didn´t help me (and I sadly didn´t read the answer of bhdrkn). The thing that worked for me was to change elasticsearch´s cluster-name everytime I need to have a separate instance, where new nodes aren´t added automatically via multicast.

    Just change cluster.name: {{ elasticsearch.clustername }} in elasticsearch.yml, e.g. via Ansible. This is particulary helpful, when building separate Stages like Dev, QA and Production (which is a standard usecase in enterprise-environments).

    And if you´re using logstash to get your data into elasticsearch, don´t forget to put the same cluster-name into the output-section, like:

    output {
        elasticsearch {
            cluster => "{{ elasticsearch.clustername }}"
        }
    }
    

    Otherwise your "logstash-*"-index will not be build correctly...

    0 讨论(0)
  • 2021-01-30 17:36

    In the config file, add:

    • network.host: 0.0.0.0 [in Network settings]
    • discovery.type: single-node [in Discovery and Cluster formation settings]
    0 讨论(0)
提交回复
热议问题