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>

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM