Linux下安装Elasticsearch的步骤

本篇内容主要讲解“Linux下安装Elasticsearch的步骤”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“Linux下安装Elasticsearch的步骤”吧!

创新互联公司基于分布式IDC数据中心构建的平台为众多户提供西云机房 四川大带宽租用 成都机柜租用 成都服务器租用。

安装部署

1. Linux安装

下载地址:https://www.elastic.co/cn/downloads/past-releases#elasticsearch

步骤一:上传Linux、解压

上传Linux服务器:
rz Elasticsearch 6.7.2

解压Es:
sudo tar xvf  Elasticsearch 6.7.2

步骤二:修改配置文件

步骤三:启动Es

[dev@lihuan1-dev.bj1.haodf.net elasticsearch-6.7.2]$ ./bin/elasticsearch

备注:后台启动
sh elasticsearch.sh  &
nohup sh elasticsearch &
nohup sh elasticsearch.sh &

问题1:java.nio.file.AccessDeniedException:Exception in thread "main" java.nio.file.AccessDeniedException: /home/elasticsearch/elasticsearch-6.7.2/config/jvm.options

原因:当前用户没有执行权限 

权限不足:[dev@lihuan1-dev.bj1.haodf.net elasticsearch-6.7.2]$ chown -R dev:dev elasticsearch-6.7.2

问题2: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144] 

原因:用户拥有的内存权限太小,至少需要262144。

解决方案:方案一

  • 切换到root用户

  • 执行命令:sysctl -w vm.max_map_count=262144

  • 查看结果:sysctl -a|grep vm.max_map_count

  • 显示:vm.max_map_count = 262144

解决方案:方案二

[dev@lihuan1-dev.bj1.haodf.net elasticsearch-6.7.2]$ sudo vim /etc/sysctl.conf

  vm.max_map_count=655360

[dev@lihuan1-dev.bj1.haodf.net elasticsearch-6.7.2]$ sudo sysctl -p

问题3:system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk

原因: 这是在因为Centos6不支持SecComp,而ES5.2.0默认bootstrap.system_call_filter为true进行检测,所以导致检测失败,失败后直接导致ES不能启动。

解决方案: 在elasticsearch.yml中配置bootstrap.system_call_filter为false,

注意要在Memory下面:

bootstrap.memory_lock: false 
bootstrap.system_call_filter: false

问题4: max file descriptors [65535] for elasticsearch process is too low, increase to at least [65536]

解决方案:修改/etc/security/limits.conf文件

# End of file
* soft nofile 65536
* hard nofile 65536
* soft nproc 6552
"/etc/security/limits.conf" [converted] 53L, 1883C

使用 ulimit -Hn 查看当前值 

[dev@lihuan1-dev.bj1.haodf.net bin]$ sudo vim /etc/profile
[dev@lihuan1-dev.bj1.haodf.net bin]$ ulimit -Hn
65535

注意:修改完后要退出用户重启,再ulimit -Hn 查看当前值,已发生变化。 

2. Mac安装

步骤一:官网下载

步骤二:解压文件

步骤三:终端切换到bin目录下

/Documents/opt/elasticsearch-cluster/elasticsearch-7.2.1/elasticsearch-7.2.1/bin

步骤四:启动es

sh elasticsearch

步骤五:验证结果

http://localhost:9200/

{
    "name":"node-0",
    "cluster_name":"es-cluster-7.2.1",
    "cluster_uuid":"Fv0qn48ET1W7xvReE6QfcA",
    "version":{
        "number":"7.2.1",
        "build_flavor":"default",
        "build_type":"tar",
        "build_hash":"fe6cb20",
        "build_date":"2019-07-24T17:58:29.979462Z",
        "build_snapshot":false,
        "lucene_version":"8.0.0",
        "minimum_wire_compatibility_version":"6.8.0",
        "minimum_index_compatibility_version":"6.0.0-beta1"
    },
    "tagline":"You Know, for Search"
}

到此,相信大家对“Linux下安装Elasticsearch的步骤”有了更深的了解,不妨来实际操作一番吧!这里是创新互联网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!

网页名称:Linux下安装Elasticsearch的步骤
文章出自:https://www.cdcxhl.com/article44/gsigee.html

成都网站建设公司_创新互联,为您提供网站制作外贸网站建设营销型网站建设品牌网站制作品牌网站设计外贸建站

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联

营销型网站建设