后端开发小站

分类


标签


[elasticsearch] 集群搭建

熊毅熊毅

相关内容下载:

1、elasticsearch-6.3.1

2、kibana-6.3.1

1、服务器环境准备

服务器A:公网IP[ip1],非root用户[elastic1],运行路径[path1]

服务器B:公网IP[ip2],非root用户[elastic2],运行路径[path2]

2、配置文件修改

vi [path1]/elasticsearch-6.3.1/config/elasticsearch.yml
network.host: 0.0.0.0
network.publish_host: [ip1]
discovery.zen.ping.unicast.hosts: ["[ip1]","[ip2]"]
cluster.name: mycluster
node.name: NODE1
node.master: true
node.data: true
discovery.zen.minimum_master_nodes: 1
vi [path2]/elasticsearch-6.3.1/config/elasticsearch.yml
network.host: 0.0.0.0
network.publish_host: [ip2]
discovery.zen.ping.unicast.hosts: ["[ip1]","[ip2]"]
cluster.name: mycluster
node.name: NODE1
node.master: false
node.data: true
discovery.zen.minimum_master_nodes: 1

3、启动elasticsearch

服务器A:

cd [path1]/elasticsearch-6.3.1

./bin/elasticsearch

服务器B:

cd [path2]/elasticsearch-6.3.1

./bin/elasticsearch

4、启动kibana

服务器A:

cd [path1]/kibana-6.3.1-linux-x86_64

./bin/kibana

 

遇到的问题:

1、切换到非root用户
2、chown -R [用户] ./elasticsearch
1、切换为root用户
2、vi /etc/sysctl.conf
增加
fs.file-max=655350
vm.max_map_count=655360
3、vi /etc/security/limits.conf
增加
soft nofile 655350
hard nofile 655350
4、sysctl -p
内存不足,修改ES的虚拟内存
1、vi ./bin/elasticsearch
ES_JAVA_OPTS=”-Xms512m -Xmx512m”

chown -R [用户] ./elasticsearch

因为使用的是云服务器,有内网ip和外网ip,需要指定配置文件中network.publish_host为外网ip。

 

生而为人,必须努力

评论 7
  • sikis izle
    发布

    sikis izle sikis izle

    回复 作者

    Everything is very open with a really clear explanation of the issues. Corrina Milt Ailene


  • web-dl
    发布

    web-dl web-dl

    回复 作者

    You made various fine points there. I did a search on the subject and found nearly all persons will agree with your blog. Wynn Ewart Loesceke


  • torrent
    发布

    torrent torrent

    回复 作者

    There is definately a great deal to find out about this topic. I like all the points you made. Saraann Natal Derwon


  • yify
    发布

    yify yify

    回复 作者

    Well I truly liked reading it. This information provided by you is very constructive for proper planning. Elita Billie Lundgren


  • bedava
    发布

    bedava bedava

    回复 作者

    As I website possessor I believe the content matter here is rattling excellent , appreciate it for your hard work. Benedikta Vasily Hilbert


  • torrent
    发布

    torrent torrent

    回复 作者

    I pay a visit every day some web sites and information sites to read posts, except this webpage provides feature based content. Bree Cullin Anastas


  • bedava
    发布

    bedava bedava

    回复 作者

    I have read so many articles about the blogger lovers however this article is truly a fastidious post, keep it up. Germana Bay Beaner