环境准备

1台centos6操作系统主机,关闭selinux及iptables
官方下载elasticsearch6.0软件包:https://artifacts.elastic.co/...
官方下载java1.8软件包:http://www.oracle.com/technet...

系统配置

创建elasticsearch账户用于启动elasticsearch服务

[root@elasticsearch ~]# useradd elasticsearch

修改系统ulimit并重启

  1.  
    [root@elasticsearch ~]# cat /etc/security/limits.d/90-nproc.conf
  2.  
     
  3.  
    # Default limit for number of user's processes to prevent
  4.  
    # accidental fork bombs.
  5.  
    # See rhbz #432903 for reasoning.
  6.  
     
  7.  
    * soft nproc 1024
  8.  
    root soft nproc unlimited
  9.  
    elasticsearch soft nofile 655360
  10.  
    elasticsearch hard nofile 655360
  11.  
    elasticsearch soft nproc 655360
  12.  
    elasticsearch hard nproc 655360

修改内核参数配置

  1.  
    [root@elasticsearch ~]# echo 'vm.max_map_count = 655360' >> /etc/sysctl.conf
  2.  
    [root@elasticsearch ~]# sysctl -p
  3.  
    net.ipv4.ip_forward = 0
  4.  
    net.ipv4.conf.default.rp_filter = 1
  5.  
    net.ipv4.conf.default.accept_source_route = 0
  6.  
    kernel.sysrq = 0
  7.  
    kernel.core_uses_pid = 1
  8.  
    net.ipv4.tcp_syncookies = 1
  9.  
    error: "net.bridge.bridge-nf-call-ip6tables" is an unknown key
  10.  
    error: "net.bridge.bridge-nf-call-iptables" is an unknown key
  11.  
    error: "net.bridge.bridge-nf-call-arptables" is an unknown key
  12.  
    kernel.msgmnb = 65536
  13.  
    kernel.msgmax = 65536
  14.  
    kernel.shmmax = 68719476736
  15.  
    kernel.shmall = 4294967296
  16.  
    vm.max_map_count = 655360
  17.  
    [root@elasticsearch ~]#

安装java并配置环境变量,jdk版本以实际下载的版本为准

  1.  
    [elasticsearch@elasticsearch software]$ ls
  2.  
    elasticsearch-6.0.0.tar.gz jdk-8u121-linux-x64.tar.gz x-pack-6.0.0.zip
  3.  
    [elasticsearch@elasticsearch software]$ pwd
  4.  
    /home/elasticsearch/software
  5.  
    [elasticsearch@elasticsearch software]$ tar -xf jdk-8u121-linux-x64.tar.gz
  6.  
    [elasticsearch@elasticsearch software]$ ls
  7.  
    elasticsearch-6.0.0.tar.gz jdk1.8.0_121 jdk-8u121-linux-x64.tar.gz x-pack-6.0.0.zip
  8.  
    [elasticsearch@elasticsearch software]$ cat ~/.bashrc
  9.  
     
  10.  
    # .bashrc
  11.  
     
  12.  
    # Source global definitions
  13.  
    if [ -f /etc/bashrc ]; then
  14.  
    . /etc/bashrc
  15.  
    fi
  16.  
     
  17.  
    # User specific aliases and functions
  18.  
     
  19.  
    JAVA_HOME='/home/elasticsearch/software/jdk1.8.0_121'
  20.  
    JRE_HOME="$JAVA_HOME/jre"
  21.  
    CLASSPATH=".:$JAVA_HOME/lib/:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/tools.jar"
  22.  
    PATH="$JAVA_HOME/bin:$JRE_HOME/bin:$PATH"
  23.  
    export JAVA_HOME JRE_HOME PATH CLASSPATH
  24.  
     
  25.  
    [elasticsearch@elasticsearch software]$ source ~/.bashrc
  26.  
    [elasticsearch@elasticsearch software]$ java -version
  27.  
    java version "1.8.0_121"
  28.  
    Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
  29.  
    Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
  30.  
    [elasticsearch@elasticsearch software]$

安装elasticsearch

