elasticsearch-6.2.3安装

系统环境:CentOS release 6.6java

安装文件及版本:node

elasticsearch-6.2.3bootstrap

jdk:jdk1.8.0_66api

分词器插件:analysis-ik数组

1.安装jdk1,8jvm

2.将elasticsearch-6.2.3.zip上传到目标路径,解压。elasticsearch

3.修改配置文件bin/elasticsearchpost

添加配置ui

# 我添加的 start
export JAVA_HOME=/opt/soft/jdk/jdk1.8.0_66/
export PATH=$JAVA_HOME/bin:$PATH
# 我添加的 end

# 我添加的 start
if [ -x "$JAVA_HOME/bin/java" ]; then
        JAVA="/opt/soft/jdk/jdk1.8.0_66/bin/java"
else
        JAVA=`which java`
fi
# 我添加的 end

修改配置文件config/elasticsearch.yml插件

修改配置

# ---------------------------------- Cluster -----------------------------------
#集群名称,全部节点必须相同
cluster.name: ****
#
# ------------------------------------ Node ------------------------------------
#节点名称,为了区分不一样节点名字,因此不一样节点不能相同
node.name: node-1
#
# ----------------------------------- Paths ------------------------------------
#数据文件存放路径
path.data: /opt/es/data
#日志文件存放路径
path.logs: /opt/es/logs
#
# ----------------------------------- Memory -----------------------------------
#启动时是否锁定内存
#设置为true时会锁定内存介绍系统swaping,同时须要修改系统的参数,在下面系统参数修改会提到
bootstrap.memory_lock: true
#增长这个配置是应为Centos6不支持SecComp,而此版本默认bootstrap.system_call_filter为true进行检测,因此致使检测#失败,失败后直接致使ES不能启动。
bootstrap.system_call_filter: false
#
# ---------------------------------- Network -----------------------------------
#本地地址
network.host: *.*.*.*
#端口号
http.port: 9200
#
# --------------------------------- Discovery ----------------------------------
#节点发现集群的节点数组
discovery.zen.ping.unicast.hosts: ["10.132.92.29", "10.132.92.30"]
#通常设置为master节点数/2+1
discovery.zen.minimum_master_nodes: 2
#
# ---------------------------------- Gateway -----------------------------------
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
#gateway.recover_after_nodes: 3
#
# For more information, consult the gateway module documentation.
#
# ---------------------------------- Various -----------------------------------
#
# Require explicit names when deleting indices:
#
#action.destructive_requires_name: true

修改配置文件config/jvm.options

这个参数通常设置为系统内存的一半,但不超过32G。

-Xms4g
-Xmx4g

修改系统配置

文件/etc/security/limits.conf

work根据你启动elasticsearch的用户名来决定

# allow user 'XXX' mlockall
work soft memlock unlimited
work hard memlock unlimited


文件/etc/sysctl.conf
添加 一行

vm.max_map_count=655360

4.若是须要用到中文分词,安装ik分词插件

将ik安装包解压到elsatic的plugins文件夹下文件夹重命名为analysis-ik,配置文件的文件夹config直接放在analysis-ik文件夹下就能够了。

5.最后增长elasticsearch文件夹的执行权限chmod -R 777 elasticsearch-6.2.3而后使用非root权限执行/bin/elasticsearch -d

查看日志启动状况。

6.增长节点后,须要修改最小选举master的大小

http://地址:端口/索引/类型/settings           post

{"persistent" : {         "discovery.zen.minimum_master_nodes" : 7      } }

相关文章
相关标签/搜索