Elasticsearch的安装和使用

Elasticsearch的安装和使用

Elasticsearch的下载

下载地址:https://www.elastic.co/downloads/elasticsearch

环境准备:

  1. 安装jdk
  2. 修改系统配置

echo "fs.file-max = 1000000" >> /etc/sysctl.conf

echo “fs.nr_open=6553501” >> /etc/sysctl.conf
echo "vm.max_map_count=262144" >> /etc/sysctl.conf
echo "vm.swappiness = 1" >> /etc/sysctl.conf

sysctl -p
sed -i 's/* soft nofile 65535/* soft nofile 655350/g' /etc/security/limits.conf
sed -i 's/* hard nofile 65535/* hard nofile 655350/g' /etc/security/limits.conf

 

 

修改es配置:config/elasticsearch.yml

[elasticsearch@es01 elasticsearch-5.6.3]$ egrep -v '^#|^$' config/elasticsearch.yml

node.name: es01

network.host: 0.0.0.0

http.port: 9200

 

配置内存的使用:

Config/jvm.properties

elasticsearch不能在root下运行,需要添加用户

useradd elasticsearch

su elasticsearch

bin/elasticsearch –d

验证是否ok

本地集群模式启动

[elasticsearch@es01 elasticsearch-5.6.3]$ bin/elasticsearch -Ehttp.port=7200 -Epath.data=es01

[elasticsearch@es01 elasticsearch-5.6.3]$ bin/elasticsearch -Ehttp.port=8200 -Epath.data=es02

[elasticsearch@es01 elasticsearch-5.6.3]$ bin/elasticsearch -Ehttp.port=7200 -Epath.data=es03

 

posted @ 2019-05-14 15:55  reblue520  阅读(435)  评论(0编辑  收藏  举报