Elasticsearch是面向文档(document oriented)的,这意味着它可以存储整个对象或文档(document)。

    它不仅仅是存储,还会
    索引(index)**每个文档的内容使之可以被搜索,你可以对文档(而非成行成列的数据)进行索引、搜索、排序、过滤。这种理解数据的方式与以往完全不同,这也是Elasticsearch能够执行复杂的全文搜索的原因之一。

    1. [依赖]
    2. JDK && NODEJS
    3. # download
    4. : https://www.elastic.co/cn/downloads/elasticsearch
    5. [安装]
    6. wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.2.0-linux-x86_64.tar.gz
    7. tar -zxvf elasticsearch-7.2.0-linux-x86_64.tar.gz -C /usr
    8. cd elasticsearch-7.2.0
    9. [创建用户]
    10. // Elasticsearch 可以执行脚本文件, 为了安全性, 默认不允许通过 root 用户启动服务
    11. groupadd es && useradd es -g es -p esroot # 增加 es 组, 并提添加es用户到该组
    12. chown -R es:es elasticsearch-7.2.0/ # 给用户组设置目录权限
    13. su es # 切换用户
    14. [run]
    15. : ./bin/elasticsearch -d
    16. // https://www.extlight.com/2017/09/27/Elasticsearch-%E5%9F%BA%E7%A1%80%E5%85%A5%E9%97%A8/
    17. // https://www.cnblogs.com/dreamroute/p/8484457.html
    18. // http://www.ruanyifeng.com/blog/2017/08/elasticsearch.html
    1. [远程访问,需要修改其配置文件]
    2. -> vim config/elasticsearch.yml
    3. - network.host: 0.0.0.0
    4. [ERROR]
    5. ERROR: [4] bootstrap checks failed
    6. [1]: max file descriptors [4096] for elasticsearch process is too low,
    7. increase to at least [65535]
    8. # 原因:无法创建本地文件问题, 用户最大可创建文件数太小
    9. # vim /etc/security/limits.conf
    10. * soft nofile 65536
    11. * hard nofile 131072
    12. * soft nproc 2048
    13. * hard nproc 4096
    14. # * 代表Linux所有用户名称, 保存、退出、重新登录才可生效
    15. # ulimit -n 65536
    16. [2]: max number of threads [3802] for user [es] is too low, increase to at least [4096]
    17. # 原因:无法创建本地线程问题,用户最大可创建线程数太小
    18. # vim /etc/security/limits.d/90-nproc.conf
    19. -> vim /etc/security/limits.conf
    20. * soft nproc 4096
    21. [3]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
    22. # 原因:最大虚拟内存太小
    23. # vim /etc/sysctl.conf
    24. - vm.max_map_count=262144
    25. - sysctl -p
    26. [4]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
    27. -> vim config/elasticsearch.yml
    28. cluster.initial_master_nodes: ["node-1"]