ELK官网:https://www.elastic.co/
ELK官网文档:https://www.elastic.co/guide/index.html
ELK中文手册:https://www.elastic.co/guide/cn/elasticsearch/guide/current/index.html
ELK中文社区:https://elasticsearch.cn/
ELK-API :https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/transport-client.html
elastic search 目前稳定版已迭代到 7.15.2,和之前版本相比有些不小的改动,以至于网上很多参考文章已经失效无法参考。建议直接安装最新版,使用最新的 API。
下载安装包:https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.15.2-linux-x86_64.tar.gz
解压缩:tar -zxvf elasticsearch-7.15.2-linux-x86_64.tar.gz
进入到es安装目录下的config文件夹中,修改elasticsearch.yml 文件。设置:
cluster.name : 集群名称
node.name :节点名称
path.data : /usr/local/elasticsearch/data
path.logs : /usr/local/elasticsearch/logs
network.host : 0.0.0.0 设置对外服务的http端口,默认 127.0.0.1
http.port: 9200 默认 9200
elasticsearch 不能使用 root 用户启动,需要新建一个用户
useradd testuser
passwd testuser
赋权限 chown -R testuser:testuser /usr/local/elasticsearch
启动 /usr/local/elasticsearch/bin/elasticsearch
默认 -xms -xmx 都是 4g,在我的服务器上启动会自动退出,查看 log 问题(前面设置的路径)发现是 gc 问题。修改 jvm.options 设置为 1g 后解决(哈哈,我没有那么多内存)。
Centos6不支持SecComp,而ES默认bootstrap.system_call_filter为true进行检测,所以导致检测失败,失败后直接导致ES不能启动。
在elasticsearch.yml中新增配置bootstrap.system_call_filter,设为false。
bootstrap.system_call_filter: false
本文来源:程序之心,转载请注明出处!
最新内容
© 2016 - 2024 chengxuzhixin.com All Rights Reserved.