elasticsearch安装配置

参考文章:

elasticsearch安装配置_qianhuan_的博客-CSDN博客_elasticsearch安装配置

##1.下载安装elasticsearch
cd /usr/local/src/
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.6.2.tar.gz
tar -zxvf elasticsearch-6.6.2.tar.gz
vim /usr/local/src/elasticsearch-6.6.2/config/elasticsearch.yml

#在elasticsearch.yml中添加
————————————————
xpack.ml.enabled: false
network.host: 0.0.0.0
http.port: 9200
#内存
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
#允许跨域
http.cors.enabled: true
http.cors.allow-origin: "*"
#集群和节点
cluster.name: test-cluster
node.name: master
node.master: true
————————————————


##2.下载安装elasticsearch插件
/usr/local/src/elasticsearch-6.6.2/bin/elasticsearch-plugin install analysis-icu
/usr/local/src/elasticsearch-6.6.2/bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v6.6.2/elasticsearch-analysis-ik-6.6.2.zip

/usr/local/src/elasticsearch-6.6.2/bin/elasticsearch-plugin list

##3.新建es账户
groupadd elasticsearch
useradd -g elasticsearch elasticsearch 
chown -R elasticsearch:elasticsearch /usr/local/src/elasticsearch-6.6.2/

##4.修改配置
vi /etc/security/limits.conf

##4.启动elasticsearch
su elasticsearch
#4.1直接启动
/usr/local/src/elasticsearch-6.6.2/bin/elasticsearch
#4.2后台启动
/usr/local/src/elasticsearch-6.6.2/bin/elasticsearch -d

启动报错信息1: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
root 用户:vi /etc/sysctl.conf 添加 vm.max_map_count=262144:保存退出之后,执行命令 sysctl -p

启动报错信息2:max number of threads is too low
root 用户:vi /etc/security/limits.conf  在文件最后添加
* soft nofile 65536

* hard nofile 65536

* soft nproc 4096

* hard nproc 4096

启动报错信息3: max number of threads [1024] for user [elasticsearch] is too low, increase to at least [4096]

 vi /etc/security/limits.d/90-nproc.conf  改为4096
修改完记得退出elasticsearch 用户再进




1.下载安装包,注意高版本的elasticsearch要求的jdk版本也高,因为它是用java语言写的。

2.解压

3.vi config/elasticsearch.yml  

4.启动 ./elasticsearch 

5.浏览器打开http://xx.x.xx.xxx:9200/

6.后台启动 ./elasticsearch -d

7.head插件的运行需要node环境

8.安装head插件

9. IK分词插件的安装

10.测试 IK分词

11.使用

1.下载安装包,注意高版本的elasticsearch要求的jdk版本也高,因为它是用java语言写的。
https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.6.2.tar.gz

2.解压
3.vi config/elasticsearch.yml  
添加以下配置:

xpack.ml.enabled: false
network.host: 0.0.0.0
http.port: 9200
#内存
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
#允许跨域
http.cors.enabled: true
http.cors.allow-origin: "*"
#集群和节点
cluster.name: test-cluster
node.name: master
node.master: true

4.启动 ./elasticsearch 
新建es账户

groupadd elasticsearch     //新建一个elasticsearch的用户组

useradd -g elasticsearch elasticsearch  //在elasticsearch用户组下面建立一个elasticsearch的用户
chown -R elasticsearch:elasticsearch elasticsearch-6.6.2/

su elasticsearch

启动报错信息1: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
root 用户:vi /etc/sysctl.conf 添加 vm.max_map_count=262144:保存退出之后,执行命令 sysctl -p

启动报错信息2:max number of threads is too low
root 用户:vi /etc/security/limits.conf  在文件最后添加

* soft nofile 65536

* hard nofile 65536

* soft nproc 4096

* hard nproc 4096

启动报错信息3: max number of threads [1024] for user [elasticsearch] is too low, increase to at least [4096]

 vi /etc/security/limits.d/90-nproc.conf  改为4096
修改完记得退出elasticsearch 用户再进
 

你可能感兴趣的:(elasticsearch)