在centos7上安装elasticSearch
因为elasticsearch是用java编写的,所以需要先安装JDK;
jdk1.8的安装:安装指导
elasticsearch的下载和安装
一、下载elasticSearch
1、下载地址: http://www.elastic.co/cn/downloads (本篇下载 elasticsearch 5.6.6)




2、使用 wget 命令下载
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.6.tar.gz
二、安装elasticsearch
1、解压elasticsearch到 /usr/local 目录下
tar -zxvf elasticsearch-5.6..tar.gz -C /usr/local/
2、进入到解压的elasticsearch包目录下:cd /usr/local/elasticsearch-5.6.6/
3、启动 ./bin/elasticsearch -d #参数 -d 指的是后台运行

4、使用 curl http://localhost:9200/ 查看是否运行,如果返回如下信息则标示运行正常:

5、elasticsearch默认restful-api的端口是9200 不支持Ip地址,只能在本机用http://localhost:9200来访问。如果需要改变,需要修改配置文件。
默认情况下 Elasticsearch 的 RESTful 服务只有本机才能访问,也就是说无法从主机访问虚拟机中的服务。
可以修改 /etc/elasticsearch/config/elasticsearch.yml 文件,将注释的 network.host 和 http.port 放开,并配置正确的IP;
cd /usr/local/elasticsearch-5.6.
vim config/elasticsearch.yml

6、先将Elasticsearch 关闭,然后启动;
关闭方法:输入命令: ps -ef | grep elasticsearch ,找到进程,然后kill掉就行了;
启动方法:输入命令:su elastic , 然后输入 ./bin/elasticserach -d
7、在谷歌浏览器中打开:http://{server_IP}:9200/

三、问题
1、问题一:启动elasticsearch报错如下:Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000085330000, 2060255232, 0) failed; error='Cannot allocate memory' (errno=12)

解决方法:
由于elasticsearch5.0默认分配jvm空间大小为2g,修改jvm空间分配: vim config/jvm.options
-Xms2g
-Xmx2g
修改为
-Xms512m
-Xmx512m
2、问题二:启动elasticsearch报错如下:org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root

