Awesome Elasticsearch


原文链接: Awesome Elasticsearch

虚拟内存低 ElasticSearch 无法启动

默认操作系统的mmap设置较低,会导致内存溢出:

$ vim /etc/sysctl.conf
##添加
echo vm.max_map_count=262144 >/etc/sysctl.d/elastic.conf
$ sysctl vm.max_map_count

beats 安装

https://www.elastic.co/guide/en/beats/metricbeat/current/setup-repositories.html

导入证书

sudo rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch

ELASTICSEARCH=http://elastic:changeme@127.0.0.1:9200

curl -XPUT -H "Content-Type: application/json" 'elastic.lybb.gov.cn/twitter?pretty' -d'
{

"settings" : {
    "index" : {
        "number_of_shards" : 3,
        "number_of_replicas" : 2
    }
}

}'

mapping

{"lzkp":{"mappings":{"lzkp":{"properties":{"content":{"type":"text","analyzer":"ik_max_word","fielddata":true},"depart":{"type":"text","analyzer":"ik_max_word"},"duration":{"type":"double","index":false},"duty":{"type":"text","analyzer":"ik_max_word"},"holiday":{"type":"text","analyzer":"ik_max_word"},"id":{"type":"long","index":false},"logdate":{"type":"date","index":false},"netflag":{"type":"keyword","index":false},"organ":{"type":"text","analyzer":"ik_max_word"},"region":{"type":"keyword","index":false},"special":{"type":"text","analyzer":"ik_max_word"},"term":{"type":"text","analyzer":"ik_max_word"},"user":{"type":"text","analyzer":"ik_max_word"},"workclass":{"type":"text","analyzer":"ik_max_word"}}}}}}
`