Can't set up a cluster in Centos7


(張皓翔) #1

Hi everyone, I want to set up a cluster on my Centos7.
and this is my elasticsearch.yml.

---------------------------------- Cluster -----------------------------------
Use a descriptive name for your cluster:
cluster.name: Winoc logger

------------------------------------ Node ------------------------------------
Use a descriptive name for the node:
node.name: Centos1

Add custom attributes to the node:
#node.attr.rack: r1

---------------------------------- Network -----------------------------------
Set the bind address to a specific IP (IPv4 or IPv6):
network.host: 192.168.0.120
transport.host: localhost

Set a custom port for HTTP:
#http.port: 9200

For more information, consult the network module documentation.
----------------------------------- Paths ------------------------------------
Path to directory where to store the data (separate multiple locations by comma):
#path.data: /path/to/data

Path to log files:
#path.logs: /path/to/logs

#discovery.zen.minimum_master_nodes:

For more information, consult the zen discovery module documentation.
---------------------------------- Gateway -----------------------------------
Block initial recovery after a full cluster restart until N nodes are started:
#gateway.recover_after_nodes: 3

For more information, consult the gateway module documentation.
---------------------------------- Various -----------------------------------
Require explicit names when deleting indices:
#action.destructive_requires_name: true

# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when new node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
discovery.zen.ping.unicast.hosts: ["192.168.0.120", "192.168.0.243"]
#
# Prevent the "split brain" by configuring the majority of nodes (total number of master-eligible nodes / 2 + 1):
#
#discovery.zen.minimum_master_nodes:
#
# For more information, consult the zen discovery module documentation.
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
#gateway.recover_after_nodes: 3
#
# For more information, consult the gateway module documentation.
#

log:

another node of elasticsearch.yml has the same cluster name.
but the node can't find each other.

thank you in advance!


(Mark Walkom) #2

Please edit your post and use the code button - </> - to format things. Alternatively, use the markdown style backticks.

It's really hard to read your config as is, which makes it hard to help.

Also, please post logs.


(David Pilato) #3

I think the cluster name is weird. I'm unsure you can have "Spaces" in its name cluster.name: Winoc logger. I'd try to change that probably.

transport.host: localhost means that only local nodes will be able to connect to this node. So You can't form a cluster.


(張皓翔) #4

oh, but if I comment out transport.host: localhost and the Elasticsearch can't run any more.


(David Pilato) #5

Please don't post images of text as they are hardly readable and not searchable.

Instead paste the text and format it with </> icon. Check the preview window.

Please read https://www.elastic.co/guide/en/elasticsearch/reference/current/bootstrap-checks.html


(張皓翔) #6

sorry for that.
if I comment out transport.host: localhost.
There are some problems

[2018-01-15T17:41:58,387][INFO ][o.e.n.Node               ] [Centos1] starting ...
[2018-01-15T17:41:58,482][INFO ][o.e.t.TransportService   ] [Centos1] publish_address {192.168.0.120:9300}, bound_addresses {192.168.0.120:9300}
[2018-01-15T17:41:58,490][INFO ][o.e.b.BootstrapChecks    ] [Centos1] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks
ERROR: [1] bootstrap checks failed
[1]: max number of threads [409] for user [wlogger] is too low, increase to at least [4096]
[2018-01-15T17:41:58,501][INFO ][o.e.n.Node               ] [Centos1] stopping ...
[2018-01-15T17:41:58,550][INFO ][o.e.n.Node               ] [Centos1] stopped
[2018-01-15T17:41:58,550][INFO ][o.e.n.Node               ] [Centos1] closing ...
[2018-01-15T17:41:58,555][INFO ][o.e.n.Node               ] [Centos1] closed

(David Pilato) #7

I answered you already about this.


(張皓翔) #8

sorry, can you give me more hints?

thanks a lot!


(張皓翔) #9

so weird, another node log:

2018-01-15T05:20:05,020][INFO ][o.e.d.z.ZenDiscovery     ] [Centos3] failed to send join request to master [{Centos2}{xRZYgk5bR1WTCdwd4rX3TA}{072YqViAQg6c6B8EJAH-pw}{192.168.0.243}{192.168.0.243:9300}], reason [RemoteTransportException[[Centos2][192.168.0.243:9300][internal:discovery/zen/join]]; nested: ConnectTransportException[[Centos3][127.0.0.1:9300] connect_exception]; nested: IOException[Connection refused: 127.0.0.1/127.0.0.1:9300]; nested: IOException[Connection refused]; ]
[2018-01-15T05:20:08,025][INFO ][o.e.d.z.ZenDiscovery     ] [Centos3] failed to send join request to master [{Centos2}{xRZYgk5bR1WTCdwd4rX3TA}{072YqViAQg6c6B8EJAH-pw}{192.168.0.243}{192.168.0.243:9300}], reason [RemoteTransportException[[Centos2][192.168.0.243:9300][internal:discovery/zen/join]]; nested: ConnectTransportException[[Centos3][127.0.0.1:9300] connect_exception]; nested: IOException[Connection refused: 127.0.0.1/127.0.0.1:9300]; nested: IOException[Connection refused]; ]

I think the problem is transport.host: localhost , but if I comment out it, and it can't run.


(David Pilato) #10

I wrote:

Please read https://www.elastic.co/guide/en/elasticsearch/reference/current/bootstrap-checks.html


(system) #11

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.