博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
K8S 日志收集(三):ES 集群安装
阅读量:4948 次
发布时间:2019-06-11

本文共 2774 字,大约阅读时间需要 9 分钟。

集群设备

ip role
192.168.19.93 master、data
192.168.19.94 data

安装java

elasticsearch 需要java环境

elasticsearch-6.x 要求java版本1.8.0_131 or later

rpm  -ivh http://192.168.19.111:8080/panjunbai/jdk-8u141-linux-x64.rpm

安装elasticsearch

可以使用yum源安装,也可以下载rpm包直接安装

cat /etc/yum.repos.d/elastic.repo [elasticsearch-6.x]name=Elasticsearch repository for 6.x packagesbaseurl=https://artifacts.elastic.co/packages/6.x/yumgpgcheck=1gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearchenabled=1autorefresh=1type=rpm-mdyum install -y  elasticsearch
rpm -ivh http://192.168.19.111:8080/panjunbai/elasticsearch-6.2.4.rpm

配置elasticsearch通用配置

配置java运行内存大小,修改/etc/elasticsearch/jvm.options文件中-Xms -Xmx的值,为java虚拟机运行的内存最小和最大值,必须相同。其他使用默认值即可。

[root@es-2 elasticsearch]# cat /etc/elasticsearch/jvm.options |grep "^-Xm"-Xms6g-Xmx6g

创建elasticsearch运行的日志路径和数据路径

[root@es-2 elasticsearch]# mkdir /data/es-data[root@es-2 elasticsearch]# mkdir /data/es-log[root@es-2 elasticsearch]# chown -R elasticsearch.elasticsearch /data

192.168.19.93 elasticsearch 配置

[root@es-2 elasticsearch]# cat elasticsearch.yml |grep -v "^#"cluster.name: test-panjunbainode.name: node-94path.data: /data/es-datapath.logs: /data/es-lognetwork.host: 192.168.19.94http.port: 9200discovery.zen.ping.unicast.hosts: ["192.168.19.93", "192.168.19.94"]discovery.zen.minimum_master_nodes: 1node.master: truenode.data: true

192.168.19.94 elasticsearch 配置

[root@es-1 elasticsearch]# cat elasticsearch.ymlcluster.name: test-panjunbainode.name: node-93path.data: /data/es-datapath.logs: /data/es-lognetwork.host: 192.168.19.93http.port: 9200discovery.zen.ping.unicast.hosts: ["192.168.19.93", "192.168.19.94"]discovery.zen.minimum_master_nodes: 1node.master: falsenode.data: true

在192.168.19.93、192.168.19.94 启动elasticsearch

systemctl start elasticsearch

启动成功后访问结果

[root@es-2 es-log]# curl 192.168.19.93:9200{  "name" : "node-93",  "cluster_name" : "test-panjunbai",  "cluster_uuid" : "joXSilqGTiyvah-VcIqlYQ",  "version" : {    "number" : "6.2.4",    "build_hash" : "ccec39f",    "build_date" : "2018-04-12T20:37:28.497551Z",    "build_snapshot" : false,    "lucene_version" : "7.2.1",    "minimum_wire_compatibility_version" : "5.6.0",    "minimum_index_compatibility_version" : "5.0.0"  },  "tagline" : "You Know, for Search"}[root@es-2 es-log]# curl 192.168.19.94:9200{  "name" : "node-94",  "cluster_name" : "test-panjunbai",  "cluster_uuid" : "joXSilqGTiyvah-VcIqlYQ",  "version" : {    "number" : "6.2.4",    "build_hash" : "ccec39f",    "build_date" : "2018-04-12T20:37:28.497551Z",    "build_snapshot" : false,    "lucene_version" : "7.2.1",    "minimum_wire_compatibility_version" : "5.6.0",    "minimum_index_compatibility_version" : "5.0.0"  },  "tagline" : "You Know, for Search"}

转载于:https://www.cnblogs.com/panjunbai/p/8966482.html

你可能感兴趣的文章
揭秘:黑客必备的Kali Linux是什么,有哪些弊端?
查看>>
linux系统的远程控制方法——学神IT教育
查看>>
springboot+mybatis报错Invalid bound statement (not found)
查看>>
Linux环境下SolrCloud集群环境搭建关键步骤
查看>>
SPARK安装一:Windows下VirtualBox安装CentOS
查看>>
P3565 [POI2014]HOT-Hotels
查看>>
UVa11078:Open Credit System
查看>>
MongoDB的简单使用
查看>>
git clone 遇到的问题
查看>>
hdfs 命令使用
查看>>
hdu 1709 The Balance
查看>>
prometheus配置
查看>>
定宽320 缩放适配手机屏幕
查看>>
BZOJ 2120 数颜色 【带修改莫队】
查看>>
【noip2004】虫食算——剪枝DFS
查看>>
Codeforces 40 E. Number Table
查看>>
CLR via C#(第3 版)
查看>>
java语法之final
查看>>
关于响应式布局
查看>>
详解ASP.Net 4中的aspnet_regsql.exe
查看>>