Start elasticsearch on mac the second node still shows the first node name failed to start

problem description

physical machine: MAC
installation path: homebrew

the environmental background of the problems and what methods you have tried

after successfully starting the first node, you want to start the second node, copy the elasticsearch folder, and modify the configuration file. After entering the node2 directory, run . / bin/elasticsearch . The startup process is still node1, and then an error is reported because node1 already exists

.

directory structure:

elasticsearch_node1
elasticsearch_node2

related codes

chenyaos:elasticsearch_node2 chenyao$ ./bin/elasticsearch
Java HotSpot(TM) 64-Bit Server VM warning: Cannot open file logs/gc.log due to No such file or directory

[2018-10-31T21:18:15,898][INFO ][o.e.n.Node               ] [node-1] initializing ...
[2018-10-31T21:18:15,992][INFO ][o.e.e.NodeEnvironment    ] [node-1] using [1] data paths, mounts [[/ (/dev/disk1s1)]], net usable_space [5.3gb], net total_space [112.8gb], types [apfs]
[2018-10-31T21:18:15,993][INFO ][o.e.e.NodeEnvironment    ] [node-1] heap size [990.7mb], compressed ordinary object pointers [true]
[2018-10-31T21:18:15,996][INFO ][o.e.n.Node               ] [node-1] node name [node-1], node ID [I1EIVYkfRReWOsH9T5h_lg]
[2018-10-31T21:18:15,997][INFO ][o.e.n.Node               ] [node-1] version[6.4.2], pid[29918], build[oss/tar/04711c2/2018-09-26T13:34:09.098244Z], OS[Mac OS X/10.13.6/x86_64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_192/25.192-b12]
[2018-10-31T21:18:15,997][INFO ][o.e.n.Node               ] [node-1] JVM arguments [-Xms1g, -Xmx1g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.io.tmpdir=/var/folders/_f/0q8j9hks5nj45q9clc9mtr9c0000gn/T/elasticsearch.PcoWFoH9, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=data, -XX:ErrorFile=logs/hs_err_pid%p.log, -XX:+PrintGCDetails, -XX:+PrintGCDateStamps, -XX:+PrintTenuringDistribution, -XX:+PrintGCApplicationStoppedTime, -Xloggc:logs/gc.log, -XX:+UseGCLogFileRotation, -XX:NumberOfGCLogFiles=32, -XX:GCLogFileSize=64m, -Des.path.home=/usr/local/Cellar/elasticsearch/6.4.2/libexec, -Des.path.conf=/usr/local/etc/elasticsearch, -Des.distribution.flavor=oss, -Des.distribution.type=tar]
[2018-10-31T21:18:17,596][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [aggs-matrix-stats]
[2018-10-31T21:18:17,602][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [analysis-common]
[2018-10-31T21:18:17,602][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [ingest-common]
[2018-10-31T21:18:17,602][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [lang-expression]
[2018-10-31T21:18:17,604][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [lang-mustache]
[2018-10-31T21:18:17,605][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [lang-painless]
[2018-10-31T21:18:17,606][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [mapper-extras]
[2018-10-31T21:18:17,607][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [parent-join]
[2018-10-31T21:18:17,607][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [percolator]
[2018-10-31T21:18:17,607][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [rank-eval]
[2018-10-31T21:18:17,607][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [reindex]
[2018-10-31T21:18:17,608][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [repository-url]
[2018-10-31T21:18:17,608][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [transport-netty4]
[2018-10-31T21:18:17,608][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [tribe]
[2018-10-31T21:18:17,609][INFO ][o.e.p.PluginsService     ] [node-1] no plugins loaded
[2018-10-31T21:18:22,654][INFO ][o.e.d.DiscoveryModule    ] [node-1] using discovery type [zen]
[2018-10-31T21:18:23,503][INFO ][o.e.n.Node               ] [node-1] initialized
[2018-10-31T21:18:23,504][INFO ][o.e.n.Node               ] [node-1] starting ...
[2018-10-31T21:18:24,036][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [node-1] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: BindTransportException[Failed 

node-1 configuration file

cluster.name: my-es
-sharp
node.name: node-1
node.master: true
network.host: 0.0.0.0
http.port: 9200
transport.tcp.port: 9300
-sharp
node.max_local_storage_nodes: 10

node-2 configuration file

cluster.name: my-es
-sharp
node.name: node-2
node.master: false
network.host: 0.0.0.0
http.port: 9201
transport.tcp.port: 9301
-sharp
node.max_local_storage_nodes: 10

I wonder if it has something to do with homebrew installation?
I did not configure the elasticsearch path in .bash _ profile or / etc/profile , but after the homebrew installation is complete, I can start it directly with elasticsearch on the command line. I wonder if there is a default environment variable? Cause only one es node to be started?

there are a lot of things I don"t understand when I first come into contact with elasticsearch,. If you have ever built elasticsearch multi-nodes on a single machine, please take a look at this question, thank you very much.

if you need more information, please leave a message under the question.

Oct.08,2021

try changing the transport.tcp.port of node-2 to 9300.

Menu