美文网首页Elasticsearch
Linux安装配置Elasticsearch

Linux安装配置Elasticsearch

作者: mvpboss1004 | 来源:发表于2017-04-04 10:08 被阅读27次

    一、Ubuntu、Debian通过apt-get安装

    1.下载签名

    wget https://packages.elastic.co/GPG-KEY-elasticsearch
    sudo apt-key add GPG-KEY-elasticsearch
    

    2.添加apt源(以1.5版本为例)

    vim /etc/apt/sources.list,添加

    deb http://packages.elastic.co/elasticsearch/1.5/debian stable main
    

    3.安装

    sudo apt-get update
    sudo apt-get install elasticsearch
    

    二、RedHat、CentOS通过yum安装

    1.下载签名

    rpm --import http://packages.elasticsearch.org/GPG-KEY-elasticsearch
    

    2.添加ES源(以1.5版本为例)

    vim /etc/yum.repos.d/elasticsearch.repo,添加

    [elasticsearch-1.5]
    name=Elasticsearch repository for 1.5.x packages
    baseurl=http://packages.elasticsearch.org/elasticsearch/1.5/centos
    gpgcheck=1
    gpgkey=http://packages.elasticsearch.org/GPG-KEY-elasticsearch
    enabled=1
    

    3.安装

    yum -y install elasticsearch
    

    三、配置

    1.安装head插件

    /usr/share/elasticsearch/bin/plugin -install mobz/elasticsearch-head
    /usr/share/elasticsearch/bin/plugin -install lukas-vlcek/bigdesk
    

    2.单节点ES

    service elasticsearch restart
    

    默认情况下,可以打开以下页面:
    http://localhost:9200/_plugin/head/
    http://localhost:9200/_plugin/bigdesk/

    3.广域网集群ES,198.211.30.26为主节点

    修改/etc/elasticsearch/elasticsearch.yml

    3.1.所有节点均需修改:

    discovery.zen.ping.multicast.enabled: false
    discovery.zen.ping.unicast.hosts: ["198.211.30.26"]
    

    3.2.主节点修改:

    node.master: true
    node.data: false
    

    3.3.数据节点修改:

    node.master: false
    node.data: true
    

    3.4.客户端接入节点修改:

    node.master: false
    node.data: false
    

    3.5.启动ES

    首先启动主节点,然后启动剩余节点

    相关文章

      网友评论

        本文标题:Linux安装配置Elasticsearch

        本文链接:https://www.haomeiwen.com/subject/zlyaottx.html