安装前准备:
1. 安装jdk1.8并配置环境变量
2. 资源调整
2.1 避免错误:max number of threads [1024] for user [work] likely too low, increase to at least [2048]
[root@EPRI-DCLOUD-ES04 dcloud]# cat /etc/security/limits.d/90-nproc.conf
# Default limit for number of user's processes to prevent
# accidental fork bombs.
# See rhbz #432903 for reasoning.
* soft nproc 2048
root soft nproc unlimited
2.2 避免错误:max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]
#vi /etc/sysctl.conf
增加改行配置:vm.max_map_count=262144
保存退出后,执行:
sysctl -p
2.3 避免错误:max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536]
vi /etc/security/limits.conf
添加:
* soft nproc 65536
* hard nproc 65536
* soft nofile 65536
* hard nofile 65536
配置默认模板
curl -XPUT 'http://192.168.6.68:9200/_template/rtf' -H 'Content-Type: application/json' -d'
{
"template": "*",
"settings": { "number_of_shards": 1 },
"mappings": {
"_default_": {
"_all": {
"enabled": true
},
"dynamic_templates": [
{
"strings": {
"match_mapping_type": "string",
"mapping": {
"type": "text",
"analyzer":"ik_max_word",
"ignore_above": 256,
"fields": {
"keyword": {
"type": "keyword"
}
}
}
}
}
]
}
}
}'
chmod u+x grunt