解决方法:
原因是elasticsearch默认是不支持用root用户来启动的,需要添加专门的用户。
cd /usr/local
useradd elastic
chown -R elastic:elastic elasticsearch-5.6./
su elastic
./elasticsearch-5.6./bin/elasticsearch -d
3、问题三:启动报错如下
ERROR: [3] bootstrap checks failed
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
[2]: max number of threads [1775] for user [elastic] is too low, increase to at least [2048]
[3]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
解决方法:
(1)[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
[2]: max number of threads [1775] for user [elastic] is too low, increase to at least [2048]
先切换到root账户下面,使用 vi /etc/security/limits.conf ,增加如下内容
elastic soft nofile
elastic hard nofile
elastic soft nproc
elastic hard nproc
(2)[3]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
使用 vim /etc/sysctl.conf ,增加如下的内容
vm.max_map_count=
输入:sysctl -p ,如下所示

(3)重新启动elasticsearch,
su elastic
cd /usr/local/elasticsearch-5.6.
./bin/elasticsearch -d
在centos7上安装elasticSearch的更多相关文章
- 在centos7上安装Jenkins
在centos7上安装Jenkins 安装 添加yum repos,然后安装 sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins ...
- 在Windows上安装Elasticsearch 5.0
在windows上安装Elasticsearch Elasticsearch可以使用.zip软件包安装在Windows上. elasticsearch-service.bat命令,它将设置Elasti ...
- 在 CentOS7 上安装 zookeeper-3.4.9 服务
在 CentOS7 上安装 zookeeper-3.4.9 服务 1.创建 /usr/local/services/zookeeper 文件夹: mkdir -p /usr/local/service ...
- 在 CentOS7 上安装 MongoDB
在 CentOS7 上安装 MongoDB 1 通过 SecureCRT 连接至 CentOS7 服务器: 2 进入到 /usr/local/ 目录: cd /usr/local 3 在当前目录下创建 ...
- 在 CentOS7 上安装 MySQL5.7
在 CentOS7 上安装 MySQL5.7 1 通过 SecureCRT 连接到阿里云 CentOS7 服务器: 2 进入到目录 /usr/local/ 中: cd /usr/local/ 3 创建 ...
- 在 CentOS7 上安装 Tomcat9
在 CentOS7 上安装 Tomcat9 1 通过 SecureCRT 连接到阿里云 CentOS7 服务器: 2 进入到目录 /usr/local/ 中: cd /usr/local/ 3 创建目 ...
- 在CentOS7上安装JDK1.8
在CentOS7上安装JDK1.8 1 通过 SecureCRT 连接到阿里云 CentOS7 服务器: 2 进入到目录 /usr/local/ 中: cd /usr/local/ 3 创建目录 to ...
- 在Centos7上安装漏洞扫描软件Nessus
本文摘要:简单叙述了在Centos7上安装Nessus扫描器的过程 Nessus 是目前全世界最多人使用的系统漏洞扫描与分析软件,Nessus的用户界面是基于Web界面来访问Nessus漏洞扫描器 ...
- 如何在centos7上安装源码包
在我们使用linux的过程中,有很多程序是通过红帽官网给的系统中安装的,但是一般来说,系统更新的速度比较慢,如果这个时候我们又想用最新版的该怎么办呢?总不能一直等系统升级吧╮(╯﹏╰)╭所以,我们可以 ...
随机推荐
- 利用等概率Rand5产生等概率Rand3(转)
问题本身很明确,但不知道起个什么题目好,姑且先这么说吧. 问题描述:现在有一个叫做Rand5的函数,可以生成等概率的[0, 5)范围内的随机整数,要求利用此函数写一个Rand3函数(除此之外,不能再使 ...
- 关于ros将opencv版本固定“写死”的一些想法
今天主要工作是将ros和zed结合起来,但是发现自己安装了opencv3.1,ros indigo安装的是opencv2.4.8,这就麻烦了,zed支持的是opencv3.1.一开始使用slam2时, ...
- property 、classmethod 、 staticmethod 的用法
@property # property是一个装饰器函数 ,作用:将一个方法伪装成属性 # 所有的装饰器函数都怎么用? 在函数.方法.类的上面一行直接@装饰器的名字 # 装饰器的分类: # 装饰函数 ...
- R语言-直方图
1.直方图 直方图和柱形图的区别:直方图表示频数,柱形图表示数量. 一般直方图的X轴表示取值范围,Y轴表示频数 hist() 函数 > hist(rnorm(1000)) #1000个正态随机数 ...
- 多线程 ThreadLocal
要了解ThreadLocal,首先搞清楚ThreadLocal 是什么?是用来解决什么问题的? ThreadLocal 是线程的局部变量, 是每一个线程所单独持有的,其他线程不能对其进行访问, 通常是 ...
- web前端开发浏览器兼容性处理大全
1.居中问题 div里的内容,IE默认为居中,而FF默认为左对齐,可以尝试增加代码margin: 0 auto; 2.高度问题 两上下排列或嵌套的div,上面的div设置高度(height),如果di ...
- dedecms(织梦系统)如何更新手机版首页模板文件
https://jingyan.baidu.com/article/ad310e80e4b1dd1849f49e8f.html
- k8s volume 基本类型分类
volume 类型 静态volume emptyDir 临时空目录, 用途,pod内多用户同享一个目录.与POD的生命周期一至,POD创建时创建,删除时删除. Hostpath 宿主机1:1映射,用途 ...
- 生成二维码的JAVA
不多说,上代码 package tcc; import java.awt.Color;import java.awt.Graphics2D;import java.awt.image.Buffered ...
- 程序员的数学 三册数学,概率统计、线性代数pdf
程序员的数学1 2012.pdf 2012版 程序员的数学2 概率统计 ,平冈和幸,(日)堀玄著 ,P4006 2015.pdf 2015版 程序员的数学3-线性代数 2016.pdf 2016版 如 ...