ElasticSearch on Ubuntu 16.04 - Heart-Lee/server GitHub Wiki

Install

# install package
$ apt-get install default-jdk
$ wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.0.0.deb
$ dpkg -i elasticsearch-6.0.0.deb

# install plugin
$ cd /usr/share/elasticsearch
$ bin/elasticsearch-plugin install https://github.com/HowookJeong/elasticsearch-analysis-arirang/releases/download/6.0.0/elasticsearch-analysis-arirang-6.0.0.zip
$ bin/elasticsearch-plugin install ingest-geoip
$ bin/elasticsearch-plugin install ingest-user-agent

# after configuration
$ systemctl enable elasticsearch.service

Configuration

  • /etc/elasticsearch/elasticsearch.yml
    • cluster-name
    • node-name: ${HOSTNAME}
    • bootstrap.memory_lock: true
    • network.host
    • discovery.zen.ping.unicast.hosts
    • discovery.zen.minimum_master_nodes
  • /etc/elasticsearch/jvm.options
    • Xms: half of memory, ex) -Xms4g
    • Xmx: half of memory, ex) -Xmx4g
  • /etc/default/elasticsearch
    • MAX_LOCKED_MEMORY=unlimited, if bootstrap.memory_lock: true
  • /usr/lib/systemd/system/elasticsearch.service
    • LimitMEMLOCK=infinity, if bootstrap.memory_lock: true

Test

$ curl -XGET 'localhost:9200/_analyze?pretty' -H 'Content-Type: application/json' -d'
{
  "analyzer" : "arirang_analyzer",
  "text" : "μ•ˆλ…•ν•˜μ„Έμš”. μ €λŠ” μ΄λ§ˆμŒμž…λ‹ˆλ‹€."
}
'