下载

先到官网https://www.elastic.co/cn/downloads/past-releases/elasticsearch-5-5-2下载,我安装的是5.5.2的版本,其他版本直接访问官网elastic.co下载需要的版本。注意:5.2.2版本使用的jdk是1.8,其他elastic版本要适当调整jdk版本,怎么安装jdk参照之前的随笔

进入官网页面之后

复制链接地址之后到linux中创建elastic目录,在elastic目录中使用命令 wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.5.2.tar.gz 下载

安装

解压 tar -zxvf elasticsearch-5.5.2.tar.gz

启动

解压之后进入bin目录,直接使用命令sh elasticsearch启动即可

此时如果用的是root用户会报如下错误,因为elastic search不能用root用户启动,解决办法有很多种,我用的是创建用户的方法

[root@localhost bin]# ./elasticsearch
[2017-12-20T17:01:47,922][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [node-1] 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:125) ~[elasticsearch-6.1.1.jar:6.1.1]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:112) ~[elasticsearch-6.1.1.jar:6.1.1]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-6.1.1.jar:6.1.1]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[elasticsearch-cli-6.1.1.jar:6.1.1]
at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-6.1.1.jar:6.1.1]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) ~[elasticsearch-6.1.1.jar:6.1.1]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:85) ~[elasticsearch-6.1.1.jar:6.1.1]
Caused by: java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:104) ~[elasticsearch-6.1.1.jar:6.1.1]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:171) ~[elasticsearch-6.1.1.jar:6.1.1]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:322) ~[elasticsearch-6.1.1.jar:6.1.1]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121) ~[elasticsearch-6.1.1.jar:6.1.1]
... 6 more

解决办法:

#创建用户

adduser elastic

#修改密码(输入要修改的密码,第二次输入是确定密码)

passwd elastic

#elastic文件夹权限赋给elastic用户

chown -R elastic elastic

#切换用户启动

su elastic

sh elasticsearch

看到如下信息说明启动完成,浏览器访问页面即可,默认监听9200端口

单实例安装elastic和启动报错解决的更多相关文章

  1. 安装mongodb后启动报错libstdc++

    安装mongo后启动报错如下图 显然说是libstdc++.so文件版本的问题,这种一般都是gcc版本太低了 接着查询gcc的版本    strings /usr/lib/libstdc++.so.6 ...

  2. MySQL5.7.26安装及启动报错解决

    一.安装依赖包 [root@db01 ~]# yum install -y lrzsz [文件上传/下载] [root@db01 ~]# yum -y install xfsprogs [安装磁盘格式 ...

  3. linux安装tomcat后启动报错Cannot find ./catalina.sh的解决方法

    linux安装tomcat后启动报错: Cannot find ./catalina.shThe file is absent or does not have execute permissionT ...

  4. gitblit在windows10上的安装及服务启动报错处理

    折腾一下午算是装好了,心情不错决定分享一下.安装步骤大同小异网上都有,主要是Failed creating java 这个报错,百度出来的没有一个能给我解决的,摸索半天找出一个自己的方式.为报错而来的 ...

  5. 【转载】struts应用在断网情况下启动报错解决办法(java/net/AbstractPlainSocketImpl.java:178:-1)

    无意间struts应用在有网络的情况下启动正常,在断网的情况下启动报错,报错代码如下图所示: SEVERE: Exception starting filter struts2 Class: java ...

  6. WIN10 ANDROIDSTUDIO1.2 安装完首次启动报错

    环境 ACER NOTEBOOK  WIN10 ANNDROID 1.2 解决方案: 在Android Studio安装目录下的 bin 目录下,找到 idea.properties 文件,在文件最后 ...

  7. win10 安装了virtualBox 启动报错 rc=-5640

    刚刚安装的virtualbox 启动就弹窗报错,,但是通过找到log 发现了下面这样的一处报错: 然后搜素发现是跟win10应用程序错误,,解决办法如下: 1.到控制面板,,--程序 再次尝试,vir ...

  8. Linux安装U盘启动报错Failed to load ldlinux.c32

    报错信息 使用U盘安装linux无法正常启动 Start booting from USB device... SYSLINUX 5.10 EDD 2013-06-04 Copyright (C) 1 ...

  9. Docker安装完成后启动报错:Failed to start Docker Application Container Engine

    报错如下:显示没有启动 先关闭防火墙:防火墙关闭指令请看  <a href="Linux防火墙篇">https://www.cnblogs.com/szx666/p/1 ...

随机推荐

  1. spring 事物(三)—— 声明式事务管理详解

    spring的事务处理分为两种: 1.编程式事务:在程序中控制事务开始,执行和提交:详情请点此跳转: 2.声明式事务:在Spring配置文件中对事务进行配置,无须在程序中写代码:(建议使用) 我对&q ...

  2. Apache+tomcat 动静分离

    环境准备: Centos7 需要软件 jdk-8u45-linux-x64.tar.gz apache-tomcat-.tar.gz apr-.tar.gz apr-util-.tar.gz pcre ...

  3. centos系统jdk安装

    下载Oracle官网的jdk来安装 不使用openjdk 最新的官网地址: https://www.oracle.com/technetwork/java/javase/downloads/jdk8- ...

  4. MySQL数据类型DECIMAL用法详解

    MySQL DECIMAL数据类型用于在数据库中存储精确的数值.我们经常将DECIMAL数据类型用于保留准确精确度的列,例如会计系统中的货币数据. 要定义数据类型为DECIMAL的列,请使用以下语法: ...

  5. 【leetcode】997. Find the Town Judge

    题目如下: In a town, there are N people labelled from 1 to N.  There is a rumor that one of these people ...

  6. 版本控制系统之SVN和GIT的区别

    版本控制器的作用: 1. 可以协同代码管理,让多人开发代码得以实现. 2. 回归到以前的任何一个时间点的代码处(好比:开始写了很多代码,后面有修改了一些,突然IDE崩溃,但是发现还是以前的代码更好,这 ...

  7. Springboot解决使用@Scheduled创建任务时无法在同一时间执行多个任务的BUG

    1.在启动类使用 @SpringBootApplication @EnableJpaRepositories(repositoryFactoryBeanClass = MyRepositoryFact ...

  8. openwrt 编译支持sqlite3

    编译版本加载lib库 ------------------------------Libraries----------------------------------- Filesystem  -- ...

  9. demo_service

    <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit ...

  10. POJ 3126 Prime Path (bfs+欧拉线性素数筛)

    Description The ministers of the cabinet were quite upset by the message from the Chief of Security ...