安装相关软件包

  1.  
    [elasticsearch@elasticsearch software]$ tar -xf elasticsearch-6.0.0.tar.gz
  2.  
    [elasticsearch@elasticsearch software]$ ls
  3.  
    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
  4.  
    [elasticsearch@elasticsearch software]$ cd elasticsearch-6.0.0
  5.  
    [elasticsearch@elasticsearch elasticsearch-6.0.0]$ ls
  6.  
    bin config lib LICENSE.txt modules NOTICE.txt plugins README.textile
  7.  
    [elasticsearch@elasticsearch elasticsearch-6.0.0]$ echo 'network.host: 0.0.0.0' >> config/elasticsearch.yml
  8.  
    [elasticsearch@elasticsearch elasticsearch-6.0.0]$ echo 'bootstrap.system_call_filter: false' >> config/elasticsearch.yml
  9.  
    [elasticsearch@elasticsearch elasticsearch-6.0.0]$ tail config/elasticsearch.yml
  10.  
    # For more information, consult the gateway module documentation.
  11.  
    #
  12.  
    # ---------------------------------- Various -----------------------------------
  13.  
    #
  14.  
    # Require explicit names when deleting indices:
  15.  
    #
  16.  
    #action.destructive_requires_name: true
  17.  
    network.host: 0.0.0.0
  18.  
    bootstrap.system_call_filter: false
  19.  
    [elasticsearch@elasticsearch elasticsearch-6.0.0]$

启动服务

  1.  
    [elasticsearch@elasticsearch elasticsearch-6.0.0]$ ./bin/elasticsearch -d
  2.  
    [elasticsearch@elasticsearch elasticsearch-6.0.0]$ ps -ef | grep elastic
  3.  
    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
  4.  
    503 1626 1532 0 18:41 pts/0 00:00:00 grep elastic
  5.  
    [elasticsearch@elasticsearch elasticsearch-6.0.0]$
  6.  
     

查看集群状态信息

  1.  
    [elasticsearch@elasticsearch elasticsearch-6.0.0]$ curl 'http://localhost:9200/_cat/health?v'
  2.  
    epoch timestamp cluster status node.total node.data shards pri relo init unassign pending_tasks max_task_wait_time active_shards_percent
  3.  
    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并重启即可,详细配置如下

  1.  
    [root@elasticsearch ~]# cat /etc/security/limits.d/90-nproc.conf
  2.  
     
  3.  
    # Default limit for number of user's processes to prevent
  4.  
    # accidental fork bombs.
  5.  
    # See rhbz #432903 for reasoning.
  6.  
     
  7.  
    * soft nproc 1024
  8.  
    root soft nproc unlimited
  9.  
    elasticsearch soft nofile 655360
  10.  
    elasticsearch hard nofile 655360
  11.  
    elasticsearch soft nproc 655360
  12.  
    elasticsearch hard nproc 655360
  13.  
     
  14.  
    [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]

修改内核参数配置

  1.  
    [root@elasticsearch ~]# echo 'vm.max_map_count = 655360' >> /etc/sysctl.conf
  2.  
    [root@elasticsearch ~]# sysctl -p
  3.  
    net.ipv4.ip_forward = 0
  4.  
    net.ipv4.conf.default.rp_filter = 1
  5.  
    net.ipv4.conf.default.accept_source_route = 0
  6.  
    kernel.sysrq = 0
  7.  
    kernel.core_uses_pid = 1
  8.  
    net.ipv4.tcp_syncookies = 1
  9.  
    error: "net.bridge.bridge-nf-call-ip6tables" is an unknown key
  10.  
    error: "net.bridge.bridge-nf-call-iptables" is an unknown key
  11.  
    error: "net.bridge.bridge-nf-call-arptables" is an unknown key
  12.  
    kernel.msgmnb = 65536
  13.  
    kernel.msgmax = 65536
  14.  
    kernel.shmmax = 68719476736
  15.  
    kernel.shmall = 4294967296
  16.  
    vm.max_map_count = 655360
  17.  
    [root@elasticsearch ~]#

参考文档

elasticsearch官方文档:https://www.elastic.co/guide/...

