zoukankan      html  css  js  c++  java
  • 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>

  • 相关阅读:
    3-12 初识JWT
    3-11 用户登录信息验证实现
    3-10 公共模块统一测试
    3-9 公共业务异常统一处理
    3-8 公共返回对象封装
    3-7 公共请求对象封装及优雅验证数据实现
    3-6 MD5介绍及用户添加功能实现
    3-5 用户模块数据层构建
    3-4 用户模块构建
    3-3 公共工具模块构建
  • 原文地址:https://www.cnblogs.com/zr520/p/6071171.html
Copyright © 2011-2022 走看看