首先,我们从官网下载:
(官网:https://www.elastic.co/downloads/elasticsearch)(推荐下载deb或者rpm包,否则坑很多)

启动 (需要依赖java环境)

bin/elasticsearch

这时候会提示以下错误:

[--17T21::,][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:) ~[elasticsearch-5.1..jar:5.1.]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:) ~[elasticsearch-5.1..jar:5.1.]
at org.elasticsearch.cli.SettingCommand.execute(SettingCommand.java:) ~[elasticsearch-5.1..jar:5.1.]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:) ~[elasticsearch-5.1..jar:5.1.]
at org.elasticsearch.cli.Command.main(Command.java:) ~[elasticsearch-5.1..jar:5.1.]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:) ~[elasticsearch-5.1..jar:5.1.]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:) ~[elasticsearch-5.1..jar:5.1.]
Caused by: java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:) ~[elasticsearch-5.1..jar:5.1.]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:) ~[elasticsearch-5.1..jar:5.1.]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:) ~[elasticsearch-5.1..jar:5.1.]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:) ~[elasticsearch-5.1..jar:5.1.]
... more

这个错误的原因是elasticsearch不允许使用root启动,因此我们要解决这个问题需要新建一个用户来启动elasticsearch

具体操作如下:

groupadd elsearch
useradd elsearch -g elsearch -p elsearch
chmod -R config
chown -R elsearch:elsearch elasticsearch

这个时候在这个用户去启动elasticsearch,发现可以启动,但是无法通过web - localhost:9200访问

修改config/elasticsearch.yml 文件

# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: 192.168.0.155
#
# Set a custom port for HTTP:
#
http.port:
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html>

直接运行bin/elasticsearch文件启动elasticsearch,发现报错

max virtual memory areas vm.max_map_count [] likely too low, increase to at least []

于是我临时提高了vm.max_map_count的大小 
*此操作需要root权限

sysctl -w vm.max_map_count=

查看修改结果

sysctl -a|grep vm.max_map_count
vm.max_map_count =

接下来就可以启动elasticsearch了,启动完成使用浏览器访问http://localhost:9200

{
"name" : "Vampire by Night",
"cluster_name" : "elasticsearch",
"version" : {
"number" : "5.0.0-alpha3",
"build_hash" : "cad959b",
"build_date" : "2016-05-26T08:25:57.564Z",
"build_snapshot" : false,
"lucene_version" : "6.0.0"
},
"tagline" : "You Know, for Search"
}

elastic5.4安装错误解决的更多相关文章

  1. ElasticSearch 集群环境搭建,安装ElasticSearch-head插件,安装错误解决

    ElasticSearch-5.3.1集群环境搭建,安装ElasticSearch-head插件,安装错误解决 说起来甚是惭愧,博主在写这篇文章的时候,还没有系统性的学习一下ES,只知道可以拿来做全文 ...

  2. nginx for linux安装及安装错误解决

    nginx:下载地址:http://www.nginx.org/ 1.GCC编译器 安装指令 :yum  install -y  gcc 如果你所使用的是ubuntu,则安装指令为:apt-get i ...

  3. SqlServer2005安装错误解决方法

    前段时间在安装数据库SQL Server2005时,在系统检测这一步计算机报了一个错误,提示“性能监视器计数要求(错误)”,使得安装无法继续进行,于是在网上找了些方法来解决,其中有一个方法最有效,在这 ...

  4. ElasticSearch-5.3.1集群环境搭建,安装ElasticSearch-head插件,安装错误解决

    说起来甚是惭愧,博主在写这篇文章的时候,还没有系统性的学习一下ES,只知道可以拿来做全文检索,功能很牛逼,但是接到了任务不想做也不行, leader让我搭建一下分布式的ES集群环境,用来支持企业信用数 ...

  5. elasticsearch介绍,安装,安装错误解决及相应插件安装

    一.elasticsearch介绍 1.简介(使用的是nosql,更新比mongodb慢): ElasticSearch是一个基于Lucene的搜索服务器.它提供了一个分布式多用户能力的全文搜索引擎, ...

  6. mysql安装错误解决办法

    在我们装mysql数据库时,出现安装失败是一件非常令人烦恼的事情,接下来小编就给大家带来在我们安装mysql数据库失败的一些解决方法,感兴趣的小伙伴们可以参考一下   mysql数据库安装不了了!my ...

  7. ecshop 在php5.5上安装错误解决

    1.找到ecshop\includes\cls_image.php文件 搜索 function gd_version 改成 static function gd_version 2.Strict St ...

  8. [zz]npm安装错误解决方法

    错误: npm ERR! at Object.parse (native) npm ERR! at Packer.readRules (/usr/local/lib/node_modules/npm/ ...

  9. mysql 安装错误 解决方法

    错误及警告信息:TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_time ...

随机推荐

  1. PHP常量总结

    概念 常量我们可以理解为值不变的量.常量只要被定义了,在程序脚本的其他任何地方都不能改变. 因为常量被定义后不能被修改,所以即使重定义常量的值,常量的值也是第一次定义常量时的值 常量不管在哪里被定义, ...

  2. LeetCode OJ 89. Gray Code

    题目 The gray code is a binary numeral system where two successive values differ in only one bit. Give ...

  3. unarjs识别组建compoment

    http://stackoverflow.com/a/28210364/1070244 判断自定义元素,是否为未知元素 chrome和firefox存在差异,尤老 研究的代码 // Chrome re ...

  4. ArcGIS模型构建器案例教程-批量复制工作空间所有要素类

    ArcGIS模型构建器案例教程-批量复制工作空间所有要素类 目的:批量复制工作空间所有要素类 工具名称:WorkspaceCopyFeatureClasses 使用方法:输入工作空间,指定输出工作空间 ...

  5. Unity3D之Lightmap详解

    作者:李志健 Unity 完全集成了光照贴图,可以通过编辑器创建完整的光照贴图,你完全不用担心,所有材质会自动获得光照贴图.光照贴图的意思是,所有灯光的特性将被直接映射到Beast lightmapp ...

  6. MongoDB应用场景

    数据记录如下 /* 1 */ { "_id" : ObjectId("5b56dd19a171d7e9bfb03ac1"), "name" ...

  7. 微信小程序----搜索框input回车搜索事件

    在微信小程序里的搜索框,按软键盘回车键触发搜索事件. <input type="text"  placeholder="搜索" value="{ ...

  8. SVN获取最新代码,完成后续开发

    1.新建一个文件夹,鼠标右键点击文件夹,点击Checkout 2.填写两个路径(项目路径和下载到路径),并确认“ok”

  9. .resources文件转为可视化.resx文件

    ResGen.exe启动闪退.--方法不对 参考:http://www.opdown.com/soft/101205.html 在cmd中启动ResGen.exe. 打开cmd:输入 C:\Windo ...

  10. java面试题:jvm

    jvm内存区域 Q:jvm内存怎么划分的? 答: 方法区(线程共享):各个线程共享的一个区域,用于存储虚拟机加载的类信息.常量.静态变量.即时编译器编译后的代码等数据.虽然 Java 虚拟机规范把方法 ...