Centos6搭建ELK|Centos6搭建ELK - 01 安装Elasticsearch7.13

更换yum源 CentOS 6已经停止更新支持,同时官方也把yum源删除了,目前CentOS 6系统使用yum命令安装软件包基本都是失败,因此需要更换yum源。

wget -O /etc/yum.repos.d/CentOS-Base.repo http://file.kangle.odata.cc/repo/Centos-6.repo wget -O /etc/yum.repos.d/epel.repo http://file.kangle.odata.cc/repo/epel-6.repo yum makecache

* 注意先备份一下原有的repo文件,以免出问题无法恢复
安装elasticsearch 官方文档 https://www.elastic.co/guide/...
添加yum源
vim /etc/yum.repos.d/elasticsearch.repo[elasticsearch] name=Elasticsearch repository for 7.x packages baseurl=https://artifacts.elastic.co/packages/7.x/yum gpgcheck=1 gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch enabled=0 autorefresh=1 type=rpm-md

安装
yum install -y elasticsearch

配置
vim /etc/elasticsearch/elasticsearch.ymlnode.name: master-node path.data: /data/elasticsearch/es-data path.logs: /data/elasticsearch/es-log http.port: 9200

vim /etc/elasticsearch/jvm.options-Xms1g -Xmx1g

启动 开机启动
service elasticsearch start sudo chkconfig --add elasticsearch chkconfig elasticsearch on

安装elasticsearch-head chrome浏览器插件 下载地址
https://files.cnblogs.com/fil...
查看端口占用
lsof -i:9100

常见问题:
1.启动失败进程被锁:elasticsearch dead but subsys locked
rm -rf /var/lock/subsys/elasticsearch

2.报错ElasticsearchException[java.io.IOException: failed to read /data/website/elasticsearch/es-data/nodes/0/_state/global-5.st];
rm -rf /data/website/elasticsearch/es-data/nodes/0/_state/global-5.st

【Centos6搭建ELK|Centos6搭建ELK - 01 安装Elasticsearch7.13】3.报错The index [xxx/OA1r7HzuS42etn4k1xEjag] was created with version [5.6.16] but the minimum compatible version is [6.0.0-beta1]. It should be re-indexed in Elasticsearch 6.x before upgrading to 7.13.3.
rm -rf /data/website/elasticsearch/es-data/nodes/0/indices/*

    推荐阅读