ElasticSearch5.0.2配置head

来源:互联网 发布:阿里云备案拍照点分布 编辑:程序博客网 时间:2024/05/21 14:02

下载安装elasticsearch

  • elasticsearch官网下载
    解压到本地软件安装目录,将启动文件目录添加到系统环境中;
    export PATH=$PATH:/home/xhy/software/elasticsearch-5.0.2/bin
  • 打开elasticsearch,在命令行中输入curl http://localhost:9200/可以访问,出现 “tagline” : “You Know, for Search”即为安装 成功;

安装Head插件

  • 首先在elasticsearch的elasticsearch.yml 文件增加配置
    http.cors.enabled: true
    http.cors.allow-origin: "*"
  • 5.0之后的elasticsearch,head插件为单独服务运行;

    • git clone git://github.com/mobz/elasticsearch-head.git
      cd elasticsearch-head
      npm install

    • 打开Gruntfile.js,添加一句
      connect: {
      server: {
      options: {
      hostname:'0.0.0.0',

    • 运行 grunt server
      出现访问即为成功
    • open http://localhost:9100/

    如果grunt server没有启动,输入grunt -V查看软件是否都安装成功;
    npm install –g grunt–cli
    如果在elasticsearch-head目录下node_modules/grunt下如果没有grunt二进制程序,需要执行
    npm install grunt --save

0 0
原创粉丝点击