Centos6.5搭建Elasticsearch

ElasticSearch是基于Lucene的搜索服务。支持分布式多用户能力的全文搜索引擎,提供RESTful web接口。Elasticsearch是用Java开发的,Apache旗下开源项目,支持海量数据存储及查询,是当前互联网比较流行的搜索引擎。

安装

1.在官方网站:https://www.elastic.co/downloads/elasticsearch下载elasticsearch-6.2.4.tar.gz

2.将安装包加压到指定目录

tar -zxvf elasticsearch-6.2.4.tar.gz

3.安装JDK(版本为1.8),并设置JAVA_HOME环境变量(这里就不细说了,可以参考网上的教程操作一下就可以了)

4.使用linux命令:

cd bin

./elasticsearch

  

安装插件

1.安装git插件
yum install git

2.安装node,npm

wget http://cdn.npm.taobao.org/dist/node/latest-v4.x/node-v4.4.3-linux-x86.tar.gz 

tar zxvf node-v4.4.3-linux-x86.tar.gz

vim /etc/profile

export NODE_HOME=/usr/local/node/node-v4.4.3-linux-x86
export PATH=$NODE_HOME/bin:$PATH

source /etc/profile

node -v (安装正确的话,显示node版本)
npm -v  (安装正确的话,显示npm版本)

2.安装head 插件
 

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

vim /home/elasticsearch/elasticsearch-head/Gruntfile.js
增加:
connect: {
    server: {
        options: {
            hostname: '0.0.0.0',
            port: 9100,
            base: '.',
            keepalive: true
        }
    }
}

vim /data/docker/elasticsearch/elasticsearch-head/elasticsearch.yml
增加:
http.cors.enabled: true
http.cors.allow-origin: "*"


cd /home/elasticsearch/elasticsearch-head/node_modules/grunt/bin
./grunt server
./grunt server &


3.访问http://localhost:9200/

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值