Elastic学习第一天遇到的问题以及添加的一些操作

1.刚开始安装好了之后,启动之后,

报错:

ERROR: max file descriptors [1024] for elasticsearch process likely too low, increase to at least [65536]

需要设置max file descriptors为65536,出现这个是因为普通的用户是1024的(我机器).网上的答案是说使用ulimint -n修改就可以了,但是我使用这个指令之后。使用指令ulimint-a查看控制台显示确实是是65536,但是启动之后,还是相同的错误。正确的做法应该是直接修改

这个配置文件,在最末尾添加  就ok啦。

2.

创建一个index
curl -XPUT 'localhost:9200/customer?pretty&pretty'

查看所有的index
curl -XGET 'localhost:9200/_cat/indices?v&pretty'

创建一个document domain/{index}/{type}/id
curl -XPUT 'localhost:9200/customer/external/1?pretty&pretty' -d'
{
"name": "John Doe"
}'

查看id为1的document
curl -XGET 'localhost:9200/customer/external/1?pretty&pretty'

删除index
curl -XDELETE 'localhost:9200/customer?pretty&pretty'
查看
curl -XGET 'localhost:9200/_cat/indices?v&pretty'

修改限制:vim /etc/security/limits.conf 修改open file 为63356

curl -XPOST 'localhost:9200/customer/external?pretty&pretty' -d'
{
"name": "Jane Doe"
}'

更新:
curl -XPOST 'localhost:9200/customer/external/1/_update?pretty&pretty' -d'
{
"doc": { "name": "Jane Doe" }
}'

命令的格式:
<REST Verb> /<Index>/<Type>/<ID>

 

posted @ 2016-11-16 19:27  Hotsum  阅读(2269)  评论(0编辑  收藏  举报