ES插件 ---- bigdesk、head、 kopf 插入,增加,删除,查询数据

步骤一:部署插件

插件装在哪一台机器上,只能在哪台机器上使用(这里安装在se5机器上面)

1)使用远程 uri 路径可以直接安装

 [root@se5 ~]# cd /usr/share/elasticsearch/bin
[root@se5 bin]# ./plugin  install  \ 
ftp://192.168.1.254/elk/elasticsearch-head-master.zip        //安装head插件

[root@se5 bin]# ./plugin  install  \ 
ftp://192.168.1.254/elk/elasticsearch-kopf-master.zip        //安装kopf插件

[root@se5 bin]# [root@se5 bin]# ./plugin install  \
ftp://192.168.1.254/elk/bigdesk-master.zip
//安装bigdesk插件     


[root@se5 bin]# ./plugin  list        //查看安装的插件
Installed plugins in /usr/share/elasticsearch/plugins:
    - head
    - kopf
    - bigdesk

2)访问head插件

[root@room9pc01 ~]#  firefox http://192.168.1.65:9200/_plugin/head

3)访问kopf插件

[root@room9pc01 ~]#  http://192.168.1.65:9200/_plugin/kopf

4)访问bigdesk插件

[root@room9pc01 ~]#  http://192.168.1.65:9200/_plugin/bigdesk

步骤二:使用head创建index

[root@se5 bin]# curl -X PUT "http://192.168.1.65:9200/index" -d '
> {
>     "settings":{
>     "index":{
>     "number_of_shards":5,        //分片数
>     "number_of_replicas":1        //副本数
>    }
>   }
> }'
{"acknowledged":true}

步骤三:使用kopf查看数据

在这里插入图片描述

插入,增加,删除查询数据

步骤一:增加数据

[root@se5 ~]# locale
[root@se5 ~]# LANG=en_US.UTF-8  //设置编码
[root@se5 ~]# curl -X PUT "http://192.168.1.65:9200/taindex/teacher/1" -d '{
"职业":"诗人",
"名字":"李白",
"称号":"诗仙",
"年代":"唐"
}'
{"_index":"taindex","_type":"teacher","_id":"1","_version":2,"_shards": {"total":2,"successful":2,"failed":0},"created":false}

步骤二:修改数据

[root@se5 ~]# curl -X PUT "http://192.168.1.65:9200/taindex/teacher/1" -d '{
 "doc":{
 "年代": "唐代"
 }
 }'
{"_index":"taindex","_type":"teacher","_id":"1","_version":3,"_shards":{"total":2,"successful":2,"failed":0},"created":false}

步骤三:查询数据

[root@se5 ~]#  curl -X GET "http://192.168.1.65:9200/taindex/teacher/3?pretty"

步骤四:删除数据

[root@se5 ~]# curl -X DELETE "http://192.168.1.65:9200/taindex/teacher/3?pretty"

步骤五:删除索引

[root@se5 bin]# curl -X DELETE http://192.168.1.65:9200/taindex/       //删除索引

[root@se5 bin]# curl -X DELETE http://192.168.1.65:9200/*      //删除所有索引
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值