账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    mac上启动elasticsearch第二个节点仍然显示第一个节点名启动失败
    36
    0

    问题描述

    物理机:MAC
    安装途径:homebrew

    问题出现的环境背景及自己尝试过哪些方法

    成功启动第一个节点后,想要启动第二个节点,复制了elasticsearch文件夹,并对配置文件进行了修改,进入node2目录后,运行./bin/elasticsearch,启动过程仍然是node1,然后因为node1已存在报错

    目录结构:

    elasticsearch_node1
    elasticsearch_node2

    相关代码

    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配置文件

    cluster.name: my-es
    #主节点
    node.name: node-1
    node.master: true
    network.host: 0.0.0.0
    http.port: 9200
    transport.tcp.port: 9300
    #集群限制节点的个数
    node.max_local_storage_nodes: 10

    node-2配置文件

    cluster.name: my-es
    #主节点
    node.name: node-2
    node.master: false
    network.host: 0.0.0.0
    http.port: 9201
    transport.tcp.port: 9301
    #集群限制节点的个数
    node.max_local_storage_nodes: 10

    不知道是不是和homebrew安装有关?
    我没有在.bash_profile/etc/profile中配置elasticsearch路径,但是homebrew安装完成后,直接可以在命令行使用elasticsearch启动,不知道是否有默认环境变量?导致只能启动一个es节点?

    刚开始接触elasticsearch,有很多不懂。如果您曾经在单机上搭建过elasticsearch多节点,请看看这个问题,万分感谢。

    如果还需要更多信息,请在问题下留言。

    0
    打赏
    收藏
    点击回答
        全部回答
    • 0
    • 更俗 普通会员 1楼
      502 Bad Gateway

      502 Bad Gateway


      nginx
    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部