• 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>

  • 相关阅读:
    ORM
    优酷:exec 补充,元类,优酷构架,ORM。
    数据库 事务。
    Python操作mysql
    数据库对表操作的练习题总结。
    ACM-ICPC 2018 南京赛区网络预赛 E. AC Challenge (状压DP)
    CodeForces
    CodeForces
    AcWing 314. 低买 (线性DP)打卡
    AcWing 313. 花店橱窗 (线性DP)打卡
  • 原文地址:https://www.cnblogs.com/zr520/p/6071171.html
Copyright © 2020-2023  润新知