ElasticSearch 5.x & 2.x弹性插件头安装(mac)

一、安装包下载

下载地址:ElasticSearch5.6.1
下载地址:ElasticSearch-header
下载地址:node.js
二、安装node
直接一路下一步即可。验证安装情况

$ node -v
$ npm -v

三、安装elasticsearch
修改elasticsearch.yml配置文件
编辑elasticsearch-5.1.1/config/elasticsearch.yml,加入以下内容:

http.cors.enabled: true
http.cors.allow-origin: "*"

打开elasticsearch-head-master/Gruntfile.js,找到下面connect属性,新增hostname: ‘0.0.0.0’:

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

至此elasticsearch配置完成。
四、安装elasticsearch-head
分两种方式:
第一种:
咕噜是一个很方便的构建工具,可以进行打包压缩,测试,执行等等的工作,5.0里的头部插件就是通过咕噜启动。因此需要安装一下咕噜:npm install –g grunt–cli
启动 在elasticsearch-head-master/目录下,运行启动命令:grunt server
打开浏览器输入:IP:9100

第二种:

1、git clone git://github.com/mobz/elasticsearch-head.git
2、cd elasticsearch-head
3、npm install
4、npm run start
5open [HTTP://本地主机:9100 /]

这将启动在端口9100上运行的本地Web服务器,用于弹性搜索头
五、后台启动elasticsearch-head
后台启动关闭grunt server命令;

后台启动
nohup grunt server &exit
关闭
ps aux|grep head
kill 进程号

另外如果需要单独安装npm可以:

npm install

如果速度太慢可以使用国内镜像

 npm install -g cnpm --  registry=https://registry.npm.taobao.org

六、2.x版本安装

解压运行

cd到安装目录
sudo bin / elasticsearch
验证

浏览器中访问http:// localhost:9200 /,看到一个json结果集,表明安装成功。
这里推荐使用弹性搜索头

$/bin/plugin -install mobz/elasticsearch-head

如果提示

ERROR: unknown command [-install]. Use [-h] option to list available commands

使用

elasticsearch/bin/plugin install mobz/elasticsearch-head

验证:访问地址是http://{你的ip地址}:9200/_plugin/head/

猜你喜欢

转载自blog.csdn.net/m0_37556124/article/details/78059873
今日推荐