centos6安装elasticsearch6.0的更多相关文章

  1. centos6 安装redis-4.0.9

    从redis官网下载Linux redis4.0.9版本,我下载的redis-4.0.9.tar.gz(目前最新稳定版),下载到/usr/local/src目录,如果没有就mkdir创建一个. 下载链 ...

  2. CentOS6安装Zabbix4.0

    安装依赖包yum install net-snmp-devel libevent-devel libxml2-devel curl-devel libjpeg-devel libpng-devel l ...

  3. Mac环境下 elasticsearch-6.0.1 和 elasticsearch-head 完整安装过程

     安装步骤: 安装java jdk 安装elasticsearch-6.0.1 及中文分词 anslysis-ik-6.0.1 安装elasticsearch-head 下载jdk https://w ...

  4. CentOS6.5安装ElasticSearch6.2.3

    CentOS6.5安装ElasticSearch6.2.3 1.Elastic 需要 Java 8 环境.(安装步骤:http://www.cnblogs.com/hunttown/p/5450463 ...

  5. (转载)CentOS6下 源代码方式安装openERP7.0

    CentOS6下 源代码方式安装openERP7.0 安装背景 :CPU32 bit,CentOS 6.4版本,openERP7.0,linux shell为bash,PostgreSQL9.2 1. ...

  6. Elasticsearch6.0及其head插件安装

    Elasticsearch6.0及其head插件安装 1.下载并解压elasticsearch 2.修改elasticsearch.yml文件 # 集群的名字 cluster.name: my-app ...

  7. (新)elasticsearch6.0版本安装head插件

    ES6.0版本安装head插件 1.1 前言 不知道是我电脑问题还是最近的开源软件都比较**,mysql和elasticsearch新版本变动都比较大. elasticsearch6.0貌似已经不支持 ...

  8. Centos6.5安装Redis3.0备忘记录

    Centos6.5安装Redis3.0 1. 安装C编译环境 首先需要安装编译Redis的C环境,在命令行执行以下命令: [root@itzhouq32 tools] yum install gcc- ...

  9. CentOS6.10安装redis5.0

    1.以安装redis5.0.0为例 下载安装包:http://redis.io 安装非常简单! [root@centos6 ~]#yum install gcc #需要先安装GCC,如果已安装请忽略 ...

随机推荐

  1. T4模板_T4基本结构

    T4文本模板由 指令块.文本块.控制块 组成. 一. 指令块(MSDN文本模板指令) 指令块以@开头,基本的指令块包括<#@ template #> .<#@ parameter# ...

  2. python基础(五)函数

    一.函数概念 函数一词来源于数学,但编程中的「函数」概念,与数学中的函数是有很大不同的,编程中的函数在英文中也有很多不同的叫法.在BASIC中叫做subroutine(子过程或子程序),在Pascal ...

  3. [转帖]go的调度机制.

    调度器 主要基于三个基本对象上,G,M,P(定义在源码的src/runtime/runtime.h文件中) G代表一个goroutine对象,每次go调用的时候,都会创建一个G对象 M代表一个线程,每 ...

  4. java 常见的异常大集合

    算术异常类:ArithmeticExecption 空指针异常类:NullPointerException 类型强制转换异常:ClassCastException 数组负下标异常:NegativeAr ...

  5. GCC 提供的原子操作

    gcc从4.1.2提供了__sync_*系列的built-in函数,用于提供加减和逻辑运算的原子操作. 其声明如下: type __sync_fetch_and_add (type *ptr, typ ...

  6. @Primary 注解引出的问题

    @Primary 注解 刚看到这个,还以为是持久层的注解呢,以为和@Id差不多,一查才知道,这两个风马牛不相及,反倒和@Qualifier以及@Resource有点像了,但是相比而言,后面两个更加的灵 ...

  7. MDN & IRC

    MDN IRC MDN IRC xgqfrms https://developer.mozilla.org/en-US/docs/Mozilla/QA/Getting_Started_with_IRC ...

  8. 图像分割——graph cuts

    Graph cuts是一种基于图论的方法,它是一种能量优化算法,在计算机视觉领域应用于前景背景分割,立体视觉,抠图等. 这类方法首先使用无向图G=<V,E>表示要分割的图像,V和E分别是顶 ...

  9. BZOJ2878 NOI2012迷失游乐园(树形dp+环套树+概率期望)

    考虑树的部分分怎么做.令f[i]为i向子树内走的期望路径长度,转移比较显然.算答案时先把其父亲的答案弄好就可以统计自己的答案了. 环套树也类似.树里直接dp,对环上点暴力考虑环上的每条路径,算完后再在 ...

  10. 【转】64位Ubuntu 16.04搭建嵌入式交叉编译环境arm-linux-gcc过程图解

    64位Ubuntu 16.04搭建嵌入式交叉编译环境arm-linux-gcc过程图解,开发裸机环境之前需要先搭建其开发环境,毕竟工欲善其事必先利其器嘛.  安装步骤 1.准备工具安装目录 下载 ar ...