zoukankan      html  css  js  c++  java
  • elasticsearch5.3安装插件head

    1、下载并配置nodejs
    cd /usr/local/src/
    wget https://nodejs.org/dist/v6.9.5/node-v6.9.5-linux-x64.tar.xz && xz -d node-v6.9.5-linux-x64.tar.xz
    tar -xvf node-v6.9.5-linux-x64.tar -C /usr/local/
    ln -s /usr/local/node-v6.9.5-linux-x64/bin/node /usr/bin/node
    ln -s /usr/local/node-v6.9.5-linux-x64/bin/npm /usr/bin/npm
    node -v && npm -v

    2、安装head插件
    npm install -g grunt-cli
    ln -s /usr/local/node-v6.9.5-linux-x64/lib/node_modules/grunt-cli/bin/grunt /usr/bin/grunt

    3、下载并配置head
    cd /var/lib/elasticsearch
    git clone git://github.com/mobz/elasticsearch-head.git
    chown -R elasticsearch:elasticsearch elasticsearch-head/
    配置elasticsearch允许head插件跨域访问es:

    http.cors.enabled: true
    http.cors.allow-origin: "*"
    4、安装head
    cd /var/lib/elasticsearch/elasticsearch-head/
    npm install
    #安装完成后可能有一些报错,不影响使用,报错原因未知,本人对nodejs不了解,github上有相近的问题,但并未解决。解决方法如下:
    (1) 查看报错信息”Error: Cannot find module '/var/lib/elasticsearch/elasticsearch-head/node_modules/phantomjs-prebuilt/install.js'”,未找到” phantomjs-prebuilt/install.js”文件;
    (2) 采取比较土的办法,将完整的”phantomjs-prebuilt/”目录上传到相应位置,重新执行”npm install”,无报错。

    由于无法上传附件,附上下载git地址:git clone https://github.com/ariya/phantomjs.git

    5、配置head文件
    /var/lib/elasticsearch/elasticsearch-head/_site/app.js

    /var/lib/elasticsearch/elasticsearch-head/Gruntfile.js

    6、启动服务
    #启动head插件,需要到head目录下
    #可以采用screen放在后台运行,不然退出ssh后grunt进程就关闭了。
    grunt server &

    7、服务访问:
    http://171.16.45.243:9100/

  • 相关阅读:
    URAL 2067 Friends and Berries (推理,数学)
    URAL 2070 Interesting Numbers (找规律)
    URAL 2073 Log Files (模拟)
    URAL 2069 Hard Rock (最短路)
    URAL 2068 Game of Nuts (博弈)
    URAL 2066 Simple Expression (水题,暴力)
    URAL 2065 Different Sums (找规律)
    UVa 1640 The Counting Problem (数学,区间计数)
    UVa 1630 Folding (区间DP)
    UVa 1629 Cake slicing (记忆化搜索)
  • 原文地址:https://www.cnblogs.com/xiaofei1205/p/6704239.html
Copyright © 2011-2022 走看看