zoukankan      html  css  js  c++  java
  • elasticsearch-head 配置

    elasticsearch-head

    install node.js

    1. Download node.js:

    2. 将下载的包,解压并配置环境变量

     vim /etc/profile 
     ​
     #set for nodejs
     export NODE_HOME=/opt/modules/node-v10.9.0-linux-x64
     export PATH=$NODE_HOME/bin:$PATH
     ​
    1. Install cnpm npm install cnpm -g --registry=https://registry.npm.taobao.org

    2. npm taobao mirror

     1.得到原本的镜像地址
     npm get registry
     https://registry.npmjs.org/
     设成淘宝的
     npm config set registry http://registry.npm.taobao.org/
     yarn config set registry http://registry.npm.taobao.org/
     2.换成原来的
     npm config set registry https://registry.npmjs.org/
     ​
    1. 修改Gruntfile.js

     [fan@master elasticsearch-head]$ cd /opt/modules/elasticsearch-head  
     [fan@master elasticsearch-head]$ vim Gruntfile.js
    • 在connect-->server-->options下面添加:hostname:'*', 允许所有ip访问。

     connect: {
                            server: {
                                    options: {
                                            hostname:'*',
                                            port: 9100,
                                            base: '.',
                                            keepalive: true
                                    }
                            }
                    }
     ​
    1. 修改默认连接地址

     [fan@master _site]$ cd /opt/modules/elasticsearch-head/_site
     [fan@master _site]$ vim app.js
     ​
     # 将其中的localhost修改为自己的ip地址
     this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://localhost:9200";
     ↓
     this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://master:9200";
     ​
    1. 配置elasticsearch允许跨域访问

     [fan@master config]$ cd /opt/modules/elasticsearch-6.5.0/config
     [fan@master config]$ sudo vim elasticsearch.yml
     ​
     # 在文件末尾追加,配置elasticsearch允许跨域访问
     http.cors.enabled:true
     http.cors.allow-origin:"*"
     ​
    1. 打开9100端口

     # 如果使用的是centos7,则执行
     [fan@master elasticsearch-head]$ firewall-cmd --zone=public --add-port=9100/tcp --parmanent
    1. 启动elasticsearch

    2. 启动 elasticsearch-head

    npm run start &
  • 相关阅读:
    BZOJ.4842.[NEERC2016]Delight for a Cat(费用流)
    LOJ.6060.[2017山东一轮集训Day1/SDWC2018Day1]Set(线性基)
    BZOJ.5319.[JSOI2018]军训列队(主席树)
    BZOJ.4212.神牛的养成计划(Trie 可持久化Trie)
    HDU.5385.The path(构造)
    HDU.4903.The only survival(组合 计数)
    Codeforces.1043F.Make It One(DP 容斥)
    BZOJ.5110.[CodePlus2017]Yazid 的新生舞会(线段树/树状数组/分治)
    洛谷.3676.小清新数据结构题(树链剖分 树状数组)
    BZOJ.4598.[SDOI2016]模式字符串(点分治 Hash)
  • 原文地址:https://www.cnblogs.com/gaoyanbing/p/13921150.html
Copyright © 2011-2022 走看看