How to config Single node for Single Cluster (Stan

2020-05-14 03:33发布

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 will only available to my server. It will not be accessible to other's server.

My current scenario these indexes are available to other servers (the servers are formed in a cluster), and they can make any changes to my indexes. But I don't want it.

I went through some other blogs but not getting best solution. So can you please let me know steps for same?

9条回答
SAY GOODBYE
2楼-- · 2020-05-14 04:23

Here's relevant info for ElasticSearch 5:

According to changelog, to enable local mode on ES 5 you need to add transport.type: local to your elasticsearch.yml instead of node.local: true.

查看更多
闹够了就滚
3楼-- · 2020-05-14 04:28

If you're using a network transport in your code, this won't work, as node.local gives you a LocalTransport only:

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-transport.html#_local_transport

The trick then is to set

discovery.zen.ping.multicast: false

in your elasticsearch.yml which will stop your node looking for any other nodes.

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-discovery-zen.html#multicast

I'm not sure if this prevents other nodes from discovering yours though; I only needed this to affect a group of nodes with the same settings on the same network.

查看更多
兄弟一词,经得起流年.
4楼-- · 2020-05-14 04:32

This solve your problem:

PUT /_all/_settings
{"index.number_of_replicas":0}

Tested with ES version 5.

查看更多
登录 后发表回答