Centos6.5安装Elasticsearch

一、可以在网上下载对饮的版本:https://github.com/elastic/elasticsearch,本次安装的是5.5.3。

1 [[email protected] elasticsearch]# ls
2 elasticsearch-5.5.3         elasticsearch-analysis-ik-5.5.3
3 elasticsearch-5.5.3.tar.gz  elasticsearch-analysis-ik-5.5.3.zip

二、将下载的.tar.gz解压,然后进入elasticsearch-5.5.3/config/目录下配置elasticsearch.yml。

三、因为我先暂时配的是单节点,所有就采用默认的方式,如果想自定义,将#号去掉就行。

 1 # ---------------------------------- Cluster -----------------------------------
 2 #
 3 # Use a descriptive name for your cluster:
 4 #
 5 #cluster.name: my-application
 6 #
 7 # ------------------------------------ Node ------------------------------------
 8 #
 9 # Use a descriptive name for the node:
10 #
11 #node.name: node-1
12 #
13 # Add custom attributes to the node:

如果elasticsearch启动报错,这里需要修改,具体问后面再贴出

 1 #bootstrap.memory_lock: true
 2 bootstrap.memory_lock: false
 3 bootstrap.system_call_filter: false
 4 #
 5 # Make sure that the heap size is set to about half the memory available
 6 # on the system and that the owner of the process is allowed to use this
 7 # limit.
 8 #
 9 # Elasticsearch performs poorly when the system is swapping the memory.
10 #
11 # ---------------------------------- Network -----------------------------------
12 #
13 # Set the bind address to a specific IP (IPv4 or IPv6):
14 #
15 #network.host: 192.168.0.1
16 network.host: 0.0.0.0

注意如果不修network.host,默认使用的是localhost,如http://localhost:9200,9200是elasticsearch的默认端口,如果想通过外网访问,则需要将network.host 设置成 0.0.0.0或者部署该elasticsearch服务器的ip地址。

1 # Set a custom port for HTTP:
2 #
3 #http.port: 92004 #transport.tcp.port:9301

这个跟集群节点布置有关系,如果同一台服务器布置了多个节点,则需要修改 http.port,如 http.port:9201, transport.tcp.port:9301。

四、启动 elasticsearch.

1 [[email protected] elasticsearch-5.5.3]$ bin/elasticsearch
2 [2017-09-29T10:48:15,620][INFO ][o.e.n.Node               ] [] initializing ...
3 ......

五、出现的问题:

1、

[2016-11-06T16:27:21,712][WARN ][o.e.b.JNANatives ] unable to install syscall filter:

Java.lang.UnsupportedOperationException: seccomp unavailable: requires kernel 3.5+ with CONFIG_SECCOMPandCONFIG_SECCOMP_FILTERcompiledinatorg.elasticsearch.bootstrap.Seccomp.linuxImpl(Seccomp.java:349) ~[elasticsearch-5.0.0.jar:5.0.0]

at org.elasticsearch.bootstrap.Seccomp.init(Seccomp.java:630) ~[elasticsearch-5.0.0.jar:5.0.0]

原因:报了一大串错误,大家不必惊慌,其实只是一个警告,主要是因为你Linux版本过低造成的。

解决方案:

1)、重新安装新版本的Linux系统

2)、警告不影响使用,可以忽略。选择了忽略,装个系统就回到原点了。

2、

ERROR: bootstrap checks failed。

max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536]

原因:无法创建本地文件问题,用户最大可创建文件数太小

解决方案:

切换到root用户,编辑limits.conf配置文件, 添加类似如下内容:

vi /etc/security/limits.conf

添加如下内容:

* soft   nofile   65536

* hard  nofile  131072

* soft   nproc  2048

* hard  nproc  4096

备注:* 代表Linux所有用户名称(比如 hadoop)

保存、退出、重新登录才可生效

3、

max number of threads [1024] for user [es] likely too low, increase to at least [2048]

原因:无法创建本地线程问题,用户最大可创建线程数太小

解决方案:切换到root用户,进入limits.d目录下,修改90-nproc.conf 配置文件。

vi /etc/security/limits.d/90-nproc.conf

找到如下内容:

* soft nproc 1024

#修改为

* soft nproc 2048

4、

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

原因:最大虚拟内存太小

解决方案:切换到root用户下,修改配置文件sysctl.conf

vi /etc/sysctl.conf

添加下面配置:

vm.max_map_count=655360

并执行命令:

sysctl -p

然后重新启动elasticsearch,即可启动成功。

5、

ElasticSearch启动找不到主机或路由

原因:ElasticSearch 单播配置有问题

解决方案:

检查ElasticSearch中的配置文件

vi  config/elasticsearch.yml

找到如下配置:

discovery.zen.ping.unicast.hosts:["192.168.**.**:9300","192.168.**.**:9300"]

一般情况下,是这里配置有问题,注意书写格式

