1、配置服务 ip 和 端口

进入 elasticsearch 安装目录,打开 config/elasticsearch.yml 配置 net.host 和 http.port

net.host: 0.0.0.0

http.port: 

kibana 外网访问设置:

# vi kibana-7.3.0-linux-x86_64/config/kibana.yml

server.host: "0.0.0.0"

2、坑

(1)用户
Linux 下不要使用 root 用户运行 Elasticsearch, 否则会报异常 can not run elasticsearch as root

(2)引导检查

如果你是使用 .zip 或 .tar.gz 安装包,有些配置需要手工配置,否则将导致启动失败,如:

ERROR: [] bootstrap checks failed
[]: max file descriptors [] for elasticsearch process is too low, increase to at least []
[]: max virtual memory areas vm.max_map_count [] is too low, increase to at least []
[]: 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

在 Elasticsearch 以前的版本中,其中的一些配置错误被记录为警告信息。可以理解的是,用户有时会忽略这些日志消息。为了确保这些设置受到应有的重视,Elasticsearch在启动之前会做一些检查 Bootstrap Checks | Elasticsearch Reference [7.0] | Elastic。这些 启动检查 Important Elasticsearch configuration | Elasticsearch Reference [7.0] | Elastic 会检测 Elasticsearch 和系统的各种设置,并比较与那些为值是否是 Elasticsearch 的操作安全值。如果 Elasticsearch 处于开发模式,任何启动检失败被记录为 Elasticsearch 警告日志。如果 Elasticsearch 是在生产模式下,任何启动检查失败会导致 Elasticsearch 拒绝启动。

要解决以上问题,需进行如下配置:

  • 文件描述符配置

    • 临时生效

      • 使用 root 用户
      • 运行 ulimit -n 65536
    • 永久生效
      • 使用 root 用户
      • 进入 /etc/security/limits.conf
      • 添加一行 user - nofile 65536
  • 虚拟内存配置
    • 临时生效

      • 使用 root 用户
      • 运行 sysctl -w vm.max_map_count=262144
    • 永久生效
      • 使用 root 用户
      • 进入 /etc/sysctl.conf
      • 添加或更新一行 vm.max_map_count=262144
  • 自动发现配置
    • 单节点
    • 进入 elasticsearch 安装目录,打开 config/elasticsearch.yml
    • 添加或更新一行 discovery.type: single-node

 3、JVM内存大小指定太大,但本机内存不够用(主要还是没钱):

[root@file elasticsearch-7.1.]# ./bin/elasticsearch
Java HotSpot(TM) -Bit Server VM warning: INFO: os::commit_memory(0x00000000c5330000, , ) failed; error='Cannot allocate memory' (errno
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map bytes for committing reserved memory.
# An error report file with more information is saved as:
# logs/hs_err_pid27766.log

解决:

# 修改jvm.options文件配置即可,从1g改成了100m

# Xms represents the initial size of total heap space
# Xmx represents the maximum size of total heap space -Xms100m
-Xmx100m

最新文章

  1. 深入.net(继承)
  2. Mysql中mysqldump命令使用详解
  3. Masonry学习分享
  4. [转载]百度编辑器-Ueditor使用
  5. nginx try_files命令
  6. HDU 5805 NanoApe Loves Sequence (思维题) BestCoder Round #86 1002
  7. 手写PE文件(二)
  8. iOS本地数据存取
  9. iOS开发——数据持久化Swift篇&通用文件存储
  10. 安装MYSQL 出现Error 1045 access denied 的解决方法
  11. Android创建启动画面[转]
  12. U盘为什么还有剩余空间,但却提示说空间不够
  13. 【前端单元测试入门05】react的单元测试之jest
  14. cpp typename关键字
  15. 学习STM32,你不得不了解的五大嵌入式操作系统
  16. Java 笔记——在 IDEA 中使用 Maven 配置和使用 MyBatis
  17. 【教程】ubuntu下安装NFS服务器
  18. iOS App中第一次运行添加半透明新手指引
  19. 启动ECLIPSE时,提示failed to create the java virtual machine
  20. hadoop2.x学习笔记(一):YARN

热门文章

  1. VTORRAAYY ws+tls+nginx config
  2. 用实例的方式去理解storm的并发度
  3. django国际化的简单设置
  4. ubuntu彻底删除git
  5. Zabbix trigger(触发器)设置
  6. c#使用 StackExchange.Redis 封装 RedisHelper
  7. java中list和map的底层实现原理
  8. CF827D Best Edge Weight[最小生成树+树剖/LCT/(可并堆/set启发式合并+倍增)]
  9. qt 防止应用重复启动
  10. assert 笔记