安装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

你可能感兴趣的:(elasticsearch,搜索引擎,java)