Hello elasticsearch

Install

1
2
3
4
5
curl -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.2.2.tar.gz

sudo tar -xzvf elasticsearch-5.2.2.tar.gz

sudo chown -R pi:pi elasticsearch-5.2.2

If not change directory’s owner, user command sudo -E ./bin/elasticsearch execute the script, or the java path can’t be find.

Config

./bin/elasticsearch
dispatch memory

1
ES_JAVA_OPTS="-Xms70m -Xmx70m"

./config/elasticsearch.yml
set bootstrap to single machine mode

1
2
3
4
5
6
7
8
9
10
cluster.name: elastic-pi

bootstrap.memory_lock: false
bootstrap.system_call_filter: false

network.host: 0.0.0.0
http.port: 9200

#http.cors.enabled: true
#http.cors.allow-origin: "*"

If exception happen like this
max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]
In single machine mode looks like no this problem

1
2
sudo echo "vm.max_map_count=262144" >> /etc/sysctl.conf
sudo sysctl -p

Plugin

elasticsearch-analysis-ik

Pharse process plugin
release to plugin directory

1
2
3
curl -O https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v5.2.2/elasticsearch-analysis-ik-5.2.2.zip

unzip elasticsearch-analysis-ik-5.2.2.zip

install npm/ nodejs/ elasticsearch-head

Exception

org.elasticsearch.indices.IndexClosedException: closed

delete the origin index and rebuild index, it works.

Could not find any executable java binary. Please install java in your PATH or set JAVA_HOME

make sure java be right configed, and current user has privilege to use elasticsearch/ environment variable

Operate

  1. start
    nohup ./bin/elasticsearch&
    ./bin/elasticsearch -d

  2. stop
    ps -ef|grep elastic
    kill -9 51271