ELK实时日志分析平台(elk+kafka+metricbeat)-elasticsearch部署(五)

本文涉及的产品
检索分析服务 Elasticsearch 版,2核4GB开发者规格 1个月
简介:

192.168.30.121,192.168.30.122,192.168.30.123上配置elasticsearch集群:

  1. 在所有主机上添加elk用户

  2. 在所有主机上解压elasticsearch,并更改属主,组:

    wKioL1nJrjLj9hVsAABsNJXjSQ0844.png

    wKiom1nJrnuTHRmpAAASWIu9Lak227.png

  3. 修改192.168.30.121配置文件:

    #cat>elasticsearch/config/elasticsearch.yml<<EOF
    cluster.name: my-es
    node.name: node-1
    path.data: /usr/local/elk/elasticsearch/data
    path.logs: /usr/local/elk/elasticsearch/logs
    bootstrap.memory_lock: false
    network.host: 192.168.30.121
    http.port: 9200
    discovery.zen.ping.unicast.hosts: ["192.168.30.121", "192.168.30.122","192.168.30.123"]
    discovery.zen.minimum_master_nodes: 2
    node.master: true
    node.data: true
    EOF

    wKioL1nJrr-RRb6AAAAY4iF4dBk204.png

    wKioL1nJrsuyFPlrAAAbCptf6nA762.png

    wKiom1nJrxPzr7t4AAAOHw9rXwA501.png

  4. 修改192.168.30.122配置:

    #cat>elasticsearch/config/elasticsearch.yml<<EOF
    cluster.name: my-es
    node.name: node-2
    path.data: /usr/local/elk/elasticsearch/data
    path.logs: /usr/local/elk/elasticsearch/logs
    bootstrap.memory_lock: false
    network.host: 192.168.30.122
    http.port: 9200
    discovery.zen.ping.unicast.hosts: ["192.168.30.121", "192.168.30.122","192.168.30.123"]
    discovery.zen.minimum_master_nodes: 2
    node.master: true
    node.data: true
    EOF
    wKioL1nJr0zzNK70AAAYBzZc-Vo857.png

    wKiom1nJr5bRJGDoAAAbGvdTXMM114.png

    wKioL1nJr2ay1qnhAAAM6YBOglg038.png

  5. 修改192.168.30.123配置:

    #cat>elasticsearch/config/elasticsearch.yml<<EOF
    cluster.name: my-es
    node.name: node-3
    path.data: /usr/local/elk/elasticsearch/data
    path.logs: /usr/local/elk/elasticsearch/logs
    bootstrap.memory_lock: false
    network.host: 192.168.30.123
    http.port: 9200
    discovery.zen.ping.unicast.hosts: ["192.168.30.121", "192.168.30.122","192.168.30.123"]
    discovery.zen.minimum_master_nodes: 2
    node.master: true
    node.data: true
    EOF

    wKiom1nJsCbQTSwEAAA48kj2I30501.png

    启动:

    cd /usr/local/elk/elasticsearch/logs && nohup sudo -u elk  /usr/local/elk/elasticsearch/bin/elasticsearch &

    检查:

    wKiom1nJsGmhjRG_AABLvfdfJNg138.png

  6. 安装head:

    检查依赖包:

    wKiom1nJsOKht48-AAAk6hSKqcA241.png

    安装:

    wKioL1nJsLfT_plLAABLxHyoqdo921.png

    #git clone https://github.com/mobz/elasticsearch-head.git
    cd elasticsearch-head/
    npm config set registry https://registry.npm.taobao.org 
    npm install   #安装较慢,失败可多次执行


    修改vim Gruntfile.js
                    connect: {
                            server: {
                                    options: {
                                            hostname: "192.168.30.121",
                                            port: 9100,
                                            base: '.',
                                            keepalive: true
                                    }
                            }
                    }

            });

  7. 修改app.js:

    [root@k8s-etcd1elasticsearch-head]# vim _site/app.js

    this.base_uri =this.config.base_uri || this.prefs.get("app-base_uri") ||"http://192.168.30.121:9200";

  8. 在所有elasticsearch的配置文件追添以下两行,然后重启elasticsearch:

    http.cors.enabled: true
    http.cors.allow-origin: "*"

  9. 启动head:

    [root@k8s-etcd1 elk]# cdelasticsearch-head/ && nohup grunt server -d &

  10. 检测:

    wKioL1nJscLTX_ivAAEeRnqiLtc012.png


