elasticsearch集群中使用head插件

  1. 自行安装nodejs
  2. 安装phantomjs
cd /usr/local/
wget https://github.com/Medium/phantomjs/releases/download/v2.1.1/phantomjs- 2.1.1-linux-x86_64.tar.bz2

安装解压工具并解压

yum install -y bzip2
tar  -jxvf  phantomjs-2.1.1-linux-x86_64.tar.bz2

修改环境变量

vim /etc/profile
#添加
export PATH=$PATH:/usr/local/phantomjs-2.1.1-linux-x86_64/bin

配置生效

source /etc/profile
  1. 安装elasticsearch-head

安装组件

npm install -g grunt-cli
npm install grunt
npm install grunt-contrib-clean
npm install grunt-contrib-concat
npm install  grunt-contrib-watch
npm install  grunt-contrib-connect

安装git

yum -y install git

安装elasticsearch-head

git clone git://github.com/mobz/elasticsearch-head.git
cd elasticsearch-head
npm install -g cnpm --registry=https://registry.npm.taobao.org
  1. elasticsearch-head发现主机,需要在es的配置文件 elasticsearch.yml修改跨域
http.cors.enabled: true
http.cors.allow-origin: "*"
  1. 启动

在elasticsearch-head中执行

#启动时这里如果提示有些组件找不到,找不到的组件重新安装一次
npm run start

浏览器输入http://192.168.247.130:9100/
然后再页面中连接集群地址http://192.168.247.130:9200/
在这里插入图片描述

在kibana下创建索引
这个索引有2个分片和2个副本

PUT /cluster-index
{
  "settings": {
    "number_of_shards": "2",
    "number_of_replicas": "2"
  },
  "mappings": {
    "properties": {
      "name": {
        "type": "text"
      }
    }
  }
}

在这里插入图片描述
查看Elasticsearch head
在这里插入图片描述
这里的索引库有两个分片
分片0的主节点在node3上,分片1的主节点在node2上

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值