centos6安装elasticsearch6.0
环境准备
1台centos6操作系统主机,关闭selinux及iptables
官方下载elasticsearch6.0软件包:https://artifacts.elastic.co/...
官方下载java1.8软件包:http://www.oracle.com/technet...
系统配置
创建elasticsearch账户用于启动elasticsearch服务
[root@elasticsearch ~]# useradd elasticsearch
修改系统ulimit并重启
- [root@elasticsearch ~]# cat /etc/security/limits.d/90-nproc.conf
- # Default limit for number of user's processes to prevent
- # accidental fork bombs.
- # See rhbz #432903 for reasoning.
- * soft nproc 1024
- root soft nproc unlimited
- elasticsearch soft nofile 655360
- elasticsearch hard nofile 655360
- elasticsearch soft nproc 655360
- elasticsearch hard nproc 655360
修改内核参数配置
- [root@elasticsearch ~]# echo 'vm.max_map_count = 655360' >> /etc/sysctl.conf
- [root@elasticsearch ~]# sysctl -p
- net.ipv4.ip_forward = 0
- net.ipv4.conf.default.rp_filter = 1
- net.ipv4.conf.default.accept_source_route = 0
- kernel.sysrq = 0
- kernel.core_uses_pid = 1
- net.ipv4.tcp_syncookies = 1
- error: "net.bridge.bridge-nf-call-ip6tables" is an unknown key
- error: "net.bridge.bridge-nf-call-iptables" is an unknown key
- error: "net.bridge.bridge-nf-call-arptables" is an unknown key
- kernel.msgmnb = 65536
- kernel.msgmax = 65536
- kernel.shmmax = 68719476736
- kernel.shmall = 4294967296
- vm.max_map_count = 655360
- [root@elasticsearch ~]#
安装java并配置环境变量,jdk版本以实际下载的版本为准
- [elasticsearch@elasticsearch software]$ ls
- elasticsearch-6.0.0.tar.gz jdk-8u121-linux-x64.tar.gz x-pack-6.0.0.zip
- [elasticsearch@elasticsearch software]$ pwd
- /home/elasticsearch/software
- [elasticsearch@elasticsearch software]$ tar -xf jdk-8u121-linux-x64.tar.gz
- [elasticsearch@elasticsearch software]$ ls
- elasticsearch-6.0.0.tar.gz jdk1.8.0_121 jdk-8u121-linux-x64.tar.gz x-pack-6.0.0.zip
- [elasticsearch@elasticsearch software]$ cat ~/.bashrc
- # .bashrc
- # Source global definitions
- if [ -f /etc/bashrc ]; then
- . /etc/bashrc
- fi
- # User specific aliases and functions
- JAVA_HOME='/home/elasticsearch/software/jdk1.8.0_121'
- JRE_HOME="$JAVA_HOME/jre"
- CLASSPATH=".:$JAVA_HOME/lib/:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/tools.jar"
- PATH="$JAVA_HOME/bin:$JRE_HOME/bin:$PATH"
- export JAVA_HOME JRE_HOME PATH CLASSPATH
- [elasticsearch@elasticsearch software]$ source ~/.bashrc
- [elasticsearch@elasticsearch software]$ java -version
- java version "1.8.0_121"
- Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
- Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
- [elasticsearch@elasticsearch software]$
安装elasticsearch
安装相关软件包
- [elasticsearch@elasticsearch software]$ tar -xf elasticsearch-6.0.0.tar.gz
- [elasticsearch@elasticsearch software]$ ls
- elasticsearch-6.0.0 elasticsearch-6.0.0.tar.gz jdk1.8.0_121 jdk-8u121-linux-x64.tar.gz x-pack-6.0.0.zip
- [elasticsearch@elasticsearch software]$ cd elasticsearch-6.0.0
- [elasticsearch@elasticsearch elasticsearch-6.0.0]$ ls
- bin config lib LICENSE.txt modules NOTICE.txt plugins README.textile
- [elasticsearch@elasticsearch elasticsearch-6.0.0]$ echo 'network.host: 0.0.0.0' >> config/elasticsearch.yml
- [elasticsearch@elasticsearch elasticsearch-6.0.0]$ echo 'bootstrap.system_call_filter: false' >> config/elasticsearch.yml
- [elasticsearch@elasticsearch elasticsearch-6.0.0]$ tail config/elasticsearch.yml
- # For more information, consult the gateway module documentation.
- #
- # ---------------------------------- Various -----------------------------------
- #
- # Require explicit names when deleting indices:
- #
- #action.destructive_requires_name: true
- network.host: 0.0.0.0
- bootstrap.system_call_filter: false
- [elasticsearch@elasticsearch elasticsearch-6.0.0]$
启动服务
- [elasticsearch@elasticsearch elasticsearch-6.0.0]$ ./bin/elasticsearch -d
- [elasticsearch@elasticsearch elasticsearch-6.0.0]$ ps -ef | grep elastic
- 503 1583 1 99 18:41 pts/0 00:00:13 /home/elasticsearch/software/jdk1.8.0_121/bin/java -Xms1g -Xmx1g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+AlwaysPreTouch -server -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -XX:-OmitStackTraceInFastThrow -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -XX:+HeapDumpOnOutOfMemoryError -Des.path.home=/home/elasticsearch/software/elasticsearch-6.0.0 -Des.path.conf=/home/elasticsearch/software/elasticsearch-6.0.0/config -cp /home/elasticsearch/software/elasticsearch-6.0.0/lib/* org.elasticsearch.bootstrap.Elasticsearch -d
- 503 1626 1532 0 18:41 pts/0 00:00:00 grep elastic
- [elasticsearch@elasticsearch elasticsearch-6.0.0]$
查看集群状态信息
- [elasticsearch@elasticsearch elasticsearch-6.0.0]$ curl 'http://localhost:9200/_cat/health?v'
- epoch timestamp cluster status node.total node.data shards pri relo init unassign pending_tasks max_task_wait_time active_shards_percent
- 1515581011 18:43:31 elasticsearch green 1 1 0 0 0 0 0 0 - 100.0%
常见报错
disable system call filters at your own risk
[2018-01-10T18:06:35,482][WARN ][o.e.b.BootstrapChecks ] [fzP4t-4] system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
添加 bootstrap.system_call_filter: false 至ES_HOME/config/elasticsearch.yml即可
max file descriptors [65535]
max file descriptors [65535] for elasticsearch process is too low, increase to at least [65536]
修改系统ulimit并重启即可,详细配置如下
- [root@elasticsearch ~]# cat /etc/security/limits.d/90-nproc.conf
- # Default limit for number of user's processes to prevent
- # accidental fork bombs.
- # See rhbz #432903 for reasoning.
- * soft nproc 1024
- root soft nproc unlimited
- elasticsearch soft nofile 655360
- elasticsearch hard nofile 655360
- elasticsearch soft nproc 655360
- elasticsearch hard nproc 655360
- [root@elasticsearch ~]# reboot
vm.max_map_count [65530] is too low
max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
修改内核参数配置
- [root@elasticsearch ~]# echo 'vm.max_map_count = 655360' >> /etc/sysctl.conf
- [root@elasticsearch ~]# sysctl -p
- net.ipv4.ip_forward = 0
- net.ipv4.conf.default.rp_filter = 1
- net.ipv4.conf.default.accept_source_route = 0
- kernel.sysrq = 0
- kernel.core_uses_pid = 1
- net.ipv4.tcp_syncookies = 1
- error: "net.bridge.bridge-nf-call-ip6tables" is an unknown key
- error: "net.bridge.bridge-nf-call-iptables" is an unknown key
- error: "net.bridge.bridge-nf-call-arptables" is an unknown key
- kernel.msgmnb = 65536
- kernel.msgmax = 65536
- kernel.shmmax = 68719476736
- kernel.shmall = 4294967296
- vm.max_map_count = 655360
- [root@elasticsearch ~]#
参考文档
elasticsearch官方文档:https://www.elastic.co/guide/...
centos6安装elasticsearch6.0的更多相关文章
- centos6 安装redis-4.0.9
从redis官网下载Linux redis4.0.9版本,我下载的redis-4.0.9.tar.gz(目前最新稳定版),下载到/usr/local/src目录,如果没有就mkdir创建一个. 下载链 ...
- CentOS6安装Zabbix4.0
安装依赖包yum install net-snmp-devel libevent-devel libxml2-devel curl-devel libjpeg-devel libpng-devel l ...
- Mac环境下 elasticsearch-6.0.1 和 elasticsearch-head 完整安装过程
安装步骤: 安装java jdk 安装elasticsearch-6.0.1 及中文分词 anslysis-ik-6.0.1 安装elasticsearch-head 下载jdk https://w ...
- CentOS6.5安装ElasticSearch6.2.3
CentOS6.5安装ElasticSearch6.2.3 1.Elastic 需要 Java 8 环境.(安装步骤:http://www.cnblogs.com/hunttown/p/5450463 ...
- (转载)CentOS6下 源代码方式安装openERP7.0
CentOS6下 源代码方式安装openERP7.0 安装背景 :CPU32 bit,CentOS 6.4版本,openERP7.0,linux shell为bash,PostgreSQL9.2 1. ...
- Elasticsearch6.0及其head插件安装
Elasticsearch6.0及其head插件安装 1.下载并解压elasticsearch 2.修改elasticsearch.yml文件 # 集群的名字 cluster.name: my-app ...
- (新)elasticsearch6.0版本安装head插件
ES6.0版本安装head插件 1.1 前言 不知道是我电脑问题还是最近的开源软件都比较**,mysql和elasticsearch新版本变动都比较大. elasticsearch6.0貌似已经不支持 ...
- Centos6.5安装Redis3.0备忘记录
Centos6.5安装Redis3.0 1. 安装C编译环境 首先需要安装编译Redis的C环境,在命令行执行以下命令: [root@itzhouq32 tools] yum install gcc- ...
- CentOS6.10安装redis5.0
1.以安装redis5.0.0为例 下载安装包:http://redis.io 安装非常简单! [root@centos6 ~]#yum install gcc #需要先安装GCC,如果已安装请忽略 ...
随机推荐
- 基于Freemarker的eclipse plugin代码生成器插件开发
固定类型的软件写多了,里面总是有一些复制粘贴改变类名改变量的基础文件,相似程度非常高.作为一名程序员,坚持不多写一行重复代码的精神,写了一个Eclipse的代码生成器插件.插件通过在xml文件中配置的 ...
- Spring4+Spring MVC+MyBatis整合思路
1.Spring框架的搭建 这个很简单,只需要web容器中注册org.springframework.web.context.ContextLoaderListener,并指定spring加载配置文件 ...
- linux shell 执行命令顺序
1.shell命令搜索顺序 在linux shell 中输入一个命令,如果有多个同名指令,shell需要按照一定规则去取优先级高的一个执行,shell命令的搜索顺序为: 1.别名,使用alias创建的 ...
- P3293 [SCOI2016]美味
题目描述 一家餐厅有 n 道菜,编号 1...n ,大家对第 i 道菜的评价值为 ai(1<=i<=n).有 m 位顾客,第 i 位顾客的期望值为 bi,而他的偏好值为 xi .因此,第 ...
- Java中线程同步的理解 - 其实应该叫做Java线程排队
Java中线程同步的理解 我们可以在计算机上运行各种计算机软件程序.每一个运行的程序可能包括多个独立运行的线程(Thread). 线程(Thread)是一份独立运行的程序,有自己专用的运行栈.线程有可 ...
- 学习Spring Boot:(八)Mybatis使用分页插件PageHelper
首先Mybqtis可以通过SQL 的方式实现分页很简单,只要在查询SQL 后面加上limit #{currIndex} , #{pageSize}就可以了. 本文主要介绍使用拦截器的方式实现分页. 实 ...
- AFO NOI2018退役——菜鸡一直是菜鸡
游记DAY -INF连续几天的模拟让我确信我就是菜鸡.以及相信yxd,sjq,cyl神犇一定能够稳了. DAY 0报道,天很热热热热热热热热热. DAY 1开幕式,杜子德很热热热热热热热热热. DAY ...
- 【codeforces 765F】 Souvenirs
http://codeforces.com/problemset/problem/765/F (题目链接) 题意 给出$n$个数的序列,$m$次询问,每次查询区间$[l,r]$之间相差最小的两个数的差 ...
- 卡特兰数Catalan——定义、公式、模型总结
推荐:卡特兰数总结 定义: f(i)表示,从(0,0)出发,到(i,i),每次只能向上或者向右走,并且不越过红线的方案数. 这个图片的点上的数字,其实告诉我们f[i],就可以根据这个n方dp得到. 其 ...
- java使用POI操作XWPFDocument中的XWPFRun(文本)对象的属性详解
java使用POI操作XWPFDocument中的XWPFRun(文本)对象的属性详解 我用的是office word 2016版 XWPFRun是XWPFDocument中的一段文本对象(就是一段文 ...