本文转自 zhuxtqw 51CTO博客,原文链接:http://blog.51cto.com/1054054/1968684,如需转载请自行联系原作者
相关文章
|
4天前
|
存储 机器学习/深度学习 中间件
快速上手 Elasticsearch:Docker Compose 部署详解
本文介绍了如何使用Docker Compose快速搭建Elasticsearch学习环境。Elasticsearch是一款用于实时搜索和分析的分布式中间件,适用于多种场景,如搜索、日志分析、机器学习等。首先,创建docker网络,拉取最新版8.12.2镜像。接着,编写docker-compose.yml文件,配置单节点集群,设置端口映射、内存限制及数据卷挂载。然后,创建并配置数据卷目录,允许远程访问和跨域。最后,启动服务并验证,通过浏览器访问确认服务运行正常。本文为初学者提供了一个简便的Elasticsearch部署方法。
252 4
快速上手 Elasticsearch:Docker Compose 部署详解
|
4天前
|
运维 监控 数据挖掘
应用研发平台EMAS产品常见问题之将阿里后台的日志落到我们后台失败如何解决
应用研发平台EMAS(Enterprise Mobile Application Service)是阿里云提供的一个全栈移动应用开发平台,集成了应用开发、测试、部署、监控和运营服务;本合集旨在总结EMAS产品在应用开发和运维过程中的常见问题及解决方案,助力开发者和企业高效解决技术难题,加速移动应用的上线和稳定运行。
|
4天前
|
存储 监控 数据可视化
日志分析对决:揭示 ELK 与 GrayLog 的优势和差异
日志分析对决:揭示 ELK 与 GrayLog 的优势和差异
300 0
|
4天前
|
JSON Prometheus Cloud Native
Grafana 系列 - 统一展示 -8-ElasticSearch 日志快速搜索仪表板
Grafana 系列 - 统一展示 -8-ElasticSearch 日志快速搜索仪表板
|
4天前
|
Unix Linux iOS开发
Elasticsearch如何配置日志
Elasticsearch如何配置日志
|
3天前
部署elasticsearch集群 - 蓝易云
以上步骤完成后,你就成功部署了一个基本的Elasticsearch集群。根据你的需求,你可能还需要进行更多的优化和配置,例如设置副本数、调整内存设置等。
18 1
|
4天前
|
安全 Linux 数据安全/隐私保护
Windows 部署 Elasticsearch + kibana 8.0 指南
Windows 部署 Elasticsearch + kibana 8.0 指南
30 0
|
4天前
|
存储 安全 网络协议
云服务器 Centos7 部署 Elasticsearch 8.0 + Kibana 8.0 指南
云服务器 Centos7 部署 Elasticsearch 8.0 + Kibana 8.0 指南
26 0
|
4天前
|
消息中间件 存储 运维
更优性能与性价比,从自建 ELK 迁移到 SLS 开始
本文介绍了 SLS 基本能力,并和开源自建 ELK 做了对比,可以看到 SLS 相比开源 ELK 有较大优势。
55418 145
|
4天前
|
消息中间件 Kubernetes Docker
KubeSphere 核心实战之三【在kubesphere平台上部署ElasticSearch、应用商店部署RabbitMQ和应用市场部署Zookeeper】(实操篇 3/4)
KubeSphere 核心实战之三【在kubesphere平台上部署ElasticSearch、应用商店部署RabbitMQ和应用市场部署Zookeeper】(实操篇 3/4)
50 0

热门文章

最新文章