6、

bin/elasticsearch-plugin install license

ERROR: Unknown plugin license

原因:ElasticSearch5.0.0以后插件命令已经改变

解决方案:使用最新命令安装所有插件

bin/elasticsearch-plugin install x-pack

【Reference】

[1]  http://blog.csdn.net/sinat_28224453/article/details/51134978

[2]  http://www.dajiangtai.com/community/18136.do?origin=csdn-geek&dt=1214

[3]  http://www.cnblogs.com/ShawnYuki/p/6818677.html

时间: 2024-08-08 07:32:14

Centos6.5安装Elasticsearch的相关文章

centos6.8安装Elasticsearch和Kibana

注: Elasticsearch  Kibana 的下载地址统一为https://www.elastic.co/downloads/ 需要相应的安装软件可以加本人微信:WJT1356973472(战神) 一:安装Elasticsearch 下载elasticsearch-2.0.0.tar.gz,执行tar -zxvf elasticsearch-2.0.0.tar.gz解压 进入目录,修改配置文件config/elasticsearch.yml  [xx.yml格式:注意顶格,有空格] 如果要

centos6.8下安装elasticsearch

1.安装java环境 2.安装elasticsearch cd /usr/local/src wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.3.4.tar.gz tar -xvf elasticsearch-1.3.4.tar.gz cd elasticsearch-1.3.4 ./bin/elasticsearch 访问http://localhost:9200即可访问 3

Linux环境CentOS6.9安装配置Elasticsearch6.2.2最全详细教程

Linux环境CentOS6.9安装配置Elasticsearch6.2.2最全详细教程 前言 第一步:下载Elasticsearch6.2.2 第二步:创建应用程序目录 第四步:创建Elasticsearch用户和所在组 第五步:更改解压的Elasticsearch应用所属用户及组 第六步:执行脚本添加可执行权限 第八步:启动 前言 操作系统版本:CentOS6.9 64位(CentOS7及其他Linux系统都没有问题) Elasticsearch版本:6.2.2 这里默认你已经安装配置好了J

Centos6.9安装SonarQube7.6

1 安装前准备 Oracle JDK 8 MySQL数据库,具体可参考Centos6.9安装MySQL5.6 SonarQube7.6,Community Edition版本下载地址:https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-7.6.zip 2 MySQL建库 2.1登录到MySQL mysql -u root -p 输入正确密码,进入MySQL 2.2 创建数据库和用户并授权 -- 数据库 CREATE

ELK学习笔记(一)安装Elasticsearch、Kibana、Logstash和X-Pack

最近在学习ELK的时候踩了不少的坑,特此写个笔记记录下学习过程. 日志主要包括系统日志.应用程序日志和安全日志.系统运维和开发人员可以通过日志了解服务器软硬件信息.检查配置过程中的错误及错误发生的原因.经常分析日志可以了解服务器的负荷,性能安全性,从而及时采取措施纠正错误. 通常,日志被分散的储存不同的设备上.如果你管理数十上百台服务器,你还在使用依次登录每台机器的传统方法查阅日志.这样是不是感觉很繁琐和效率低下.当务之急我们使用集中化的日志管理,例如:开源的syslog,将所有服务器上的日志收

如何在CentOS6上安装Python2.7和Python3.3

原文来自http://toomuchdata.com/2014/02/16/how-to-install-python-on-centos/,个人觉得对在linux安装新版本Python是很有参考意义,因而转载,原文是英文的,本人简单翻译下,大家看懂即可,有不妥的地方请留言. 如何在CentOS 6上同时安装Python 2.7和Python 3.3 本文将介绍如何在CentOS 6上安装Python 2.7和3.3.下面以Python 2.7.6和Python 3.3.5为例进行说明,但本人实

centos6.5安装docker

centos6.5 安装docker 防伪码:吃的苦中苦,方为人上人! 前言:在当今的主流社会中,docker和openstatick是一大主流方向,下面为大家讲解理论知识和实际操作现实中的docker! 理论知识: 相信大家都知道docker是什么?那在这里就不多说了! Docker 基于 Go 语言开发,代码托管在Github上,并遵循Apache 2.0 开源协议. docker的专业叫法是应用容器(Application Container). 为什么要使用docker? 1 .快速交付

CentOS6.5 安装+ Tengine + PHP + MySQL

centos6.5安装+Tengine+php+mysql

centos7安装elasticsearch

1. jdk的安装配置 首先是要安装jdk的, yum list java* yun install java-1.7.0-openjdk.x86_64 然后需要设置一下JAVA_HOME环境变量,那么问题来了,刚才安装的jdk路径在哪? rpm -qa | grep java 看一眼,然后发现有个包叫java-1.7.0-openjdk-1.7.0.111-2.6.7.2.el7_2.x86_64 rpm -ql java-1.7.0-openjdk-1.7.0.111-2.6.7.2.el7