ES 的使用

1,打开到对应的x-shell ip ,su XXX ,切换用户, 查看index 。

命令: curl -u root:111111 -XGET http://192.168.31.12:9200/_cat/indices?v

2.创建index:

//查询213索引
curl -u root:111111 -XGET http://172.16.17.213:9200/_cat/indices?v
//查询.action索引 数据
curl -u root:111111  'http://172.16.17.213:9200/test/_search?pretty'
//创建新的索引test
curl -u root:111111  -XPUT 'http://172.16.17.213:9200/test?pretty'
//往test 上添加数据

//删除索引test
curl -u root:111111 -XDELETE 'http://172.16.17.213:9200/test?pretty'

//创建224索引
curl -u elastic:123456 -XPUT 'http://172.16.17.224:9201/test?pretty'
//查询语句224
curl -u elastic:123456 -XGET http://172.16.17.224:9201/_cat/indices?v

//添加数据的语句
curl -u elastic:123456 -XPUT 'http://172.16.17.224:9201/test/Test/3' -d '{
    "name"  : "张三",
    "post_date" : "2019-11-15T14:12:12",
    "message" : 22
}'

//对的
curl -u root:111111 -H "Content-Type: application/json" -XPUT 'http://172.16.17.213:9200/test2/Test/3' -d '{
    "name" : "张三",
    "post_date" : "2019-11-15T14:12:12",
    "message" : "13914528546"
}'

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值