安装elasticsearch、IK分词器


前言:

安装jdk1.8.0,只需要下载包放到/usr/local/jdk1.8.0_161即可
写环境变量
#vim /etc/profile
export JAVA_HOME=/usr/local/jdk1.8.0_161
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin


1、下载
#cd /usr/tmp
#wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.1.2.tar.gz
#tar -zxvf elasticsearch-6.1.2.tar.gz
#mv elasticsearch-6.1.2 /usr/local/
#cd /usr/local/elasticsearch-6.1.2


2、新建elasticsearch目录以及相关账号
#groupadd es
#useradd  esuser -g es -p 123456
#chown -R esuser:es /usr/local/elasticsearch-6.1.2
#su esuser
$cd /usr/local/elasticsearch-6.1.2/bin
$./elasticsearch -d
到此ES安装成功

3、安装x-pack
#cd /usr/local/elasticsearch-6.1.2
#./bin/elasticserch-plugin install x-pack  //ps:如果搭建了集群必须每台集群上都安装。  如找不到x-pack,则要离线下载安装


4、切换到root用户,编辑limits.conf 添加类似如下内容
vim /etc/security/limits.conf 
添加如下内容:
* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096
执行
ulimit -SHn 1024000

vi /etc/security/limits.d/90-nproc.conf
* soft nproc 1024
#修改为
* soft nproc 4096

vim /etc/sysctl.conf 
添加下面配置:
vm.max_map_count=655360

并执行命令:
sysctl -p


system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
原因:
这是在因为Centos6不支持SecComp,而ES5.2.0默认bootstrap.system_call_filter为true进行检测,所以导致检测失败,失败后直接导致ES不能启动。
解决:
在config/elasticsearch.yml中配置bootstrap.system_call_filter为false,注意要在Memory下面:
bootstrap.memory_lock: false
bootstrap.system_call_filter: false


bin/elasticsearch  -d


#设置默认密码
bin/x-pack/setup-passwords auto

Changed password for user kibana
PASSWORD kibana = 123456

Changed password for user logstash_system
PASSWORD logstash_system = 123456

Changed password for user elastic
PASSWORD elastic = 123456

准备使用ik分词器

/usr/local/elasticsearch-6.1.2/bin/elasticsearch-plugin install  https://www.isres.com/file/elasticsearch-analysis-ik-6.1.2.zip

[root@38 tmp]# /usr/local/elasticsearch-6.1.2/bin/elasticsearch-plugin install  https://www.isres.com/file/elasticsearch-analysis-ik-6.1.2.zip
-> Downloading https://www.isres.com/file/elasticsearch-analysis-ik-6.1.2.zip
[=================================================] 100%   
-> Installed analysis-ik


GET _cat/health
GET _cluster/health
GET _cat/nodes
GET _cluster/health?level=indices
GET _cluster/health?level=shards
GET _cluster/allocation/explain
GET _cat/indices
GET _cluster/state

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值