可以参考:https://segmentfault.com/a/1190000019897522

 基础知识与配置讲解:https://www.cnblogs.com/sunsky303/p/9438737.html

 kibana  操作入门:https://www.cnblogs.com/wmyskxz/p/10241274.html 

 

 

环境搭建

    Ubuntu 14.04.5 LTS
    Elasticsearch 7.2.0
    jdk1.8.174 (不需要,7.X已经集成jdk)

ElasticSearch  安装

curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.2.0-linux-x86_64.tar.gz
  • 解压
tar -xvf elasticsearch-7.2.0-linux-x86_64.tar.gz
  • 后续所有操作都在 elasticsearch-7.2.0 目录里面进行
cd ./elasticsearch-7.2.0/
  • 编辑 ./config/elasticsearch.yml
# 添加或修改
node.name: node-1
network.host: 0.0.0.0
http.port: 9200
cluster.initial_master_nodes: ["node-1"]
  • 修改系统配置,编辑 /etc/sysctl.conf
# 添加或修改
# sudo sysctl -p 使修改生效
vm.max_map_count = 262144

//使生效

sudo sysctl -p   /etc/sysctl.conf

 

 
 
  • 修改 ECS 安全组,放行 9200 端口
  • 启动 elasticsearch  (不要使用root用户启动)
./bin/elasticsearch
{
  "name" : "node-1",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "npPY-fmfRwqJKLKA30ym3Q",
  "version" : {
    "number" : "7.2.0",
    "build_flavor" : "default",
    "build_type" : "tar",
    "build_hash" : "508c38a",
    "build_date" : "2019-06-20T15:54:18.811730Z",
    "build_snapshot" : false,
    "lucene_version" : "8.0.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}
  • 关闭 elasticsearch
# 查询
sudo ps aux | grep elasticsearch
# 关闭
kill pid

常用配置

# url
http://112.xx.xx.xx:9200/_cluster/settings?include_defaults
# Kibana
GET /_cluster/settings?include_defaults
  • 控制 fielddata 允许内存大小(elasticsearch.yml )
# 控制fielddata允许内存大小,达到HEAP 40% 自动清理旧cache
indices.fielddata.cache.size: 40%
  • jvm 堆大小(jvm.options)
-Xms10g
-Xmx10g

插件

  • 查看已安装哪些插件
./bin/elasticsearch-plugin list
  • 安装 analysis-icu 插件(分词器)
./bin/elasticsearch-plugin install analysis-icu
node-1 analysis-icu 7.2.0
  • 用句子测试分词情况
GET /_analyze 
{
  "analyzer": "icu_analyzer",
  "text": "商品价值是凝结在商品中的一般的、无差别的人类劳动,由供给方的社会必要劳动时间决定。"
}

 

Kibana安装及使用说明:https://blog.csdn.net/cb2474600377/article/details/78963247

 

posted on 2019-11-26 16:35  lshan  阅读(212)  评论(0编辑  收藏  举报