环境准备

角色

IP

系统

master, data

10.189.254.217

CentOS 7.9

data

10.189.254.219

CentOS 7.9

ES 软件下载地址 https://elasticsearch.cn/download,我使用的版本是 7.13。

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.13.0-x86_64.rpm
wget https://artifacts.elastic.co/downloads/kibana/kibana-7.13.2-x86_64.rpm

目前是两个 data 节点,如果节点多,可以搞三个 master,其他为 data 节点,master 和 data 节点可以混合部署。

软件安装配置

rpm -ivh elasticsearch-7.13.0-x86_64.rpm
rpm -ivh kibana-7.13.2-x86_64.rpm

集群 ES 参数配置

master 新增如下配置 /etc/elasticsearch/elasticsearch.yml

cluster.name: logging-prod
node.name: master-1
node.roles: [ master,data ]
network.host: 0.0.0.0
discovery.seed_hosts:
   - 10.189.254.217
cluster.initial_master_nodes: 
   - master-1

node 节点新增配置如下/etc/elasticsearch/elasticsearch.yml

cluster.name: logging-prod
node.name: data-1
node.roles: [ data ]
network.host: 0.0.0.0
discovery.seed_hosts:
   - 10.189.254.217
cluster.initial_master_nodes: 
   - master-1

配置完成后,启动集群即可。

systemctl restart elastcsearch

Kibana 配置

Kibana 的配置比较简单,只需要开启下面的配置 /etc/kibana/kibana.yml

erver.host: "0.0.0.0"

配置完成后,启动 kibana。

systemctl restart kibana

然后浏览器打开 10.189.254.217:5601 可以进行管理了。

配置 cerebro

下载地址 https://github.com/lmenezes/cerebro/releases/download/v0.9.4/cerebro-0.9.4-1.noarch.rpm

安装cerebro

rpm -ivh cerebro-0.9.4-1.noarch.rpm
并安装JDK11
yum install java-11-openjdk.x86_64 java-11-openjdk-devel

例如端口修改为9001端口

server.http.port = ${?CEREBRO_PORT}修改为server.http.port = 9000

启动服务

systemctl restart cerebro