完整elasticsearch安装及其插件安装

一、elasticsearch安装
1、官网下载安装包并上传并解压
2、es下建立data和logs目录
3、编辑conf/elasticsearch.yml文件
    cluster:cluster.name:hlh-app
    node:node.name:node-248
    paths:    path.data:
        path.logs:
    memory:bootstrap.memory_lock:false
        bootstrap.system_call_filter:false
    network: network.host:192.168.102.248
    discovery:discovery.zen.ping.unicast.hosts:["hlh001"]
4、编辑/etc/security/limits.conf添加内容
    * soft nofile 65536
    * hard nofile 131072
    * soft nproc 2048
    * hard nproc 4096
5、切换root用户,编辑/etc/security/limits:d/90-nproc.conf
    修改*soft nproc 1024
      为*soft nproc 2048
6、root用户,编辑/etc/sysctl.conf添加
    vm.max_map_count=655360
    并执行命令:sysctl -p
7、启动,root不可以启动,./bin/elasticsearch
   浏览器访问:hlh001:9200

二、elasticsearch插件安装
1、下载插件 ---> https://github.com/mobz/elasticsearch-head
   下载node.js ---> https://nodejs.org/dist/   ---> node-v6.9.2.tar.xz
   上传并解压uzip elasticsearch-head-master.zip -d /opt/module
2、配置nodejs环境变量/etc/profile source一下
    node -v
    npm -v
3、查看head目录下有无node_modules/grunt目录
    没有则执行创建
    npm install grunt --save
4、安装head插件npm install -g cnpm --registry=registry.npm.taobao.org
5、安装grunt
    npm install -g grunt-cli
6、编辑Gruntfile.js 文件93行options里面添加
    hostname:'0.0.0.0',
7、检查head目录下是否存在base文件夹
   没有就将_site下的base文件夹及其内容复制到head根目录下
    head]$ mkdir base
    _site]$ cp base/* ../base/    
8、启动grunt server -d提示有些模块没有安装,执行
    npm install grunt-contrib-clean -registry=https://registry.npm.taobao.org
    npm install grunt-contrib-concat -registry=https://registry.npm.taobao.org
    npm install grunt-contrib-watch -registry=https://registry.npm.taobao.org
    npm install grunt-contrib-connect -registry=https://registry.npm.taobao.org
    npm install grunt-contrib-copy -registry=https://registry.npm.taobao.org
    npm install grunt-contrib-jasmine -registry=https://registry.npm.taobao.org
    最后一个可能安装不成功,但是不影响使用
    启动grunt server -d
    访问浏览器hlh001:9100发现集群未连接
9、在elasticsearch/conf路径下编辑elasticsearch.yml添加跨域访问
    http.cors.enabled:true
    http.cors.allow-origin:"*"
    启动elasticsearch
10、重启head插件访问浏览器就可以了
 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值