• 在Linux上安装Elasticsearch Head工具.md


    在Linux上安装Elasticsearch Head工具

    1、修改elasticsearch的参数

    编辑elasticsearch的配置文件elasticsearch.yml

    $ vim /data/elasticsearch/elasticsearch-5.5.3/config/elasticsearch.yml
    

    添加如下配置

    # 增加新的参数,这样head插件可以访问es
    http.cors.enabled: true
    http.cors.allow-origin: "*"
    

    重启elasticsearch服务

    2、安装node 和 安装grunt

    3、修改head源码

    head下载地址https://github.com/mobz/elasticsearch-head

    下载下来的安装包elasticsearch-head-master.zip,上传到/data/elasticsearch/目录

    由于head的代码还是2.6版本的,直接执行有很多限制,比如无法跨机器访问。因此需要用户修改两个地方:

    修改服务器监听地址

    目录:head/Gruntfile.js

    connect: {
        server: {
            options: {
                port: 9100,
                hostname: '*',
                base: '.',
                keepalive: true
            }
        }
    }
    

    增加hostname属性,设置为*

    修改连接地址:

    目录:head/_site/app.js

    修改head的连接地址:

    this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://localhost:9200";
    

    把localhost修改成你es的服务器地址,如:

    this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://10.10.10.10:9200";
    

    4、运行head

    首先开启elasticsearch。

    然后在head目录中,执行npm install下载以来的包:

    cnpm install
    

    最后,启动nodejs

    grunt server
    

    访问:http://192.168.1.124:9100/

    这个时候,访问http://xxx:9100就可以访问head插件了. image

    5、后台启动elasticsearch-head

    后台启动grunt server命令;

    nohup grunt server &exit
    
    nohup grunt server &
    

    如果想关闭head插件,使用Linux查找进程命令:

    ps aux|grep head
    

    结束进程:

    kill进程号

    参考

    head官方文档 https://github.com/mobz/elasticsearch-head#running-with-built-in-server
    http://www.cnblogs.com/xing901022/p/6030296.html
    http://blog.csdn.net/hit0803107/article/details/54669909
    

    5、权限

    6、设置防火墙

    7、开机启动

  • 相关阅读:
    2,进程----multiprocessing模块介绍
    1,进程----进程理论知识
    对ORM的理解
    对queryset的理解
    个人总结-10-代码测试整合
    个人总结-9-session的使用,十天免登陆
    个人总结-8-重新写注册和登录界面
    个人总结-7- 实现图片在MySQL数据库中的存储,取出以及显示在jsp页面上
    从人机交互看对搜狗输入法的使用感受
    个人总结6-验证码制作总结
  • 原文地址:https://www.cnblogs.com/cheyunhua/p/8087665.html
Copyright © 2020-2023  润新知