zoukankan      html  css  js  c++  java
  • ubuntu安装elasticSearch及插件

    原文地址:http://www.niu12.com/article/18

    前提

    1.安装好Java1.8以上环境并配置好JAVA_HOME(elasticsearch运行环境)
    2.node环境6.5以上(插件需要)
    

    安装elastic

    $ wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.5.1.zip
    $ unzip elasticsearch-5.5.1.zip
    $ cd elasticsearch-5.5.1/ 
    $ ./bin/elasticsearch
    如果遇到相关错误请上网自行查询
    

    运行

    $ curl localhost:9200
    // 返回
    {
    "name" : "atntrTf",
    "cluster_name" : "elasticsearch",
    "cluster_uuid" : "tf9250XhQ6ee4h7YI11anA",
    "version" : {
        "number" : "5.5.1",
        "build_hash" : "19c13d0",
        "build_date" : "2017-07-18T20:44:24.823Z",
        "build_snapshot" : false,
        "lucene_version" : "6.6.0"
    },
    "tagline" : "You Know, for Search"
    }
    

    因为我是在虚拟机里跑,所以需要宿主机访问,默认情况下,Elastic 只允许本机访问,如果需要远程访问,可以修改 Elastic 安装目录的config/elasticsearch.yml文件,去掉network.host的注释,将它的值改成0.0.0.0,然后重新启动 Elastic。

    elasticsearch-head插件安装

    $ git clone https://github.com/mobz/elasticsearch-head.git
    
    $ cd elasticsearch-head
    
    $ sudo npm install -g grunt -cli
    
    $ npm run start
    

    出现Started connect web server on http://localhost:9100即可在宿主机访问 我的虚拟机地址是192.168.10.10,访问结果如下图

    记得修改ip地址,es-head连接的是localhost

    发现状态未连接,因为es和es-head属于两个不同的进程,他们之间的访问是有跨域问题,所以需要配置./config/elasticsearch.yml

    # 在末尾添加配置
    $ vim ./config/elasticsearch.yml
    
    http.cors.enabled: true
    http.cors.allow-origin: *
    

    重启es和es-head,访问结果如下图

  • 相关阅读:
    ossec配置使用腾讯企业邮箱告警
    网络排除工具之tcping
    pyenv 安装
    CVE-2020-1472 漏洞检测
    容器技术的核心
    简述 进程、线程、协程的区别 以及应用场景--记录
    php函数使用
    php使用表单post方法进行页面
    CURL方式使用代理访问网站
    nginx下隐藏admin和当前域名下得index.php
  • 原文地址:https://www.cnblogs.com/zhouqi666/p/10417564.html
Copyright © 2011-2022 走看看