elasticsearch单机版安装

1 篇文章 0 订阅
1 篇文章 0 订阅

下载elasticsearch

从华为开源镜像云上下载,下载速度很快
es6.8版本要求jdk1.8,es7.3要求jdk11
我们使用jdk6,下载es6.8

ES安装

  • 解压es包
  • tar -zxf
  • es 只能使用非root账号启动 ,需要对启动用户赋es文件夹的读写执行权限
  • cd bin
  • ./elasticsearch

ES配置

  • 绑定ip- network配置
    • 默认只有本机能够访问es
    • 配置为0.0.0.0 为所有机器都能访问
    • 允许指定多个ip访问时,空格间隔
  • network.bind_host
    绑定允许访问的ip,可以为多个
  • network.publish_host
    发布地址,只能是一个
    启动报错
    ERROR: [3] bootstrap checks failed
    [1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
    [2]: max number of threads [1024] for user [caogt] is too low, increase to at least [4096]
    [3]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
    错误1 :当前用户的打开文件句柄数太小,至少需要65535个
    解决方式:
    vi /etc/security/limits.conf
    增加如下:号后有空格
    *hard nofile 65536
    *soft nofile 65536
    *表示所有用户
    问题2 : 当前用户的线程数最少4096个
    解决方式
    vi /etc/security/limits.d/90-nproc.conf
    增加如下:号后有空格
    *soft nproc 4096
    问题3 :虚拟内存太小,至少262144
    解决方式
    vi /etc/sysctl.conf
    添加
    vm.max_map_count=262144

验证

  • 在本机使用curl访问
    curl http://192.168.194.134:9200
    没有绑定时,不能使用localhost
  • 在network配置中允许的机器上访问
    curl http://192.168.194.134:9200
    返回
    {
    “name” : “AIFkGLa”,
    “cluster_name” : “elasticsearch”,
    “cluster_uuid” : “3cgO5MBAQmGF8z0aFmxdaw”,
    “version” : {
    “number” : “6.8.3”,
    “build_flavor” : “default”,
    “build_type” : “tar”,
    “build_hash” : “0c48c0e”,
    “build_date” : “2019-08-29T19:05:24.312154Z”,
    “build_snapshot” : false,
    “lucene_version” : “7.7.0”,
    “minimum_wire_compatibility_version” : “5.6.0”,
    “minimum_index_compatibility_version” : “5.0.0”
    },
    “tagline” : “You Know, for Search”
    }
  • 健康检查
    http://192.168.194.134:9200/_cat/health?v
    返回
    epoch timestamp cluster status node.total node.data shards pri relo init unassign pending_tasks max_task_wait_time active_shards_percent
    1587455430 07:50:30 elasticsearch green 1 1 0 0 0 0 0 0 - 100.0%
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值